MCPcopy
hub / github.com/onnx/onnx / make_node

Function make_node

onnx/helper.py:134–180  ·  view source on GitHub ↗

Construct a NodeProto. Args: op_type (string): The name of the operator to construct inputs (list of string): list of input names outputs (list of string): list of output names name (string, default None): optional unique identifier for NodeProto doc_stri

(
    op_type: str,
    inputs: Sequence[str],
    outputs: Sequence[str],
    name: str | None = None,
    doc_string: str | None = None,
    domain: str | None = None,
    overload: str | None = None,
    **kwargs: Any,
)

Source from the content-addressed store, hash-verified

132
133
134def make_node(
135 op_type: str,
136 inputs: Sequence[str],
137 outputs: Sequence[str],
138 name: str | None = None,
139 doc_string: str | None = None,
140 domain: str | None = None,
141 overload: str | None = None,
142 **kwargs: Any,
143) -> NodeProto:
144 """Construct a NodeProto.
145
146 Args:
147 op_type (string): The name of the operator to construct
148 inputs (list of string): list of input names
149 outputs (list of string): list of output names
150 name (string, default None): optional unique identifier for NodeProto
151 doc_string (string, default None): optional documentation string for NodeProto
152 domain (string, default None): optional domain for NodeProto.
153 If it's None, we will just use default domain (which is empty)
154 overload (string, default None): optional field, used to
155 resolve calls to model-local functions
156 **kwargs (dict): the attributes of the node. The acceptable values
157 are documented in :func:`make_attribute`.
158
159 Returns:
160 NodeProto
161 """
162 node = NodeProto()
163 node.op_type = op_type
164 node.input.extend(inputs)
165 node.output.extend(outputs)
166 if name:
167 node.name = name
168 if doc_string:
169 node.doc_string = doc_string
170 if domain is not None:
171 node.domain = domain
172 if overload is not None:
173 node.overload = overload
174 if kwargs:
175 node.attribute.extend(
176 make_attribute(key, value)
177 for key, value in sorted(kwargs.items())
178 if value is not None
179 )
180 return node
181
182
183def make_operatorsetid(

Callers 15

_replace_constantFunction · 0.90
test_binarizerMethod · 0.90
test_scalerMethod · 0.90
test_normalizerMethod · 0.90
test_imputer_floatMethod · 0.90
test_imputer_float_2dMethod · 0.90
test_imputer_intMethod · 0.90

Calls 1

make_attributeFunction · 0.85

Tested by 15

test_binarizerMethod · 0.72
test_scalerMethod · 0.72
test_normalizerMethod · 0.72
test_imputer_floatMethod · 0.72
test_imputer_float_2dMethod · 0.72
test_imputer_intMethod · 0.72
test_dict_vectorizerMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…