Skip to content
Snippets Groups Projects
Commit 244f372a authored by Cyril Moineau's avatar Cyril Moineau
Browse files

Update NodeExport docstring.

parent cf7b016f
No related branches found
No related tags found
No related merge requests found
......@@ -92,9 +92,11 @@ class ExportNode(ABC):
This class expose a dictionary ``attributes`` which contains all the information required to generate an export:
- All the attributes of the Aidge node are automatically fetch, the key to get an attribute is the attribute name in python format, example ``no_bias``
- **name**: Name of the Node, ``str``
- **node**: Aidge Node, :py:class:`aidge_core.Node`
- **nb_in**: Number of inputs, ``int``
- **in_name**: unique name for each input, if no input node the name is ``{node_name}_input_{in_id}``, if there is a parent, the name is ``{parent_name}_output_{out_id}``, ``list[str]``
- **in_dims**: A list of the dimension for each inputs, ``list[list[int]]``
- **in_size**: A list of the size for each inputs, ``list[int]``
- **in_chan**: A list of channel for each inputs, deduced by the dataformat, ``list[int]``
- **in_height**: A list of height for each inputs, deduced by the dataformat, ``list[int]``
- **in_width**: A list of width for each inputs, deduced by the dataformat, ``list[int]``
......@@ -103,6 +105,7 @@ class ExportNode(ABC):
- **out_name**: unique name for each output, the name is ``{name}_output_{out_id}``, ``list[str]``
- **nb_out**: Number of outputs, ``int``
- **out_dims**: A list of the dimension for each inputs, ``list[list[int]]``
- **out_size**: A list of the size for each outputs, ``list[int]``
- **out_chan**: A list of channel for each outputs, deduced by the dataformat, ``list[int]``
- **out_height**: A list of height for each outputs, deduced by the dataformat, ``list[int]``
- **out_width**: A list of width for each outputs, deduced by the dataformat, ``list[int]``
......@@ -110,6 +113,16 @@ class ExportNode(ABC):
- **out_cdtype**: A list of type (C/C++ format) for each output, ``List[str]``
- **is_output**: True if the node is an output node, ``bool``
- **is_input**: True if the node is an input node, ``bool``
- **mem_info**: True if mem_info is available for this node, ``bool``
- **mem_info_size**: A list of memory size for each output, ``List[int]``
- **mem_info_offset**: A list of offset to access each output, ``List[int]``
- **mem_info_stride**: old N2D2
- **mem_info_length**: old N2D2
- **mem_info_cont_size**: old N2D2
- **mem_info_cont_offset**: old N2D2
- **mem_info_wrap_offset**: old N2D2
- **mem_info_wrap_size**: old N2D2
"""
@abstractmethod
......@@ -157,11 +170,11 @@ class ExportNode(ABC):
self.attributes["out_height"] = [None] * self.attributes["nb_out"]
self.attributes["out_width"] = [None] * self.attributes["nb_out"]
# Producer don't have meminfo
# Producer don't have mem_info
# TODO: document this attribute
# true if node have meminfo else false
self.attributes["meminfo"] = mem_info is not None and self.node.type() != "Producer"
if self.attributes["meminfo"]:
# true if node have mem_info else false
self.attributes["mem_info"] = mem_info is not None and self.node.type() != "Producer"
if self.attributes["mem_info"]:
self.attributes["mem_info_size"] = [None] * self.attributes["nb_out"]
self.attributes["mem_info_offset"] = [None] * self.attributes["nb_out"]
self.attributes["mem_info_stride"] = [None] * self.attributes["nb_out"]
......@@ -205,9 +218,9 @@ class ExportNode(ABC):
self.attributes["out_chan"][idx] = get_chan(tensor)
self.attributes["out_height"][idx] = get_height(tensor)
self.attributes["out_width"][idx] = get_width(tensor)
# Output meminfo
# Output mem_info
# TODO: add to docstring
if self.attributes["meminfo"]:
if self.attributes["mem_info"]:
if "size" in mem_info[idx]:
self.attributes["mem_info_size"][idx] = mem_info[idx]["size"]
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment