partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
get_squeezenet
r"""SqueezeNet model from the `"SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and <0.5MB model size" <https://arxiv.org/abs/1602.07360>`_ paper. SqueezeNet 1.1 model from the `official SqueezeNet repo <https://github.com/DeepScale/SqueezeNet/tree/master/SqueezeNet_v1.1>`_. SqueezeNet 1.1 ...
python/mxnet/gluon/model_zoo/vision/squeezenet.py
def get_squeezenet(version, pretrained=False, ctx=cpu(), root=os.path.join(base.data_dir(), 'models'), **kwargs): r"""SqueezeNet model from the `"SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and <0.5MB model size" <https://arxiv.org/abs/1602.07360>`_ paper. SqueezeNet 1.1 ...
def get_squeezenet(version, pretrained=False, ctx=cpu(), root=os.path.join(base.data_dir(), 'models'), **kwargs): r"""SqueezeNet model from the `"SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and <0.5MB model size" <https://arxiv.org/abs/1602.07360>`_ paper. SqueezeNet 1.1 ...
[ "r", "SqueezeNet", "model", "from", "the", "SqueezeNet", ":", "AlexNet", "-", "level", "accuracy", "with", "50x", "fewer", "parameters", "and", "<0", ".", "5MB", "model", "size", "<https", ":", "//", "arxiv", ".", "org", "/", "abs", "/", "1602", ".", "...
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/gluon/model_zoo/vision/squeezenet.py#L113-L137
[ "def", "get_squeezenet", "(", "version", ",", "pretrained", "=", "False", ",", "ctx", "=", "cpu", "(", ")", ",", "root", "=", "os", ".", "path", ".", "join", "(", "base", ".", "data_dir", "(", ")", ",", "'models'", ")", ",", "*", "*", "kwargs", "...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
parse_helper
Helper function to parse operator attributes in required format.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def parse_helper(attrs, attrs_name, alt_value=None): """Helper function to parse operator attributes in required format.""" tuple_re = re.compile('\([0-9L|,| ]+\)') if not attrs: return alt_value attrs_str = None if attrs.get(attrs_name) is None else str(attrs.get(attrs_name)) if attrs_str i...
def parse_helper(attrs, attrs_name, alt_value=None): """Helper function to parse operator attributes in required format.""" tuple_re = re.compile('\([0-9L|,| ]+\)') if not attrs: return alt_value attrs_str = None if attrs.get(attrs_name) is None else str(attrs.get(attrs_name)) if attrs_str i...
[ "Helper", "function", "to", "parse", "operator", "attributes", "in", "required", "format", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L69-L84
[ "def", "parse_helper", "(", "attrs", ",", "attrs_name", ",", "alt_value", "=", "None", ")", ":", "tuple_re", "=", "re", ".", "compile", "(", "'\\([0-9L|,| ]+\\)'", ")", "if", "not", "attrs", ":", "return", "alt_value", "attrs_str", "=", "None", "if", "attr...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
transform_padding
Helper function to convert padding format for pad operator.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def transform_padding(pad_width): """Helper function to convert padding format for pad operator. """ num_pad_values = len(pad_width) onnx_pad_width = [0]*num_pad_values start_index = 0 # num_pad_values will always be multiple of 2 end_index = int(num_pad_values/2) for idx in range(0, nu...
def transform_padding(pad_width): """Helper function to convert padding format for pad operator. """ num_pad_values = len(pad_width) onnx_pad_width = [0]*num_pad_values start_index = 0 # num_pad_values will always be multiple of 2 end_index = int(num_pad_values/2) for idx in range(0, nu...
[ "Helper", "function", "to", "convert", "padding", "format", "for", "pad", "operator", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L86-L103
[ "def", "transform_padding", "(", "pad_width", ")", ":", "num_pad_values", "=", "len", "(", "pad_width", ")", "onnx_pad_width", "=", "[", "0", "]", "*", "num_pad_values", "start_index", "=", "0", "# num_pad_values will always be multiple of 2", "end_index", "=", "int...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_string_to_list
Helper function to convert string to list. Used to convert shape attribute string to list format.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_string_to_list(string_val): """Helper function to convert string to list. Used to convert shape attribute string to list format. """ result_list = [] list_string = string_val.split(',') for val in list_string: val = str(val.strip()) val = val.replace("(", "") ...
def convert_string_to_list(string_val): """Helper function to convert string to list. Used to convert shape attribute string to list format. """ result_list = [] list_string = string_val.split(',') for val in list_string: val = str(val.strip()) val = val.replace("(", "") ...
[ "Helper", "function", "to", "convert", "string", "to", "list", ".", "Used", "to", "convert", "shape", "attribute", "string", "to", "list", "format", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L106-L123
[ "def", "convert_string_to_list", "(", "string_val", ")", ":", "result_list", "=", "[", "]", "list_string", "=", "string_val", ".", "split", "(", "','", ")", "for", "val", "in", "list_string", ":", "val", "=", "str", "(", "val", ".", "strip", "(", ")", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
get_inputs
Helper function to get inputs
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def get_inputs(node, kwargs): """Helper function to get inputs""" name = node["name"] proc_nodes = kwargs["proc_nodes"] index_lookup = kwargs["index_lookup"] inputs = node["inputs"] attrs = node.get("attrs", {}) input_nodes = [] for ip in inputs: input_node_id = index_lookup[ip[...
def get_inputs(node, kwargs): """Helper function to get inputs""" name = node["name"] proc_nodes = kwargs["proc_nodes"] index_lookup = kwargs["index_lookup"] inputs = node["inputs"] attrs = node.get("attrs", {}) input_nodes = [] for ip in inputs: input_node_id = index_lookup[ip[...
[ "Helper", "function", "to", "get", "inputs" ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L133-L146
[ "def", "get_inputs", "(", "node", ",", "kwargs", ")", ":", "name", "=", "node", "[", "\"name\"", "]", "proc_nodes", "=", "kwargs", "[", "\"proc_nodes\"", "]", "index_lookup", "=", "kwargs", "[", "\"index_lookup\"", "]", "inputs", "=", "node", "[", "\"input...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
create_basic_op_node
Helper function to create a basic operator node that doesn't contain op specific attrs
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def create_basic_op_node(op_name, node, kwargs): """Helper function to create a basic operator node that doesn't contain op specific attrs""" name, input_nodes, _ = get_inputs(node, kwargs) node = onnx.helper.make_node( op_name, input_nodes, [name], name=name ) r...
def create_basic_op_node(op_name, node, kwargs): """Helper function to create a basic operator node that doesn't contain op specific attrs""" name, input_nodes, _ = get_inputs(node, kwargs) node = onnx.helper.make_node( op_name, input_nodes, [name], name=name ) r...
[ "Helper", "function", "to", "create", "a", "basic", "operator", "node", "that", "doesn", "t", "contain", "op", "specific", "attrs" ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L148-L159
[ "def", "create_basic_op_node", "(", "op_name", ",", "node", ",", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "_", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "node", "=", "onnx", ".", "helper", ".", "make_node", "(", "op_name", ",", "i...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_weights_and_inputs
Helper function to convert weights and inputs.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_weights_and_inputs(node, **kwargs): """Helper function to convert weights and inputs. """ name, _, _ = get_inputs(node, kwargs) if kwargs["is_input"] is False: weights = kwargs["weights"] initializer = kwargs["initializer"] np_arr = weights[name] data_type = ...
def convert_weights_and_inputs(node, **kwargs): """Helper function to convert weights and inputs. """ name, _, _ = get_inputs(node, kwargs) if kwargs["is_input"] is False: weights = kwargs["weights"] initializer = kwargs["initializer"] np_arr = weights[name] data_type = ...
[ "Helper", "function", "to", "convert", "weights", "and", "inputs", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L162-L189
[ "def", "convert_weights_and_inputs", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "_", ",", "_", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "if", "kwargs", "[", "\"is_input\"", "]", "is", "False", ":", "weights", "=", "kwargs",...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_convolution
Map MXNet's convolution operator attributes to onnx's Conv operator and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_convolution(node, **kwargs): """Map MXNet's convolution operator attributes to onnx's Conv operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) kernel_dims = list(parse_helper(attrs, "kernel")) stride_dims = list(parse_helper(attrs, "stride",...
def convert_convolution(node, **kwargs): """Map MXNet's convolution operator attributes to onnx's Conv operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) kernel_dims = list(parse_helper(attrs, "kernel")) stride_dims = list(parse_helper(attrs, "stride",...
[ "Map", "MXNet", "s", "convolution", "operator", "attributes", "to", "onnx", "s", "Conv", "operator", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L193-L219
[ "def", "convert_convolution", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "kernel_dims", "=", "list", "(", "parse_helper", "(", "attrs", ",", "\"kernel\"", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_deconvolution
Map MXNet's deconvolution operator attributes to onnx's ConvTranspose operator and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_deconvolution(node, **kwargs): """Map MXNet's deconvolution operator attributes to onnx's ConvTranspose operator and return the created node. """ name, inputs, attrs = get_inputs(node, kwargs) kernel_dims = list(parse_helper(attrs, "kernel")) stride_dims = list(parse_helper(attrs, "...
def convert_deconvolution(node, **kwargs): """Map MXNet's deconvolution operator attributes to onnx's ConvTranspose operator and return the created node. """ name, inputs, attrs = get_inputs(node, kwargs) kernel_dims = list(parse_helper(attrs, "kernel")) stride_dims = list(parse_helper(attrs, "...
[ "Map", "MXNet", "s", "deconvolution", "operator", "attributes", "to", "onnx", "s", "ConvTranspose", "operator", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L223-L251
[ "def", "convert_deconvolution", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "inputs", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "kernel_dims", "=", "list", "(", "parse_helper", "(", "attrs", ",", "\"kernel\"", ")"...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_crop
Map MXNet's crop operator attributes to onnx's Crop operator and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_crop(node, **kwargs): """Map MXNet's crop operator attributes to onnx's Crop operator and return the created node. """ name, inputs, attrs = get_inputs(node, kwargs) num_inputs = len(inputs) y, x = list(parse_helper(attrs, "offset", [0, 0])) h, w = list(parse_helper(attrs, "h_w"...
def convert_crop(node, **kwargs): """Map MXNet's crop operator attributes to onnx's Crop operator and return the created node. """ name, inputs, attrs = get_inputs(node, kwargs) num_inputs = len(inputs) y, x = list(parse_helper(attrs, "offset", [0, 0])) h, w = list(parse_helper(attrs, "h_w"...
[ "Map", "MXNet", "s", "crop", "operator", "attributes", "to", "onnx", "s", "Crop", "operator", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L255-L281
[ "def", "convert_crop", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "inputs", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "num_inputs", "=", "len", "(", "inputs", ")", "y", ",", "x", "=", "list", "(", "parse_he...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_fully_connected
Map MXNet's FullyConnected operator attributes to onnx's Gemm operator and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_fully_connected(node, **kwargs): """Map MXNet's FullyConnected operator attributes to onnx's Gemm operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) initializer = kwargs["initializer"] no_bias = get_boolean_attribute_value(attrs, "no_bias"...
def convert_fully_connected(node, **kwargs): """Map MXNet's FullyConnected operator attributes to onnx's Gemm operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) initializer = kwargs["initializer"] no_bias = get_boolean_attribute_value(attrs, "no_bias"...
[ "Map", "MXNet", "s", "FullyConnected", "operator", "attributes", "to", "onnx", "s", "Gemm", "operator", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L285-L337
[ "def", "convert_fully_connected", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "initializer", "=", "kwargs", "[", "\"initializer\"", "]", "no_bias", "=", "get_...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_batchnorm
Map MXNet's BatchNorm operator attributes to onnx's BatchNormalization operator and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_batchnorm(node, **kwargs): """Map MXNet's BatchNorm operator attributes to onnx's BatchNormalization operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) momentum = float(attrs.get("momentum", 0.9)) eps = float(attrs.get("eps", 0.001)) b...
def convert_batchnorm(node, **kwargs): """Map MXNet's BatchNorm operator attributes to onnx's BatchNormalization operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) momentum = float(attrs.get("momentum", 0.9)) eps = float(attrs.get("eps", 0.001)) b...
[ "Map", "MXNet", "s", "BatchNorm", "operator", "attributes", "to", "onnx", "s", "BatchNormalization", "operator", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L341-L361
[ "def", "convert_batchnorm", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "momentum", "=", "float", "(", "attrs", ".", "get", "(", "\"momentum\"", ",", "0.9...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_activation
Map MXNet's Activation operator attributes to onnx's Tanh/Relu operator and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_activation(node, **kwargs): """Map MXNet's Activation operator attributes to onnx's Tanh/Relu operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) act_type = attrs["act_type"] # Creating a dictionary here, but if this titlecase pattern #...
def convert_activation(node, **kwargs): """Map MXNet's Activation operator attributes to onnx's Tanh/Relu operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) act_type = attrs["act_type"] # Creating a dictionary here, but if this titlecase pattern #...
[ "Map", "MXNet", "s", "Activation", "operator", "attributes", "to", "onnx", "s", "Tanh", "/", "Relu", "operator", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L429-L460
[ "def", "convert_activation", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "act_type", "=", "attrs", "[", "\"act_type\"", "]", "# Creating a dictionary here, but if...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_pad
Map MXNet's pad operator attributes to onnx's Pad operator and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_pad(node, **kwargs): """Map MXNet's pad operator attributes to onnx's Pad operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) mxnet_pad_width = convert_string_to_list(attrs.get("pad_width")) onnx_pad_width = transform_padding(mxnet_pad_width...
def convert_pad(node, **kwargs): """Map MXNet's pad operator attributes to onnx's Pad operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) mxnet_pad_width = convert_string_to_list(attrs.get("pad_width")) onnx_pad_width = transform_padding(mxnet_pad_width...
[ "Map", "MXNet", "s", "pad", "operator", "attributes", "to", "onnx", "s", "Pad", "operator", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L464-L497
[ "def", "convert_pad", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "mxnet_pad_width", "=", "convert_string_to_list", "(", "attrs", ".", "get", "(", "\"pad_widt...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
create_helper_trans_node
create extra transpose node for dot operator
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def create_helper_trans_node(op_name, input_node, node_name): """create extra transpose node for dot operator""" node_name = op_name + "_" + node_name trans_node = onnx.helper.make_node( 'Transpose', inputs=[input_node], outputs=[node_name], name=node_name ) return tr...
def create_helper_trans_node(op_name, input_node, node_name): """create extra transpose node for dot operator""" node_name = op_name + "_" + node_name trans_node = onnx.helper.make_node( 'Transpose', inputs=[input_node], outputs=[node_name], name=node_name ) return tr...
[ "create", "extra", "transpose", "node", "for", "dot", "operator" ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L500-L509
[ "def", "create_helper_trans_node", "(", "op_name", ",", "input_node", ",", "node_name", ")", ":", "node_name", "=", "op_name", "+", "\"_\"", "+", "node_name", "trans_node", "=", "onnx", ".", "helper", ".", "make_node", "(", "'Transpose'", ",", "inputs", "=", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_dot
Map MXNet's dot operator attributes to onnx's MatMul and Transpose operators based on the values set for transpose_a, transpose_b attributes.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_dot(node, **kwargs): """Map MXNet's dot operator attributes to onnx's MatMul and Transpose operators based on the values set for transpose_a, transpose_b attributes.""" name, input_nodes, attrs = get_inputs(node, kwargs) input_node_a = input_nodes[0] input_node_b = input_nodes[1] ...
def convert_dot(node, **kwargs): """Map MXNet's dot operator attributes to onnx's MatMul and Transpose operators based on the values set for transpose_a, transpose_b attributes.""" name, input_nodes, attrs = get_inputs(node, kwargs) input_node_a = input_nodes[0] input_node_b = input_nodes[1] ...
[ "Map", "MXNet", "s", "dot", "operator", "attributes", "to", "onnx", "s", "MatMul", "and", "Transpose", "operators", "based", "on", "the", "values", "set", "for", "transpose_a", "transpose_b", "attributes", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L513-L550
[ "def", "convert_dot", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "input_node_a", "=", "input_nodes", "[", "0", "]", "input_node_b", "=", "input_nodes", "["...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_linalg_gemm2
Map MXNet's _linalg_gemm2 operator attributes to onnx's MatMul and Transpose operators based on the values set for transpose_a, transpose_b attributes. Return multiple nodes created.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_linalg_gemm2(node, **kwargs): """Map MXNet's _linalg_gemm2 operator attributes to onnx's MatMul and Transpose operators based on the values set for transpose_a, transpose_b attributes. Return multiple nodes created. """ name, input_nodes, attrs = get_inputs(node, kwargs) # Getti...
def convert_linalg_gemm2(node, **kwargs): """Map MXNet's _linalg_gemm2 operator attributes to onnx's MatMul and Transpose operators based on the values set for transpose_a, transpose_b attributes. Return multiple nodes created. """ name, input_nodes, attrs = get_inputs(node, kwargs) # Getti...
[ "Map", "MXNet", "s", "_linalg_gemm2", "operator", "attributes", "to", "onnx", "s", "MatMul", "and", "Transpose", "operators", "based", "on", "the", "values", "set", "for", "transpose_a", "transpose_b", "attributes", ".", "Return", "multiple", "nodes", "created", ...
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L554-L636
[ "def", "convert_linalg_gemm2", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "# Getting the attributes and assigning default values.", "alpha", "=", "float", "(", "at...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_pooling
Map MXNet's Pooling operator attributes to onnx's MaxPool/AveragePool/GlobalMaxPool/GlobalAveragePool operators based on the input node's attributes and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_pooling(node, **kwargs): """Map MXNet's Pooling operator attributes to onnx's MaxPool/AveragePool/GlobalMaxPool/GlobalAveragePool operators based on the input node's attributes and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) kernel = eval(attrs["...
def convert_pooling(node, **kwargs): """Map MXNet's Pooling operator attributes to onnx's MaxPool/AveragePool/GlobalMaxPool/GlobalAveragePool operators based on the input node's attributes and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) kernel = eval(attrs["...
[ "Map", "MXNet", "s", "Pooling", "operator", "attributes", "to", "onnx", "s", "MaxPool", "/", "AveragePool", "/", "GlobalMaxPool", "/", "GlobalAveragePool", "operators", "based", "on", "the", "input", "node", "s", "attributes", "and", "return", "the", "created", ...
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L640-L710
[ "def", "convert_pooling", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "kernel", "=", "eval", "(", "attrs", "[", "\"kernel\"", "]", ")", "pool_type", "=", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_instancenorm
Map MXNet's InstanceNorm operator attributes to onnx's InstanceNormalization operator based on the input node's attributes and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_instancenorm(node, **kwargs): """Map MXNet's InstanceNorm operator attributes to onnx's InstanceNormalization operator based on the input node's attributes and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) eps = float(attrs.get("eps", 0.001)) node...
def convert_instancenorm(node, **kwargs): """Map MXNet's InstanceNorm operator attributes to onnx's InstanceNormalization operator based on the input node's attributes and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) eps = float(attrs.get("eps", 0.001)) node...
[ "Map", "MXNet", "s", "InstanceNorm", "operator", "attributes", "to", "onnx", "s", "InstanceNormalization", "operator", "based", "on", "the", "input", "node", "s", "attributes", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L735-L750
[ "def", "convert_instancenorm", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "eps", "=", "float", "(", "attrs", ".", "get", "(", "\"eps\"", ",", "0.001", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_leakyrelu
Map MXNet's LeakyReLU operator attributes to onnx's Elu/LeakyRelu/PRelu operators based on the input node's attributes and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_leakyrelu(node, **kwargs): """Map MXNet's LeakyReLU operator attributes to onnx's Elu/LeakyRelu/PRelu operators based on the input node's attributes and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) act_type = attrs.get("act_type", "leaky") alpha =...
def convert_leakyrelu(node, **kwargs): """Map MXNet's LeakyReLU operator attributes to onnx's Elu/LeakyRelu/PRelu operators based on the input node's attributes and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) act_type = attrs.get("act_type", "leaky") alpha =...
[ "Map", "MXNet", "s", "LeakyReLU", "operator", "attributes", "to", "onnx", "s", "Elu", "/", "LeakyRelu", "/", "PRelu", "operators", "based", "on", "the", "input", "node", "s", "attributes", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L753-L779
[ "def", "convert_leakyrelu", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "act_type", "=", "attrs", ".", "get", "(", "\"act_type\"", ",", "\"leaky\"", ")", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_softmax
Map MXNet's softmax operator attributes to onnx's Softmax operator and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_softmax(node, **kwargs): """Map MXNet's softmax operator attributes to onnx's Softmax operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) axis = int(attrs.get("axis", -1)) softmax_node = onnx.helper.make_node( "Softmax", inp...
def convert_softmax(node, **kwargs): """Map MXNet's softmax operator attributes to onnx's Softmax operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) axis = int(attrs.get("axis", -1)) softmax_node = onnx.helper.make_node( "Softmax", inp...
[ "Map", "MXNet", "s", "softmax", "operator", "attributes", "to", "onnx", "s", "Softmax", "operator", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L783-L799
[ "def", "convert_softmax", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "axis", "=", "int", "(", "attrs", ".", "get", "(", "\"axis\"", ",", "-", "1", ")...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_softmax_output
Map MXNet's SoftmaxOutput operator attributes to onnx's Softmax operator and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_softmax_output(node, **kwargs): """Map MXNet's SoftmaxOutput operator attributes to onnx's Softmax operator and return the created node. """ name = node["name"] input1_idx = kwargs["index_lookup"][node["inputs"][0][0]] input1 = kwargs["proc_nodes"][input1_idx] softmax_node = on...
def convert_softmax_output(node, **kwargs): """Map MXNet's SoftmaxOutput operator attributes to onnx's Softmax operator and return the created node. """ name = node["name"] input1_idx = kwargs["index_lookup"][node["inputs"][0][0]] input1 = kwargs["proc_nodes"][input1_idx] softmax_node = on...
[ "Map", "MXNet", "s", "SoftmaxOutput", "operator", "attributes", "to", "onnx", "s", "Softmax", "operator", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L805-L822
[ "def", "convert_softmax_output", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", "=", "node", "[", "\"name\"", "]", "input1_idx", "=", "kwargs", "[", "\"index_lookup\"", "]", "[", "node", "[", "\"inputs\"", "]", "[", "0", "]", "[", "0", "]", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_logistic_regression_output
Map MXNet's SoftmaxOutput operator attributes to onnx's Softmax operator and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_logistic_regression_output(node, **kwargs): """Map MXNet's SoftmaxOutput operator attributes to onnx's Softmax operator and return the created node. """ name = node["name"] input1_idx = kwargs["index_lookup"][node["inputs"][0][0]] input1 = kwargs["proc_nodes"][input1_idx] sigmoid...
def convert_logistic_regression_output(node, **kwargs): """Map MXNet's SoftmaxOutput operator attributes to onnx's Softmax operator and return the created node. """ name = node["name"] input1_idx = kwargs["index_lookup"][node["inputs"][0][0]] input1 = kwargs["proc_nodes"][input1_idx] sigmoid...
[ "Map", "MXNet", "s", "SoftmaxOutput", "operator", "attributes", "to", "onnx", "s", "Softmax", "operator", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L825-L838
[ "def", "convert_logistic_regression_output", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", "=", "node", "[", "\"name\"", "]", "input1_idx", "=", "kwargs", "[", "\"index_lookup\"", "]", "[", "node", "[", "\"inputs\"", "]", "[", "0", "]", "[", "0...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_concat
Map MXNet's Concat operator attributes to onnx's Concat operator and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_concat(node, **kwargs): """Map MXNet's Concat operator attributes to onnx's Concat operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) axis = int(attrs.get("dim", 1)) concat_node = onnx.helper.make_node( "Concat", input_nodes...
def convert_concat(node, **kwargs): """Map MXNet's Concat operator attributes to onnx's Concat operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) axis = int(attrs.get("dim", 1)) concat_node = onnx.helper.make_node( "Concat", input_nodes...
[ "Map", "MXNet", "s", "Concat", "operator", "attributes", "to", "onnx", "s", "Concat", "operator", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L851-L865
[ "def", "convert_concat", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "axis", "=", "int", "(", "attrs", ".", "get", "(", "\"dim\"", ",", "1", ")", ")",...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_transpose
Map MXNet's transpose operator attributes to onnx's Transpose operator and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_transpose(node, **kwargs): """Map MXNet's transpose operator attributes to onnx's Transpose operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) axes = attrs.get("axes", ()) if axes: axes = tuple(map(int, re.findall(r'\d+', axes))) ...
def convert_transpose(node, **kwargs): """Map MXNet's transpose operator attributes to onnx's Transpose operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) axes = attrs.get("axes", ()) if axes: axes = tuple(map(int, re.findall(r'\d+', axes))) ...
[ "Map", "MXNet", "s", "transpose", "operator", "attributes", "to", "onnx", "s", "Transpose", "operator", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L869-L894
[ "def", "convert_transpose", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "axes", "=", "attrs", ".", "get", "(", "\"axes\"", ",", "(", ")", ")", "if", "...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_lrn
Map MXNet's LRN operator attributes to onnx's LRN operator and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_lrn(node, **kwargs): """Map MXNet's LRN operator attributes to onnx's LRN operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) alpha = float(attrs.get("alpha", 0.0001)) beta = float(attrs.get("beta", 0.75)) bias = float(attrs.get("knorm",...
def convert_lrn(node, **kwargs): """Map MXNet's LRN operator attributes to onnx's LRN operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) alpha = float(attrs.get("alpha", 0.0001)) beta = float(attrs.get("beta", 0.75)) bias = float(attrs.get("knorm",...
[ "Map", "MXNet", "s", "LRN", "operator", "attributes", "to", "onnx", "s", "LRN", "operator", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L898-L920
[ "def", "convert_lrn", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "alpha", "=", "float", "(", "attrs", ".", "get", "(", "\"alpha\"", ",", "0.0001", ")",...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_l2normalization
Map MXNet's L2Normalization operator attributes to onnx's LpNormalization operator and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_l2normalization(node, **kwargs): """Map MXNet's L2Normalization operator attributes to onnx's LpNormalization operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) mode = attrs.get("mode", "instance") if mode != "channel": raise Attri...
def convert_l2normalization(node, **kwargs): """Map MXNet's L2Normalization operator attributes to onnx's LpNormalization operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) mode = attrs.get("mode", "instance") if mode != "channel": raise Attri...
[ "Map", "MXNet", "s", "L2Normalization", "operator", "attributes", "to", "onnx", "s", "LpNormalization", "operator", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L924-L942
[ "def", "convert_l2normalization", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "mode", "=", "attrs", ".", "get", "(", "\"mode\"", ",", "\"instance\"", ")", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_dropout
Map MXNet's Dropout operator attributes to onnx's Dropout operator and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_dropout(node, **kwargs): """Map MXNet's Dropout operator attributes to onnx's Dropout operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) probability = float(attrs.get("p", 0.5)) dropout_node = onnx.helper.make_node( "Dropout", ...
def convert_dropout(node, **kwargs): """Map MXNet's Dropout operator attributes to onnx's Dropout operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) probability = float(attrs.get("p", 0.5)) dropout_node = onnx.helper.make_node( "Dropout", ...
[ "Map", "MXNet", "s", "Dropout", "operator", "attributes", "to", "onnx", "s", "Dropout", "operator", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L946-L961
[ "def", "convert_dropout", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "probability", "=", "float", "(", "attrs", ".", "get", "(", "\"p\"", ",", "0.5", "...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_clip
Map MXNet's Clip operator attributes to onnx's Clip operator and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_clip(node, **kwargs): """Map MXNet's Clip operator attributes to onnx's Clip operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) a_min = np.float(attrs.get('a_min', -np.inf)) a_max = np.float(attrs.get('a_max', np.inf)) clip_node = onnx...
def convert_clip(node, **kwargs): """Map MXNet's Clip operator attributes to onnx's Clip operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) a_min = np.float(attrs.get('a_min', -np.inf)) a_max = np.float(attrs.get('a_max', np.inf)) clip_node = onnx...
[ "Map", "MXNet", "s", "Clip", "operator", "attributes", "to", "onnx", "s", "Clip", "operator", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L972-L989
[ "def", "convert_clip", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "a_min", "=", "np", ".", "float", "(", "attrs", ".", "get", "(", "'a_min'", ",", "-...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
scalar_op_helper
Helper function for scalar arithmetic operations
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def scalar_op_helper(node, op_name, **kwargs): """Helper function for scalar arithmetic operations""" name, input_nodes, attrs = get_inputs(node, kwargs) from onnx import numpy_helper input_type = kwargs["in_type"] scalar_value = np.array([attrs.get("scalar", 1)], dtype=o...
def scalar_op_helper(node, op_name, **kwargs): """Helper function for scalar arithmetic operations""" name, input_nodes, attrs = get_inputs(node, kwargs) from onnx import numpy_helper input_type = kwargs["in_type"] scalar_value = np.array([attrs.get("scalar", 1)], dtype=o...
[ "Helper", "function", "for", "scalar", "arithmetic", "operations" ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L992-L1066
[ "def", "scalar_op_helper", "(", "node", ",", "op_name", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "from", "onnx", "import", "numpy_helper", "input_type", "=", "kwargs", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_argmax
Map MXNet's argmax operator attributes to onnx's ArgMax operator and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_argmax(node, **kwargs): """Map MXNet's argmax operator attributes to onnx's ArgMax operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) axis = int(attrs.get("axis")) keepdims = get_boolean_attribute_value(attrs, "keepdims") node = onnx.h...
def convert_argmax(node, **kwargs): """Map MXNet's argmax operator attributes to onnx's ArgMax operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) axis = int(attrs.get("axis")) keepdims = get_boolean_attribute_value(attrs, "keepdims") node = onnx.h...
[ "Map", "MXNet", "s", "argmax", "operator", "attributes", "to", "onnx", "s", "ArgMax", "operator", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L1131-L1148
[ "def", "convert_argmax", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "axis", "=", "int", "(", "attrs", ".", "get", "(", "\"axis\"", ")", ")", "keepdims"...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_reshape
Map MXNet's Reshape operator attributes to onnx's Reshape operator. Converts output shape attribute to output shape tensor and return multiple created nodes.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_reshape(node, **kwargs): """Map MXNet's Reshape operator attributes to onnx's Reshape operator. Converts output shape attribute to output shape tensor and return multiple created nodes. """ name, input_nodes, attrs = get_inputs(node, kwargs) output_shape_list = convert_string_to_lis...
def convert_reshape(node, **kwargs): """Map MXNet's Reshape operator attributes to onnx's Reshape operator. Converts output shape attribute to output shape tensor and return multiple created nodes. """ name, input_nodes, attrs = get_inputs(node, kwargs) output_shape_list = convert_string_to_lis...
[ "Map", "MXNet", "s", "Reshape", "operator", "attributes", "to", "onnx", "s", "Reshape", "operator", ".", "Converts", "output", "shape", "attribute", "to", "output", "shape", "tensor", "and", "return", "multiple", "created", "nodes", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L1422-L1464
[ "def", "convert_reshape", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "output_shape_list", "=", "convert_string_to_list", "(", "attrs", "[", "\"shape\"", "]", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_cast
Map MXNet's Cast operator attributes to onnx's Cast operator and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_cast(node, **kwargs): """Map MXNet's Cast operator attributes to onnx's Cast operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) dtype = attrs["dtype"] # dtype can be mapped only with types from TensorProto # float32 is mapped to float ...
def convert_cast(node, **kwargs): """Map MXNet's Cast operator attributes to onnx's Cast operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) dtype = attrs["dtype"] # dtype can be mapped only with types from TensorProto # float32 is mapped to float ...
[ "Map", "MXNet", "s", "Cast", "operator", "attributes", "to", "onnx", "s", "Cast", "operator", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L1467-L1490
[ "def", "convert_cast", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "dtype", "=", "attrs", "[", "\"dtype\"", "]", "# dtype can be mapped only with types from Tenso...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_slice_axis
Map MXNet's slice_axis operator attributes to onnx's Slice operator and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_slice_axis(node, **kwargs): """Map MXNet's slice_axis operator attributes to onnx's Slice operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) axes = int(attrs.get("axis")) starts = int(attrs.get("begin")) ends = int(attrs.get("end", None...
def convert_slice_axis(node, **kwargs): """Map MXNet's slice_axis operator attributes to onnx's Slice operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) axes = int(attrs.get("axis")) starts = int(attrs.get("begin")) ends = int(attrs.get("end", None...
[ "Map", "MXNet", "s", "slice_axis", "operator", "attributes", "to", "onnx", "s", "Slice", "operator", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L1494-L1515
[ "def", "convert_slice_axis", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "axes", "=", "int", "(", "attrs", ".", "get", "(", "\"axis\"", ")", ")", "start...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_slice_channel
Map MXNet's SliceChannel operator attributes to onnx's Squeeze or Split operator based on squeeze_axis attribute and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_slice_channel(node, **kwargs): """Map MXNet's SliceChannel operator attributes to onnx's Squeeze or Split operator based on squeeze_axis attribute and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) num_outputs = int(attrs.get("num_outputs")) axi...
def convert_slice_channel(node, **kwargs): """Map MXNet's SliceChannel operator attributes to onnx's Squeeze or Split operator based on squeeze_axis attribute and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) num_outputs = int(attrs.get("num_outputs")) axi...
[ "Map", "MXNet", "s", "SliceChannel", "operator", "attributes", "to", "onnx", "s", "Squeeze", "or", "Split", "operator", "based", "on", "squeeze_axis", "attribute", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L1519-L1553
[ "def", "convert_slice_channel", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "num_outputs", "=", "int", "(", "attrs", ".", "get", "(", "\"num_outputs\"", ")"...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_expand_dims
Map MXNet's expand_dims operator attributes to onnx's Unsqueeze operator and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_expand_dims(node, **kwargs): """Map MXNet's expand_dims operator attributes to onnx's Unsqueeze operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) axis = int(attrs.get("axis")) node = onnx.helper.make_node( "Unsqueeze", inp...
def convert_expand_dims(node, **kwargs): """Map MXNet's expand_dims operator attributes to onnx's Unsqueeze operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) axis = int(attrs.get("axis")) node = onnx.helper.make_node( "Unsqueeze", inp...
[ "Map", "MXNet", "s", "expand_dims", "operator", "attributes", "to", "onnx", "s", "Unsqueeze", "operator", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L1557-L1572
[ "def", "convert_expand_dims", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "axis", "=", "int", "(", "attrs", ".", "get", "(", "\"axis\"", ")", ")", "node...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_squeeze
Map MXNet's squeeze operator attributes to onnx's squeeze operator and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_squeeze(node, **kwargs): """Map MXNet's squeeze operator attributes to onnx's squeeze operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) axis = attrs.get("axis", None) if not axis: raise AttributeError("Squeeze: Missing axis attribu...
def convert_squeeze(node, **kwargs): """Map MXNet's squeeze operator attributes to onnx's squeeze operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) axis = attrs.get("axis", None) if not axis: raise AttributeError("Squeeze: Missing axis attribu...
[ "Map", "MXNet", "s", "squeeze", "operator", "attributes", "to", "onnx", "s", "squeeze", "operator", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L1575-L1594
[ "def", "convert_squeeze", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "axis", "=", "attrs", ".", "get", "(", "\"axis\"", ",", "None", ")", "if", "not", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_depthtospace
Map MXNet's depth_to_space operator attributes to onnx's DepthToSpace operator and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_depthtospace(node, **kwargs): """Map MXNet's depth_to_space operator attributes to onnx's DepthToSpace operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) blksize = int(attrs.get("block_size", 0)) node = onnx.helper.make_node( "Dept...
def convert_depthtospace(node, **kwargs): """Map MXNet's depth_to_space operator attributes to onnx's DepthToSpace operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) blksize = int(attrs.get("block_size", 0)) node = onnx.helper.make_node( "Dept...
[ "Map", "MXNet", "s", "depth_to_space", "operator", "attributes", "to", "onnx", "s", "DepthToSpace", "operator", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L1633-L1648
[ "def", "convert_depthtospace", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "blksize", "=", "int", "(", "attrs", ".", "get", "(", "\"block_size\"", ",", "0...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_square
Map MXNet's square operator attributes to onnx's Pow operator and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_square(node, **kwargs): """Map MXNet's square operator attributes to onnx's Pow operator and return the created node. """ name, input_nodes, _ = get_inputs(node, kwargs) initializer = kwargs["initializer"] data_type = onnx.mapping.NP_TYPE_TO_TENSOR_TYPE[np.dtype('int64')] power...
def convert_square(node, **kwargs): """Map MXNet's square operator attributes to onnx's Pow operator and return the created node. """ name, input_nodes, _ = get_inputs(node, kwargs) initializer = kwargs["initializer"] data_type = onnx.mapping.NP_TYPE_TO_TENSOR_TYPE[np.dtype('int64')] power...
[ "Map", "MXNet", "s", "square", "operator", "attributes", "to", "onnx", "s", "Pow", "operator", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L1669-L1698
[ "def", "convert_square", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "_", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "initializer", "=", "kwargs", "[", "\"initializer\"", "]", "data_type", "=", "onnx", ".", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_sum
Map MXNet's sum operator attributes to onnx's ReduceSum operator and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_sum(node, **kwargs): """Map MXNet's sum operator attributes to onnx's ReduceSum operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) mx_axis = attrs.get("axis", None) axes = convert_string_to_list(str(mx_axis)) if mx_axis is not None else Non...
def convert_sum(node, **kwargs): """Map MXNet's sum operator attributes to onnx's ReduceSum operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) mx_axis = attrs.get("axis", None) axes = convert_string_to_list(str(mx_axis)) if mx_axis is not None else Non...
[ "Map", "MXNet", "s", "sum", "operator", "attributes", "to", "onnx", "s", "ReduceSum", "operator", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L1701-L1729
[ "def", "convert_sum", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "mx_axis", "=", "attrs", ".", "get", "(", "\"axis\"", ",", "None", ")", "axes", "=", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_hardsigmoid
Map MXNet's hard_sigmoid operator attributes to onnx's HardSigmoid operator and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_hardsigmoid(node, **kwargs): """Map MXNet's hard_sigmoid operator attributes to onnx's HardSigmoid operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) # Converting to float32 alpha = float(attrs.get("alpha", 0.2)) beta = float(attrs.get(...
def convert_hardsigmoid(node, **kwargs): """Map MXNet's hard_sigmoid operator attributes to onnx's HardSigmoid operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) # Converting to float32 alpha = float(attrs.get("alpha", 0.2)) beta = float(attrs.get(...
[ "Map", "MXNet", "s", "hard_sigmoid", "operator", "attributes", "to", "onnx", "s", "HardSigmoid", "operator", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L1741-L1759
[ "def", "convert_hardsigmoid", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "# Converting to float32", "alpha", "=", "float", "(", "attrs", ".", "get", "(", "...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_logsoftmax
Map MXNet's log_softmax operator attributes to onnx's LogSoftMax operator and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_logsoftmax(node, **kwargs): """Map MXNet's log_softmax operator attributes to onnx's LogSoftMax operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) # Converting to int axis = int(attrs.get("axis", -1)) temp = attrs.get("temperature", 'No...
def convert_logsoftmax(node, **kwargs): """Map MXNet's log_softmax operator attributes to onnx's LogSoftMax operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) # Converting to int axis = int(attrs.get("axis", -1)) temp = attrs.get("temperature", 'No...
[ "Map", "MXNet", "s", "log_softmax", "operator", "attributes", "to", "onnx", "s", "LogSoftMax", "operator", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L1824-L1843
[ "def", "convert_logsoftmax", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "# Converting to int", "axis", "=", "int", "(", "attrs", ".", "get", "(", "\"axis\"...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_norm
Map MXNet's norm operator attributes to onnx's ReduceL1 and ReduceL2 operators and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_norm(node, **kwargs): """Map MXNet's norm operator attributes to onnx's ReduceL1 and ReduceL2 operators and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) mx_axis = attrs.get("axis", None) axes = convert_string_to_list(str(mx_axis)) if mx_axis else ...
def convert_norm(node, **kwargs): """Map MXNet's norm operator attributes to onnx's ReduceL1 and ReduceL2 operators and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) mx_axis = attrs.get("axis", None) axes = convert_string_to_list(str(mx_axis)) if mx_axis else ...
[ "Map", "MXNet", "s", "norm", "operator", "attributes", "to", "onnx", "s", "ReduceL1", "and", "ReduceL2", "operators", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L1846-L1878
[ "def", "convert_norm", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "mx_axis", "=", "attrs", ".", "get", "(", "\"axis\"", ",", "None", ")", "axes", "=", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_multinomial
Map MXNet's multinomial operator attributes to onnx's Multinomial operator and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_multinomial(node, **kwargs): """Map MXNet's multinomial operator attributes to onnx's Multinomial operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) dtype = onnx.mapping.NP_TYPE_TO_TENSOR_TYPE[np.dtype(attrs.get("dtype", 'int32'))] sample_si...
def convert_multinomial(node, **kwargs): """Map MXNet's multinomial operator attributes to onnx's Multinomial operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) dtype = onnx.mapping.NP_TYPE_TO_TENSOR_TYPE[np.dtype(attrs.get("dtype", 'int32'))] sample_si...
[ "Map", "MXNet", "s", "multinomial", "operator", "attributes", "to", "onnx", "s", "Multinomial", "operator", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L1881-L1900
[ "def", "convert_multinomial", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "dtype", "=", "onnx", ".", "mapping", ".", "NP_TYPE_TO_TENSOR_TYPE", "[", "np", "....
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_random_uniform
Map MXNet's random_uniform operator attributes to onnx's RandomUniform operator and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_random_uniform(node, **kwargs): """Map MXNet's random_uniform operator attributes to onnx's RandomUniform operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) # Converting to float32 low = float(attrs.get("low", 0)) high = float(attrs.get...
def convert_random_uniform(node, **kwargs): """Map MXNet's random_uniform operator attributes to onnx's RandomUniform operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) # Converting to float32 low = float(attrs.get("low", 0)) high = float(attrs.get...
[ "Map", "MXNet", "s", "random_uniform", "operator", "attributes", "to", "onnx", "s", "RandomUniform", "operator", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L1904-L1926
[ "def", "convert_random_uniform", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "# Converting to float32", "low", "=", "float", "(", "attrs", ".", "get", "(", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_random_normal
Map MXNet's random_normal operator attributes to onnx's RandomNormal operator and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_random_normal(node, **kwargs): """Map MXNet's random_normal operator attributes to onnx's RandomNormal operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) # Converting to float32 mean = float(attrs.get("loc", 0)) scale = float(attrs.get(...
def convert_random_normal(node, **kwargs): """Map MXNet's random_normal operator attributes to onnx's RandomNormal operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) # Converting to float32 mean = float(attrs.get("loc", 0)) scale = float(attrs.get(...
[ "Map", "MXNet", "s", "random_normal", "operator", "attributes", "to", "onnx", "s", "RandomNormal", "operator", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L1930-L1952
[ "def", "convert_random_normal", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "# Converting to float32", "mean", "=", "float", "(", "attrs", ".", "get", "(", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_roipooling
Map MXNet's ROIPooling operator attributes to onnx's MaxRoiPool operator and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_roipooling(node, **kwargs): """Map MXNet's ROIPooling operator attributes to onnx's MaxRoiPool operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) pooled_shape = convert_string_to_list(attrs.get('pooled_size')) scale = float(attrs.get("spati...
def convert_roipooling(node, **kwargs): """Map MXNet's ROIPooling operator attributes to onnx's MaxRoiPool operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) pooled_shape = convert_string_to_list(attrs.get('pooled_size')) scale = float(attrs.get("spati...
[ "Map", "MXNet", "s", "ROIPooling", "operator", "attributes", "to", "onnx", "s", "MaxRoiPool", "operator", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L1956-L1973
[ "def", "convert_roipooling", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "pooled_shape", "=", "convert_string_to_list", "(", "attrs", ".", "get", "(", "'poole...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_tile
Map MXNet's Tile operator attributes to onnx's Tile operator and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_tile(node, **kwargs): """Map MXNet's Tile operator attributes to onnx's Tile operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) reps_list = convert_string_to_list(attrs["reps"]) initializer = kwargs["initializer"] reps_shape_np = np.ar...
def convert_tile(node, **kwargs): """Map MXNet's Tile operator attributes to onnx's Tile operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) reps_list = convert_string_to_list(attrs["reps"]) initializer = kwargs["initializer"] reps_shape_np = np.ar...
[ "Map", "MXNet", "s", "Tile", "operator", "attributes", "to", "onnx", "s", "Tile", "operator", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L1977-L2011
[ "def", "convert_tile", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "reps_list", "=", "convert_string_to_list", "(", "attrs", "[", "\"reps\"", "]", ")", "ini...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
convert_broadcast_to
Map MXNet's broadcast_to operator attributes to onnx's Expand operator and return the created node.
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
def convert_broadcast_to(node, **kwargs): """Map MXNet's broadcast_to operator attributes to onnx's Expand operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) shape_list = convert_string_to_list(attrs["shape"]) initializer = kwargs["initializer"] o...
def convert_broadcast_to(node, **kwargs): """Map MXNet's broadcast_to operator attributes to onnx's Expand operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) shape_list = convert_string_to_list(attrs["shape"]) initializer = kwargs["initializer"] o...
[ "Map", "MXNet", "s", "broadcast_to", "operator", "attributes", "to", "onnx", "s", "Expand", "operator", "and", "return", "the", "created", "node", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L2015-L2049
[ "def", "convert_broadcast_to", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "shape_list", "=", "convert_string_to_list", "(", "attrs", "[", "\"shape\"", "]", "...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
Base.exe
Get the current executor Returns ------- exe : mxnet.executor.Executor
example/reinforcement-learning/dqn/base.py
def exe(self): """Get the current executor Returns ------- exe : mxnet.executor.Executor """ return self._buckets[self.curr_bucket_key]['exe'][tuple(self.data_shapes.items())]
def exe(self): """Get the current executor Returns ------- exe : mxnet.executor.Executor """ return self._buckets[self.curr_bucket_key]['exe'][tuple(self.data_shapes.items())]
[ "Get", "the", "current", "executor" ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/reinforcement-learning/dqn/base.py#L80-L87
[ "def", "exe", "(", "self", ")", ":", "return", "self", ".", "_buckets", "[", "self", ".", "curr_bucket_key", "]", "[", "'exe'", "]", "[", "tuple", "(", "self", ".", "data_shapes", ".", "items", "(", ")", ")", "]" ]
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
Base.compute_internal
View the internal symbols using the forward function. :param sym_name: :param bucket_kwargs: :param input_dict: :return:
example/reinforcement-learning/dqn/base.py
def compute_internal(self, sym_name, bucket_kwargs=None, **arg_dict): """ View the internal symbols using the forward function. :param sym_name: :param bucket_kwargs: :param input_dict: :return: """ data_shapes = {k: v.shape for k, v in arg_dict.items()} ...
def compute_internal(self, sym_name, bucket_kwargs=None, **arg_dict): """ View the internal symbols using the forward function. :param sym_name: :param bucket_kwargs: :param input_dict: :return: """ data_shapes = {k: v.shape for k, v in arg_dict.items()} ...
[ "View", "the", "internal", "symbols", "using", "the", "forward", "function", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/reinforcement-learning/dqn/base.py#L190-L222
[ "def", "compute_internal", "(", "self", ",", "sym_name", ",", "bucket_kwargs", "=", "None", ",", "*", "*", "arg_dict", ")", ":", "data_shapes", "=", "{", "k", ":", "v", ".", "shape", "for", "k", ",", "v", "in", "arg_dict", ".", "items", "(", ")", "...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
init_from_fcnxs
use zero initialization for better convergence, because it tends to oputut 0, and the label 0 stands for background, which may occupy most size of one image.
example/fcn-xs/init_fcnxs.py
def init_from_fcnxs(ctx, fcnxs_symbol, fcnxs_args_from, fcnxs_auxs_from): """ use zero initialization for better convergence, because it tends to oputut 0, and the label 0 stands for background, which may occupy most size of one image. """ fcnxs_args = fcnxs_args_from.copy() fcnxs_auxs = fcnxs_auxs_...
def init_from_fcnxs(ctx, fcnxs_symbol, fcnxs_args_from, fcnxs_auxs_from): """ use zero initialization for better convergence, because it tends to oputut 0, and the label 0 stands for background, which may occupy most size of one image. """ fcnxs_args = fcnxs_args_from.copy() fcnxs_auxs = fcnxs_auxs_...
[ "use", "zero", "initialization", "for", "better", "convergence", "because", "it", "tends", "to", "oputut", "0", "and", "the", "label", "0", "stands", "for", "background", "which", "may", "occupy", "most", "size", "of", "one", "image", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/fcn-xs/init_fcnxs.py#L65-L106
[ "def", "init_from_fcnxs", "(", "ctx", ",", "fcnxs_symbol", ",", "fcnxs_args_from", ",", "fcnxs_auxs_from", ")", ":", "fcnxs_args", "=", "fcnxs_args_from", ".", "copy", "(", ")", "fcnxs_auxs", "=", "fcnxs_auxs_from", ".", "copy", "(", ")", "for", "k", ",", "v...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
residual_unit
Return ResNet Unit symbol for building ResNet Parameters ---------- data : str Input data num_filter : int Number of output channels bnf : int Bottle neck channels factor with regard to num_filter stride : tuple Stride used in convolution dim_match : Boolean ...
example/image-classification/symbols/resnext.py
def residual_unit(data, num_filter, stride, dim_match, name, bottle_neck=True, num_group=32, bn_mom=0.9, workspace=256, memonger=False): """Return ResNet Unit symbol for building ResNet Parameters ---------- data : str Input data num_filter : int Number of output channels bnf : i...
def residual_unit(data, num_filter, stride, dim_match, name, bottle_neck=True, num_group=32, bn_mom=0.9, workspace=256, memonger=False): """Return ResNet Unit symbol for building ResNet Parameters ---------- data : str Input data num_filter : int Number of output channels bnf : i...
[ "Return", "ResNet", "Unit", "symbol", "for", "building", "ResNet", "Parameters", "----------", "data", ":", "str", "Input", "data", "num_filter", ":", "int", "Number", "of", "output", "channels", "bnf", ":", "int", "Bottle", "neck", "channels", "factor", "with...
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/image-classification/symbols/resnext.py#L28-L99
[ "def", "residual_unit", "(", "data", ",", "num_filter", ",", "stride", ",", "dim_match", ",", "name", ",", "bottle_neck", "=", "True", ",", "num_group", "=", "32", ",", "bn_mom", "=", "0.9", ",", "workspace", "=", "256", ",", "memonger", "=", "False", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
resnext
Return ResNeXt symbol of Parameters ---------- units : list Number of units in each stage num_stages : int Number of stage filter_list : list Channel size of each stage num_classes : int Ouput size of symbol num_groupes: int Number of conv groups datas...
example/image-classification/symbols/resnext.py
def resnext(units, num_stages, filter_list, num_classes, num_group, image_shape, bottle_neck=True, bn_mom=0.9, workspace=256, dtype='float32', memonger=False): """Return ResNeXt symbol of Parameters ---------- units : list Number of units in each stage num_stages : int Number of stag...
def resnext(units, num_stages, filter_list, num_classes, num_group, image_shape, bottle_neck=True, bn_mom=0.9, workspace=256, dtype='float32', memonger=False): """Return ResNeXt symbol of Parameters ---------- units : list Number of units in each stage num_stages : int Number of stag...
[ "Return", "ResNeXt", "symbol", "of", "Parameters", "----------", "units", ":", "list", "Number", "of", "units", "in", "each", "stage", "num_stages", ":", "int", "Number", "of", "stage", "filter_list", ":", "list", "Channel", "size", "of", "each", "stage", "n...
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/image-classification/symbols/resnext.py#L101-L155
[ "def", "resnext", "(", "units", ",", "num_stages", ",", "filter_list", ",", "num_classes", ",", "num_group", ",", "image_shape", ",", "bottle_neck", "=", "True", ",", "bn_mom", "=", "0.9", ",", "workspace", "=", "256", ",", "dtype", "=", "'float32'", ",", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
get_symbol
Adapted from https://github.com/tornadomeet/ResNet/blob/master/train_resnet.py Original author Wei Wu
example/image-classification/symbols/resnext.py
def get_symbol(num_classes, num_layers, image_shape, num_group=32, conv_workspace=256, dtype='float32', **kwargs): """ Adapted from https://github.com/tornadomeet/ResNet/blob/master/train_resnet.py Original author Wei Wu """ image_shape = [int(l) for l in image_shape.split(',')] (nchannel, heigh...
def get_symbol(num_classes, num_layers, image_shape, num_group=32, conv_workspace=256, dtype='float32', **kwargs): """ Adapted from https://github.com/tornadomeet/ResNet/blob/master/train_resnet.py Original author Wei Wu """ image_shape = [int(l) for l in image_shape.split(',')] (nchannel, heigh...
[ "Adapted", "from", "https", ":", "//", "github", ".", "com", "/", "tornadomeet", "/", "ResNet", "/", "blob", "/", "master", "/", "train_resnet", ".", "py", "Original", "author", "Wei", "Wu" ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/image-classification/symbols/resnext.py#L157-L210
[ "def", "get_symbol", "(", "num_classes", ",", "num_layers", ",", "image_shape", ",", "num_group", "=", "32", ",", "conv_workspace", "=", "256", ",", "dtype", "=", "'float32'", ",", "*", "*", "kwargs", ")", ":", "image_shape", "=", "[", "int", "(", "l", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
var
Creates a symbolic variable with specified name. Example ------- >>> data = mx.sym.Variable('data', attr={'a': 'b'}) >>> data <Symbol data> >>> csr_data = mx.sym.Variable('csr_data', stype='csr') >>> csr_data <Symbol csr_data> >>> row_sparse_weight = mx.sym.Variable('weight', stype=...
python/mxnet/symbol/symbol.py
def var(name, attr=None, shape=None, lr_mult=None, wd_mult=None, dtype=None, init=None, stype=None, **kwargs): """Creates a symbolic variable with specified name. Example ------- >>> data = mx.sym.Variable('data', attr={'a': 'b'}) >>> data <Symbol data> >>> csr_data = mx.sym.Variabl...
def var(name, attr=None, shape=None, lr_mult=None, wd_mult=None, dtype=None, init=None, stype=None, **kwargs): """Creates a symbolic variable with specified name. Example ------- >>> data = mx.sym.Variable('data', attr={'a': 'b'}) >>> data <Symbol data> >>> csr_data = mx.sym.Variabl...
[ "Creates", "a", "symbolic", "variable", "with", "specified", "name", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L2574-L2649
[ "def", "var", "(", "name", ",", "attr", "=", "None", ",", "shape", "=", "None", ",", "lr_mult", "=", "None", ",", "wd_mult", "=", "None", ",", "dtype", "=", "None", ",", "init", "=", "None", ",", "stype", "=", "None", ",", "*", "*", "kwargs", "...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
Group
Creates a symbol that contains a collection of other symbols, grouped together. Example ------- >>> a = mx.sym.Variable('a') >>> b = mx.sym.Variable('b') >>> mx.sym.Group([a,b]) <Symbol Grouped> Parameters ---------- symbols : list List of symbols to be grouped. Return...
python/mxnet/symbol/symbol.py
def Group(symbols): """Creates a symbol that contains a collection of other symbols, grouped together. Example ------- >>> a = mx.sym.Variable('a') >>> b = mx.sym.Variable('b') >>> mx.sym.Group([a,b]) <Symbol Grouped> Parameters ---------- symbols : list List of symbols...
def Group(symbols): """Creates a symbol that contains a collection of other symbols, grouped together. Example ------- >>> a = mx.sym.Variable('a') >>> b = mx.sym.Variable('b') >>> mx.sym.Group([a,b]) <Symbol Grouped> Parameters ---------- symbols : list List of symbols...
[ "Creates", "a", "symbol", "that", "contains", "a", "collection", "of", "other", "symbols", "grouped", "together", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L2656-L2682
[ "def", "Group", "(", "symbols", ")", ":", "if", "not", "symbols", "or", "any", "(", "not", "isinstance", "(", "sym", ",", "Symbol", ")", "for", "sym", "in", "symbols", ")", ":", "raise", "TypeError", "(", "'Expected a list of symbols as input'", ")", "hand...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
load
Loads symbol from a JSON file. You can also use pickle to do the job if you only work on python. The advantage of load/save is the file is language agnostic. This means the file saved using save can be loaded by other language binding of mxnet. You also get the benefit being able to directly load/save ...
python/mxnet/symbol/symbol.py
def load(fname): """Loads symbol from a JSON file. You can also use pickle to do the job if you only work on python. The advantage of load/save is the file is language agnostic. This means the file saved using save can be loaded by other language binding of mxnet. You also get the benefit being abl...
def load(fname): """Loads symbol from a JSON file. You can also use pickle to do the job if you only work on python. The advantage of load/save is the file is language agnostic. This means the file saved using save can be loaded by other language binding of mxnet. You also get the benefit being abl...
[ "Loads", "symbol", "from", "a", "JSON", "file", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L2685-L2715
[ "def", "load", "(", "fname", ")", ":", "if", "not", "isinstance", "(", "fname", ",", "string_types", ")", ":", "raise", "TypeError", "(", "'fname need to be string'", ")", "handle", "=", "SymbolHandle", "(", ")", "check_call", "(", "_LIB", ".", "MXSymbolCrea...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
load_json
Loads symbol from json string. Parameters ---------- json_str : str A JSON string. Returns ------- sym : Symbol The loaded symbol. See Also -------- Symbol.tojson : Used to save symbol into json string.
python/mxnet/symbol/symbol.py
def load_json(json_str): """Loads symbol from json string. Parameters ---------- json_str : str A JSON string. Returns ------- sym : Symbol The loaded symbol. See Also -------- Symbol.tojson : Used to save symbol into json string. """ if not isinstance(...
def load_json(json_str): """Loads symbol from json string. Parameters ---------- json_str : str A JSON string. Returns ------- sym : Symbol The loaded symbol. See Also -------- Symbol.tojson : Used to save symbol into json string. """ if not isinstance(...
[ "Loads", "symbol", "from", "json", "string", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L2718-L2739
[ "def", "load_json", "(", "json_str", ")", ":", "if", "not", "isinstance", "(", "json_str", ",", "string_types", ")", ":", "raise", "TypeError", "(", "'fname required to be string'", ")", "handle", "=", "SymbolHandle", "(", ")", "check_call", "(", "_LIB", ".", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
pow
Returns element-wise result of base element raised to powers from exp element. Both inputs can be Symbol or scalar number. Broadcasting is not supported. Use `broadcast_pow` instead. `sym.pow` is being deprecated, please use `sym.power` instead. Parameters --------- base : Symbol or scalar ...
python/mxnet/symbol/symbol.py
def pow(base, exp): """Returns element-wise result of base element raised to powers from exp element. Both inputs can be Symbol or scalar number. Broadcasting is not supported. Use `broadcast_pow` instead. `sym.pow` is being deprecated, please use `sym.power` instead. Parameters --------- ...
def pow(base, exp): """Returns element-wise result of base element raised to powers from exp element. Both inputs can be Symbol or scalar number. Broadcasting is not supported. Use `broadcast_pow` instead. `sym.pow` is being deprecated, please use `sym.power` instead. Parameters --------- ...
[ "Returns", "element", "-", "wise", "result", "of", "base", "element", "raised", "to", "powers", "from", "exp", "element", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L2744-L2789
[ "def", "pow", "(", "base", ",", "exp", ")", ":", "if", "isinstance", "(", "base", ",", "Symbol", ")", "and", "isinstance", "(", "exp", ",", "Symbol", ")", ":", "return", "_internal", ".", "_Power", "(", "base", ",", "exp", ")", "if", "isinstance", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
maximum
Returns element-wise maximum of the input elements. Both inputs can be Symbol or scalar number. Broadcasting is not supported. Parameters --------- left : Symbol or scalar First symbol to be compared. right : Symbol or scalar Second symbol to be compared. Returns ------- ...
python/mxnet/symbol/symbol.py
def maximum(left, right): """Returns element-wise maximum of the input elements. Both inputs can be Symbol or scalar number. Broadcasting is not supported. Parameters --------- left : Symbol or scalar First symbol to be compared. right : Symbol or scalar Second symbol to be com...
def maximum(left, right): """Returns element-wise maximum of the input elements. Both inputs can be Symbol or scalar number. Broadcasting is not supported. Parameters --------- left : Symbol or scalar First symbol to be compared. right : Symbol or scalar Second symbol to be com...
[ "Returns", "element", "-", "wise", "maximum", "of", "the", "input", "elements", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L2831-L2870
[ "def", "maximum", "(", "left", ",", "right", ")", ":", "if", "isinstance", "(", "left", ",", "Symbol", ")", "and", "isinstance", "(", "right", ",", "Symbol", ")", ":", "return", "_internal", ".", "_Maximum", "(", "left", ",", "right", ")", "if", "isi...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
minimum
Returns element-wise minimum of the input elements. Both inputs can be Symbol or scalar number. Broadcasting is not supported. Parameters --------- left : Symbol or scalar First symbol to be compared. right : Symbol or scalar Second symbol to be compared. Returns ------- ...
python/mxnet/symbol/symbol.py
def minimum(left, right): """Returns element-wise minimum of the input elements. Both inputs can be Symbol or scalar number. Broadcasting is not supported. Parameters --------- left : Symbol or scalar First symbol to be compared. right : Symbol or scalar Second symbol to be com...
def minimum(left, right): """Returns element-wise minimum of the input elements. Both inputs can be Symbol or scalar number. Broadcasting is not supported. Parameters --------- left : Symbol or scalar First symbol to be compared. right : Symbol or scalar Second symbol to be com...
[ "Returns", "element", "-", "wise", "minimum", "of", "the", "input", "elements", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L2875-L2914
[ "def", "minimum", "(", "left", ",", "right", ")", ":", "if", "isinstance", "(", "left", ",", "Symbol", ")", "and", "isinstance", "(", "right", ",", "Symbol", ")", ":", "return", "_internal", ".", "_Minimum", "(", "left", ",", "right", ")", "if", "isi...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
hypot
Given the "legs" of a right triangle, returns its hypotenuse. Equivalent to :math:`\\sqrt(left^2 + right^2)`, element-wise. Both inputs can be Symbol or scalar number. Broadcasting is not supported. Parameters --------- left : Symbol or scalar First leg of the triangle(s). right : Symb...
python/mxnet/symbol/symbol.py
def hypot(left, right): """Given the "legs" of a right triangle, returns its hypotenuse. Equivalent to :math:`\\sqrt(left^2 + right^2)`, element-wise. Both inputs can be Symbol or scalar number. Broadcasting is not supported. Parameters --------- left : Symbol or scalar First leg of th...
def hypot(left, right): """Given the "legs" of a right triangle, returns its hypotenuse. Equivalent to :math:`\\sqrt(left^2 + right^2)`, element-wise. Both inputs can be Symbol or scalar number. Broadcasting is not supported. Parameters --------- left : Symbol or scalar First leg of th...
[ "Given", "the", "legs", "of", "a", "right", "triangle", "returns", "its", "hypotenuse", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L2919-L2959
[ "def", "hypot", "(", "left", ",", "right", ")", ":", "if", "isinstance", "(", "left", ",", "Symbol", ")", "and", "isinstance", "(", "right", ",", "Symbol", ")", ":", "return", "_internal", ".", "_Hypot", "(", "left", ",", "right", ")", "if", "isinsta...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
eye
Returns a new symbol of 2-D shpae, filled with ones on the diagonal and zeros elsewhere. Parameters ---------- N: int Number of rows in the output. M: int, optional Number of columns in the output. If 0, defaults to N. k: int, optional Index of the diagonal: 0 (the default) ...
python/mxnet/symbol/symbol.py
def eye(N, M=0, k=0, dtype=None, **kwargs): """Returns a new symbol of 2-D shpae, filled with ones on the diagonal and zeros elsewhere. Parameters ---------- N: int Number of rows in the output. M: int, optional Number of columns in the output. If 0, defaults to N. k: int, optio...
def eye(N, M=0, k=0, dtype=None, **kwargs): """Returns a new symbol of 2-D shpae, filled with ones on the diagonal and zeros elsewhere. Parameters ---------- N: int Number of rows in the output. M: int, optional Number of columns in the output. If 0, defaults to N. k: int, optio...
[ "Returns", "a", "new", "symbol", "of", "2", "-", "D", "shpae", "filled", "with", "ones", "on", "the", "diagonal", "and", "zeros", "elsewhere", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L2962-L2985
[ "def", "eye", "(", "N", ",", "M", "=", "0", ",", "k", "=", "0", ",", "dtype", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "dtype", "is", "None", ":", "dtype", "=", "_numpy", ".", "float32", "return", "_internal", ".", "_eye", "(", "...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
zeros
Returns a new symbol of given shape and type, filled with zeros. Parameters ---------- shape : int or sequence of ints Shape of the new array. dtype : str or numpy.dtype, optional The value type of the inner value, default to ``np.float32``. Returns ------- out : Symbol ...
python/mxnet/symbol/symbol.py
def zeros(shape, dtype=None, **kwargs): """Returns a new symbol of given shape and type, filled with zeros. Parameters ---------- shape : int or sequence of ints Shape of the new array. dtype : str or numpy.dtype, optional The value type of the inner value, default to ``np.float32`...
def zeros(shape, dtype=None, **kwargs): """Returns a new symbol of given shape and type, filled with zeros. Parameters ---------- shape : int or sequence of ints Shape of the new array. dtype : str or numpy.dtype, optional The value type of the inner value, default to ``np.float32`...
[ "Returns", "a", "new", "symbol", "of", "given", "shape", "and", "type", "filled", "with", "zeros", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L2987-L3004
[ "def", "zeros", "(", "shape", ",", "dtype", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "dtype", "is", "None", ":", "dtype", "=", "_numpy", ".", "float32", "return", "_internal", ".", "_zeros", "(", "shape", "=", "shape", ",", "dtype", "=...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
ones
Returns a new symbol of given shape and type, filled with ones. Parameters ---------- shape : int or sequence of ints Shape of the new array. dtype : str or numpy.dtype, optional The value type of the inner value, default to ``np.float32``. Returns ------- out : Symbol ...
python/mxnet/symbol/symbol.py
def ones(shape, dtype=None, **kwargs): """Returns a new symbol of given shape and type, filled with ones. Parameters ---------- shape : int or sequence of ints Shape of the new array. dtype : str or numpy.dtype, optional The value type of the inner value, default to ``np.float32``....
def ones(shape, dtype=None, **kwargs): """Returns a new symbol of given shape and type, filled with ones. Parameters ---------- shape : int or sequence of ints Shape of the new array. dtype : str or numpy.dtype, optional The value type of the inner value, default to ``np.float32``....
[ "Returns", "a", "new", "symbol", "of", "given", "shape", "and", "type", "filled", "with", "ones", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L3007-L3024
[ "def", "ones", "(", "shape", ",", "dtype", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "dtype", "is", "None", ":", "dtype", "=", "_numpy", ".", "float32", "return", "_internal", ".", "_ones", "(", "shape", "=", "shape", ",", "dtype", "=",...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
full
Returns a new array of given shape and type, filled with the given value `val`. Parameters ---------- shape : int or sequence of ints Shape of the new array. val : scalar Fill value. dtype : str or numpy.dtype, optional The value type of the inner value, default to ``np.flo...
python/mxnet/symbol/symbol.py
def full(shape, val, dtype=None, **kwargs): """Returns a new array of given shape and type, filled with the given value `val`. Parameters ---------- shape : int or sequence of ints Shape of the new array. val : scalar Fill value. dtype : str or numpy.dtype, optional The...
def full(shape, val, dtype=None, **kwargs): """Returns a new array of given shape and type, filled with the given value `val`. Parameters ---------- shape : int or sequence of ints Shape of the new array. val : scalar Fill value. dtype : str or numpy.dtype, optional The...
[ "Returns", "a", "new", "array", "of", "given", "shape", "and", "type", "filled", "with", "the", "given", "value", "val", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L3027-L3046
[ "def", "full", "(", "shape", ",", "val", ",", "dtype", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "dtype", "is", "None", ":", "dtype", "=", "_numpy", ".", "float32", "return", "_internal", ".", "_full", "(", "shape", "=", "shape", ",", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
arange
Returns evenly spaced values within a given interval. Values are generated within the half-open interval [`start`, `stop`). In other words, the interval includes `start` but excludes `stop`. The function is similar to the built-in Python function `range` and to `numpy.arange`, but returns a `Symbol`. ...
python/mxnet/symbol/symbol.py
def arange(start, stop=None, step=1.0, repeat=1, infer_range=False, name=None, dtype=None): """Returns evenly spaced values within a given interval. Values are generated within the half-open interval [`start`, `stop`). In other words, the interval includes `start` but excludes `stop`. The function is s...
def arange(start, stop=None, step=1.0, repeat=1, infer_range=False, name=None, dtype=None): """Returns evenly spaced values within a given interval. Values are generated within the half-open interval [`start`, `stop`). In other words, the interval includes `start` but excludes `stop`. The function is s...
[ "Returns", "evenly", "spaced", "values", "within", "a", "given", "interval", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L3049-L3082
[ "def", "arange", "(", "start", ",", "stop", "=", "None", ",", "step", "=", "1.0", ",", "repeat", "=", "1", ",", "infer_range", "=", "False", ",", "name", "=", "None", ",", "dtype", "=", "None", ")", ":", "if", "dtype", "is", "None", ":", "dtype",...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
histogram
Compute the histogram of the input data. Parameters ---------- a : NDArray Input data. The histogram is computed over the flattened array. bins : int or sequence of scalars If bins is an int, it defines the number of equal-width bins in the given range (10, by default). If bins ...
python/mxnet/symbol/symbol.py
def histogram(a, bins=10, range=None, **kwargs): """Compute the histogram of the input data. Parameters ---------- a : NDArray Input data. The histogram is computed over the flattened array. bins : int or sequence of scalars If bins is an int, it defines the number of equal-width bi...
def histogram(a, bins=10, range=None, **kwargs): """Compute the histogram of the input data. Parameters ---------- a : NDArray Input data. The histogram is computed over the flattened array. bins : int or sequence of scalars If bins is an int, it defines the number of equal-width bi...
[ "Compute", "the", "histogram", "of", "the", "input", "data", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L3084-L3112
[ "def", "histogram", "(", "a", ",", "bins", "=", "10", ",", "range", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "isinstance", "(", "bins", ",", "Symbol", ")", ":", "return", "_internal", ".", "_histogram", "(", "data", "=", "a", ",", "b...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
split_v2
Split an array into multiple sub-arrays. Parameters ---------- ary : NDArray Array to be divided into sub-arrays. indices_or_sections : int or tuple of ints If `indices_or_sections` is an integer, N, the array will be divided into N equal arrays along `axis`. If such a split is...
python/mxnet/symbol/symbol.py
def split_v2(ary, indices_or_sections, axis=0, squeeze_axis=False): """Split an array into multiple sub-arrays. Parameters ---------- ary : NDArray Array to be divided into sub-arrays. indices_or_sections : int or tuple of ints If `indices_or_sections` is an integer, N, the array wi...
def split_v2(ary, indices_or_sections, axis=0, squeeze_axis=False): """Split an array into multiple sub-arrays. Parameters ---------- ary : NDArray Array to be divided into sub-arrays. indices_or_sections : int or tuple of ints If `indices_or_sections` is an integer, N, the array wi...
[ "Split", "an", "array", "into", "multiple", "sub", "-", "arrays", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L3114-L3152
[ "def", "split_v2", "(", "ary", ",", "indices_or_sections", ",", "axis", "=", "0", ",", "squeeze_axis", "=", "False", ")", ":", "indices", "=", "[", "]", "sections", "=", "0", "if", "isinstance", "(", "indices_or_sections", ",", "int", ")", ":", "sections...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
Symbol.name
Gets name string from the symbol, this function only works for non-grouped symbol. Returns ------- value : str The name of this symbol, returns ``None`` for grouped symbol.
python/mxnet/symbol/symbol.py
def name(self): """Gets name string from the symbol, this function only works for non-grouped symbol. Returns ------- value : str The name of this symbol, returns ``None`` for grouped symbol. """ ret = ctypes.c_char_p() success = ctypes.c_int() ...
def name(self): """Gets name string from the symbol, this function only works for non-grouped symbol. Returns ------- value : str The name of this symbol, returns ``None`` for grouped symbol. """ ret = ctypes.c_char_p() success = ctypes.c_int() ...
[ "Gets", "name", "string", "from", "the", "symbol", "this", "function", "only", "works", "for", "non", "-", "grouped", "symbol", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L534-L549
[ "def", "name", "(", "self", ")", ":", "ret", "=", "ctypes", ".", "c_char_p", "(", ")", "success", "=", "ctypes", ".", "c_int", "(", ")", "check_call", "(", "_LIB", ".", "MXSymbolGetName", "(", "self", ".", "handle", ",", "ctypes", ".", "byref", "(", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
Symbol.attr
Returns the attribute string for corresponding input key from the symbol. This function only works for non-grouped symbols. Example ------- >>> data = mx.sym.Variable('data', attr={'mood': 'angry'}) >>> data.attr('mood') 'angry' Parameters ---------- ...
python/mxnet/symbol/symbol.py
def attr(self, key): """Returns the attribute string for corresponding input key from the symbol. This function only works for non-grouped symbols. Example ------- >>> data = mx.sym.Variable('data', attr={'mood': 'angry'}) >>> data.attr('mood') 'angry' ...
def attr(self, key): """Returns the attribute string for corresponding input key from the symbol. This function only works for non-grouped symbols. Example ------- >>> data = mx.sym.Variable('data', attr={'mood': 'angry'}) >>> data.attr('mood') 'angry' ...
[ "Returns", "the", "attribute", "string", "for", "corresponding", "input", "key", "from", "the", "symbol", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L551-L579
[ "def", "attr", "(", "self", ",", "key", ")", ":", "ret", "=", "ctypes", ".", "c_char_p", "(", ")", "success", "=", "ctypes", ".", "c_int", "(", ")", "check_call", "(", "_LIB", ".", "MXSymbolGetAttr", "(", "self", ".", "handle", ",", "c_str", "(", "...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
Symbol.list_attr
Gets all attributes from the symbol. Example ------- >>> data = mx.sym.Variable('data', attr={'mood': 'angry'}) >>> data.list_attr() {'mood': 'angry'} Returns ------- ret : Dict of str to str A dictionary mapping attribute keys to values.
python/mxnet/symbol/symbol.py
def list_attr(self, recursive=False): """Gets all attributes from the symbol. Example ------- >>> data = mx.sym.Variable('data', attr={'mood': 'angry'}) >>> data.list_attr() {'mood': 'angry'} Returns ------- ret : Dict of str to str A...
def list_attr(self, recursive=False): """Gets all attributes from the symbol. Example ------- >>> data = mx.sym.Variable('data', attr={'mood': 'angry'}) >>> data.list_attr() {'mood': 'angry'} Returns ------- ret : Dict of str to str A...
[ "Gets", "all", "attributes", "from", "the", "symbol", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L581-L602
[ "def", "list_attr", "(", "self", ",", "recursive", "=", "False", ")", ":", "if", "recursive", ":", "raise", "DeprecationWarning", "(", "\"Symbol.list_attr with recursive=True has been deprecated. \"", "\"Please use attr_dict instead.\"", ")", "size", "=", "mx_uint", "(", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
Symbol.attr_dict
Recursively gets all attributes from the symbol and its children. Example ------- >>> a = mx.sym.Variable('a', attr={'a1':'a2'}) >>> b = mx.sym.Variable('b', attr={'b1':'b2'}) >>> c = a+b >>> c.attr_dict() {'a': {'a1': 'a2'}, 'b': {'b1': 'b2'}} Returns ...
python/mxnet/symbol/symbol.py
def attr_dict(self): """Recursively gets all attributes from the symbol and its children. Example ------- >>> a = mx.sym.Variable('a', attr={'a1':'a2'}) >>> b = mx.sym.Variable('b', attr={'b1':'b2'}) >>> c = a+b >>> c.attr_dict() {'a': {'a1': 'a2'}, 'b': ...
def attr_dict(self): """Recursively gets all attributes from the symbol and its children. Example ------- >>> a = mx.sym.Variable('a', attr={'a1':'a2'}) >>> b = mx.sym.Variable('b', attr={'b1':'b2'}) >>> c = a+b >>> c.attr_dict() {'a': {'a1': 'a2'}, 'b': ...
[ "Recursively", "gets", "all", "attributes", "from", "the", "symbol", "and", "its", "children", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L604-L633
[ "def", "attr_dict", "(", "self", ")", ":", "size", "=", "mx_uint", "(", ")", "pairs", "=", "ctypes", ".", "POINTER", "(", "ctypes", ".", "c_char_p", ")", "(", ")", "f_handle", "=", "_LIB", ".", "MXSymbolListAttr", "check_call", "(", "f_handle", "(", "s...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
Symbol._set_attr
Sets an attribute of the symbol. For example. A._set_attr(foo="bar") adds the mapping ``"{foo: bar}"`` to the symbol's attribute dictionary. Parameters ---------- **kwargs The attributes to set
python/mxnet/symbol/symbol.py
def _set_attr(self, **kwargs): """Sets an attribute of the symbol. For example. A._set_attr(foo="bar") adds the mapping ``"{foo: bar}"`` to the symbol's attribute dictionary. Parameters ---------- **kwargs The attributes to set """ for key, v...
def _set_attr(self, **kwargs): """Sets an attribute of the symbol. For example. A._set_attr(foo="bar") adds the mapping ``"{foo: bar}"`` to the symbol's attribute dictionary. Parameters ---------- **kwargs The attributes to set """ for key, v...
[ "Sets", "an", "attribute", "of", "the", "symbol", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L635-L650
[ "def", "_set_attr", "(", "self", ",", "*", "*", "kwargs", ")", ":", "for", "key", ",", "value", "in", "kwargs", ".", "items", "(", ")", ":", "if", "not", "isinstance", "(", "value", ",", "string_types", ")", ":", "raise", "ValueError", "(", "\"Set At...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
Symbol.get_internals
Gets a new grouped symbol `sgroup`. The output of `sgroup` is a list of outputs of all of the internal nodes. Consider the following code: Example ------- >>> a = mx.sym.var('a') >>> b = mx.sym.var('b') >>> c = a + b >>> d = c.get_internals() >>>...
python/mxnet/symbol/symbol.py
def get_internals(self): """Gets a new grouped symbol `sgroup`. The output of `sgroup` is a list of outputs of all of the internal nodes. Consider the following code: Example ------- >>> a = mx.sym.var('a') >>> b = mx.sym.var('b') >>> c = a + b >...
def get_internals(self): """Gets a new grouped symbol `sgroup`. The output of `sgroup` is a list of outputs of all of the internal nodes. Consider the following code: Example ------- >>> a = mx.sym.var('a') >>> b = mx.sym.var('b') >>> c = a + b >...
[ "Gets", "a", "new", "grouped", "symbol", "sgroup", ".", "The", "output", "of", "sgroup", "is", "a", "list", "of", "outputs", "of", "all", "of", "the", "internal", "nodes", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L652-L678
[ "def", "get_internals", "(", "self", ")", ":", "handle", "=", "SymbolHandle", "(", ")", "check_call", "(", "_LIB", ".", "MXSymbolGetInternals", "(", "self", ".", "handle", ",", "ctypes", ".", "byref", "(", "handle", ")", ")", ")", "return", "Symbol", "("...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
Symbol.get_children
Gets a new grouped symbol whose output contains inputs to output nodes of the original symbol. Example ------- >>> x = mx.sym.Variable('x') >>> y = mx.sym.Variable('y') >>> z = mx.sym.Variable('z') >>> a = y+z >>> b = x+a >>> b.get_children() ...
python/mxnet/symbol/symbol.py
def get_children(self): """Gets a new grouped symbol whose output contains inputs to output nodes of the original symbol. Example ------- >>> x = mx.sym.Variable('x') >>> y = mx.sym.Variable('y') >>> z = mx.sym.Variable('z') >>> a = y+z >>> b = x+...
def get_children(self): """Gets a new grouped symbol whose output contains inputs to output nodes of the original symbol. Example ------- >>> x = mx.sym.Variable('x') >>> y = mx.sym.Variable('y') >>> z = mx.sym.Variable('z') >>> a = y+z >>> b = x+...
[ "Gets", "a", "new", "grouped", "symbol", "whose", "output", "contains", "inputs", "to", "output", "nodes", "of", "the", "original", "symbol", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L680-L710
[ "def", "get_children", "(", "self", ")", ":", "handle", "=", "SymbolHandle", "(", ")", "check_call", "(", "_LIB", ".", "MXSymbolGetChildren", "(", "self", ".", "handle", ",", "ctypes", ".", "byref", "(", "handle", ")", ")", ")", "ret", "=", "Symbol", "...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
Symbol.list_arguments
Lists all the arguments in the symbol. Example ------- >>> a = mx.sym.var('a') >>> b = mx.sym.var('b') >>> c = a + b >>> c.list_arguments ['a', 'b'] Returns ------- args : list of string List containing the names of all the ar...
python/mxnet/symbol/symbol.py
def list_arguments(self): """Lists all the arguments in the symbol. Example ------- >>> a = mx.sym.var('a') >>> b = mx.sym.var('b') >>> c = a + b >>> c.list_arguments ['a', 'b'] Returns ------- args : list of string Li...
def list_arguments(self): """Lists all the arguments in the symbol. Example ------- >>> a = mx.sym.var('a') >>> b = mx.sym.var('b') >>> c = a + b >>> c.list_arguments ['a', 'b'] Returns ------- args : list of string Li...
[ "Lists", "all", "the", "arguments", "in", "the", "symbol", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L712-L732
[ "def", "list_arguments", "(", "self", ")", ":", "size", "=", "ctypes", ".", "c_uint", "(", ")", "sarr", "=", "ctypes", ".", "POINTER", "(", "ctypes", ".", "c_char_p", ")", "(", ")", "check_call", "(", "_LIB", ".", "MXSymbolListArguments", "(", "self", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
Symbol.list_outputs
Lists all the outputs in the symbol. Example ------- >>> a = mx.sym.var('a') >>> b = mx.sym.var('b') >>> c = a + b >>> c.list_outputs() ['_plus12_output'] Returns ------- list of str List of all the outputs. For mo...
python/mxnet/symbol/symbol.py
def list_outputs(self): """Lists all the outputs in the symbol. Example ------- >>> a = mx.sym.var('a') >>> b = mx.sym.var('b') >>> c = a + b >>> c.list_outputs() ['_plus12_output'] Returns ------- list of str List of ...
def list_outputs(self): """Lists all the outputs in the symbol. Example ------- >>> a = mx.sym.var('a') >>> b = mx.sym.var('b') >>> c = a + b >>> c.list_outputs() ['_plus12_output'] Returns ------- list of str List of ...
[ "Lists", "all", "the", "outputs", "in", "the", "symbol", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L734-L757
[ "def", "list_outputs", "(", "self", ")", ":", "size", "=", "ctypes", ".", "c_uint", "(", ")", "sarr", "=", "ctypes", ".", "POINTER", "(", "ctypes", ".", "c_char_p", ")", "(", ")", "check_call", "(", "_LIB", ".", "MXSymbolListOutputs", "(", "self", ".",...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
Symbol.list_auxiliary_states
Lists all the auxiliary states in the symbol. Example ------- >>> a = mx.sym.var('a') >>> b = mx.sym.var('b') >>> c = a + b >>> c.list_auxiliary_states() [] Example of auxiliary states in `BatchNorm`. >>> data = mx.symbol.Variable('data') ...
python/mxnet/symbol/symbol.py
def list_auxiliary_states(self): """Lists all the auxiliary states in the symbol. Example ------- >>> a = mx.sym.var('a') >>> b = mx.sym.var('b') >>> c = a + b >>> c.list_auxiliary_states() [] Example of auxiliary states in `BatchNorm`. ...
def list_auxiliary_states(self): """Lists all the auxiliary states in the symbol. Example ------- >>> a = mx.sym.var('a') >>> b = mx.sym.var('b') >>> c = a + b >>> c.list_auxiliary_states() [] Example of auxiliary states in `BatchNorm`. ...
[ "Lists", "all", "the", "auxiliary", "states", "in", "the", "symbol", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L779-L815
[ "def", "list_auxiliary_states", "(", "self", ")", ":", "size", "=", "ctypes", ".", "c_uint", "(", ")", "sarr", "=", "ctypes", ".", "POINTER", "(", "ctypes", ".", "c_char_p", ")", "(", ")", "check_call", "(", "_LIB", ".", "MXSymbolListAuxiliaryStates", "(",...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
Symbol.list_inputs
Lists all arguments and auxiliary states of this Symbol. Returns ------- inputs : list of str List of all inputs. Examples -------- >>> bn = mx.sym.BatchNorm(name='bn') >>> bn.list_arguments() ['bn_data', 'bn_gamma', 'bn_beta'] >>> bn...
python/mxnet/symbol/symbol.py
def list_inputs(self): """Lists all arguments and auxiliary states of this Symbol. Returns ------- inputs : list of str List of all inputs. Examples -------- >>> bn = mx.sym.BatchNorm(name='bn') >>> bn.list_arguments() ['bn_data', 'bn...
def list_inputs(self): """Lists all arguments and auxiliary states of this Symbol. Returns ------- inputs : list of str List of all inputs. Examples -------- >>> bn = mx.sym.BatchNorm(name='bn') >>> bn.list_arguments() ['bn_data', 'bn...
[ "Lists", "all", "arguments", "and", "auxiliary", "states", "of", "this", "Symbol", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L817-L839
[ "def", "list_inputs", "(", "self", ")", ":", "size", "=", "ctypes", ".", "c_uint", "(", ")", "sarr", "=", "ctypes", ".", "POINTER", "(", "ctypes", ".", "c_char_p", ")", "(", ")", "check_call", "(", "_LIB", ".", "NNSymbolListInputNames", "(", "self", "....
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
Symbol.infer_type
Infers the type of all arguments and all outputs, given the known types for some arguments. This function takes the known types of some arguments in either positional way or keyword argument way as input. It returns a tuple of `None` values if there is not enough information to deduce t...
python/mxnet/symbol/symbol.py
def infer_type(self, *args, **kwargs): """Infers the type of all arguments and all outputs, given the known types for some arguments. This function takes the known types of some arguments in either positional way or keyword argument way as input. It returns a tuple of `None` values ...
def infer_type(self, *args, **kwargs): """Infers the type of all arguments and all outputs, given the known types for some arguments. This function takes the known types of some arguments in either positional way or keyword argument way as input. It returns a tuple of `None` values ...
[ "Infers", "the", "type", "of", "all", "arguments", "and", "all", "outputs", "given", "the", "known", "types", "for", "some", "arguments", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L841-L908
[ "def", "infer_type", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "try", ":", "res", "=", "self", ".", "_infer_type_impl", "(", "False", ",", "*", "args", ",", "*", "*", "kwargs", ")", "if", "res", "[", "1", "]", "is", "Non...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
Symbol._infer_type_impl
The actual implementation for calling type inference API.
python/mxnet/symbol/symbol.py
def _infer_type_impl(self, partial, *args, **kwargs): """The actual implementation for calling type inference API.""" # pylint: disable=too-many-locals if len(args) != 0 and len(kwargs) != 0: raise ValueError('Can only specify known argument \ types either by posi...
def _infer_type_impl(self, partial, *args, **kwargs): """The actual implementation for calling type inference API.""" # pylint: disable=too-many-locals if len(args) != 0 and len(kwargs) != 0: raise ValueError('Can only specify known argument \ types either by posi...
[ "The", "actual", "implementation", "for", "calling", "type", "inference", "API", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L958-L1015
[ "def", "_infer_type_impl", "(", "self", ",", "partial", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=too-many-locals", "if", "len", "(", "args", ")", "!=", "0", "and", "len", "(", "kwargs", ")", "!=", "0", ":", "raise", "Valu...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
Symbol.infer_shape
Infers the shapes of all arguments and all outputs given the known shapes of some arguments. This function takes the known shapes of some arguments in either positional way or keyword argument way as input. It returns a tuple of `None` values if there is not enough information to deduce...
python/mxnet/symbol/symbol.py
def infer_shape(self, *args, **kwargs): """Infers the shapes of all arguments and all outputs given the known shapes of some arguments. This function takes the known shapes of some arguments in either positional way or keyword argument way as input. It returns a tuple of `None` values ...
def infer_shape(self, *args, **kwargs): """Infers the shapes of all arguments and all outputs given the known shapes of some arguments. This function takes the known shapes of some arguments in either positional way or keyword argument way as input. It returns a tuple of `None` values ...
[ "Infers", "the", "shapes", "of", "all", "arguments", "and", "all", "outputs", "given", "the", "known", "shapes", "of", "some", "arguments", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L1018-L1102
[ "def", "infer_shape", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "try", ":", "res", "=", "self", ".", "_infer_shape_impl", "(", "False", ",", "*", "args", ",", "*", "*", "kwargs", ")", "if", "res", "[", "1", "]", "is", "N...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
Symbol._infer_shape_impl
The actual implementation for calling shape inference API.
python/mxnet/symbol/symbol.py
def _infer_shape_impl(self, partial, *args, **kwargs): """The actual implementation for calling shape inference API.""" # pylint: disable=too-many-locals if len(args) != 0 and len(kwargs) != 0: raise ValueError('Can only specify known argument \ shapes either by p...
def _infer_shape_impl(self, partial, *args, **kwargs): """The actual implementation for calling shape inference API.""" # pylint: disable=too-many-locals if len(args) != 0 and len(kwargs) != 0: raise ValueError('Can only specify known argument \ shapes either by p...
[ "The", "actual", "implementation", "for", "calling", "shape", "inference", "API", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L1153-L1222
[ "def", "_infer_shape_impl", "(", "self", ",", "partial", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=too-many-locals", "if", "len", "(", "args", ")", "!=", "0", "and", "len", "(", "kwargs", ")", "!=", "0", ":", "raise", "Val...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
Symbol.save
Saves symbol to a file. You can also use pickle to do the job if you only work on python. The advantage of `load`/`save` functions is that the file contents are language agnostic. This means the model saved by one language binding can be loaded by a different language binding of `MXNet`...
python/mxnet/symbol/symbol.py
def save(self, fname): """Saves symbol to a file. You can also use pickle to do the job if you only work on python. The advantage of `load`/`save` functions is that the file contents are language agnostic. This means the model saved by one language binding can be loaded by a different ...
def save(self, fname): """Saves symbol to a file. You can also use pickle to do the job if you only work on python. The advantage of `load`/`save` functions is that the file contents are language agnostic. This means the model saved by one language binding can be loaded by a different ...
[ "Saves", "symbol", "to", "a", "file", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L1278-L1302
[ "def", "save", "(", "self", ",", "fname", ")", ":", "if", "not", "isinstance", "(", "fname", ",", "string_types", ")", ":", "raise", "TypeError", "(", "'fname need to be string'", ")", "check_call", "(", "_LIB", ".", "MXSymbolSaveToFile", "(", "self", ".", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
Symbol.tojson
Saves symbol to a JSON string. See Also -------- symbol.load_json : Used to load symbol from JSON string.
python/mxnet/symbol/symbol.py
def tojson(self): """Saves symbol to a JSON string. See Also -------- symbol.load_json : Used to load symbol from JSON string. """ json_str = ctypes.c_char_p() check_call(_LIB.MXSymbolSaveToJSON(self.handle, ctypes.byref(json_str))) return py_str(json_str...
def tojson(self): """Saves symbol to a JSON string. See Also -------- symbol.load_json : Used to load symbol from JSON string. """ json_str = ctypes.c_char_p() check_call(_LIB.MXSymbolSaveToJSON(self.handle, ctypes.byref(json_str))) return py_str(json_str...
[ "Saves", "symbol", "to", "a", "JSON", "string", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L1304-L1313
[ "def", "tojson", "(", "self", ")", ":", "json_str", "=", "ctypes", ".", "c_char_p", "(", ")", "check_call", "(", "_LIB", ".", "MXSymbolSaveToJSON", "(", "self", ".", "handle", ",", "ctypes", ".", "byref", "(", "json_str", ")", ")", ")", "return", "py_s...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
Symbol._get_ndarray_inputs
Helper function to get NDArray lists handles from various inputs. Parameters ---------- arg_key : str The name of argument, used for error message. args : list of NDArray or dict of str to NDArray Input arguments to the symbols. If type is list of ND...
python/mxnet/symbol/symbol.py
def _get_ndarray_inputs(arg_key, args, arg_names, allow_missing): """Helper function to get NDArray lists handles from various inputs. Parameters ---------- arg_key : str The name of argument, used for error message. args : list of NDArray or dict of str to NDArray ...
def _get_ndarray_inputs(arg_key, args, arg_names, allow_missing): """Helper function to get NDArray lists handles from various inputs. Parameters ---------- arg_key : str The name of argument, used for error message. args : list of NDArray or dict of str to NDArray ...
[ "Helper", "function", "to", "get", "NDArray", "lists", "handles", "from", "various", "inputs", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L1316-L1372
[ "def", "_get_ndarray_inputs", "(", "arg_key", ",", "args", ",", "arg_names", ",", "allow_missing", ")", ":", "# setup args", "arg_handles", "=", "[", "]", "arg_arrays", "=", "[", "]", "if", "isinstance", "(", "args", ",", "list", ")", ":", "if", "len", "...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
Symbol.simple_bind
Bind current symbol to get an executor, allocate all the arguments needed. Allows specifying data types. This function simplifies the binding procedure. You need to specify only input data shapes. Before binding the executor, the function allocates arguments and auxiliary states that we...
python/mxnet/symbol/symbol.py
def simple_bind(self, ctx, grad_req='write', type_dict=None, stype_dict=None, group2ctx=None, shared_arg_names=None, shared_exec=None, shared_buffer=None, **kwargs): """Bind current symbol to get an executor, allocate all the arguments needed. Allows specifying da...
def simple_bind(self, ctx, grad_req='write', type_dict=None, stype_dict=None, group2ctx=None, shared_arg_names=None, shared_exec=None, shared_buffer=None, **kwargs): """Bind current symbol to get an executor, allocate all the arguments needed. Allows specifying da...
[ "Bind", "current", "symbol", "to", "get", "an", "executor", "allocate", "all", "the", "arguments", "needed", ".", "Allows", "specifying", "data", "types", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L1375-L1637
[ "def", "simple_bind", "(", "self", ",", "ctx", ",", "grad_req", "=", "'write'", ",", "type_dict", "=", "None", ",", "stype_dict", "=", "None", ",", "group2ctx", "=", "None", ",", "shared_arg_names", "=", "None", ",", "shared_exec", "=", "None", ",", "sha...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
Symbol.bind
Binds the current symbol to an executor and returns it. We first declare the computation and then bind to the data to run. This function returns an executor which provides method `forward()` method for evaluation and a `outputs()` method to get all the results. Example ------- ...
python/mxnet/symbol/symbol.py
def bind(self, ctx, args, args_grad=None, grad_req='write', aux_states=None, group2ctx=None, shared_exec=None): """Binds the current symbol to an executor and returns it. We first declare the computation and then bind to the data to run. This function returns an executor which prov...
def bind(self, ctx, args, args_grad=None, grad_req='write', aux_states=None, group2ctx=None, shared_exec=None): """Binds the current symbol to an executor and returns it. We first declare the computation and then bind to the data to run. This function returns an executor which prov...
[ "Binds", "the", "current", "symbol", "to", "an", "executor", "and", "returns", "it", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L1639-L1795
[ "def", "bind", "(", "self", ",", "ctx", ",", "args", ",", "args_grad", "=", "None", ",", "grad_req", "=", "'write'", ",", "aux_states", "=", "None", ",", "group2ctx", "=", "None", ",", "shared_exec", "=", "None", ")", ":", "# pylint: disable=too-many-local...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
Symbol.gradient
Gets the autodiff of current symbol. This function can only be used if current symbol is a loss function. .. note:: This function is currently not implemented. Parameters ---------- wrt : Array of String keyword arguments of the symbol that the gradients are taken....
python/mxnet/symbol/symbol.py
def gradient(self, wrt): """Gets the autodiff of current symbol. This function can only be used if current symbol is a loss function. .. note:: This function is currently not implemented. Parameters ---------- wrt : Array of String keyword arguments of the ...
def gradient(self, wrt): """Gets the autodiff of current symbol. This function can only be used if current symbol is a loss function. .. note:: This function is currently not implemented. Parameters ---------- wrt : Array of String keyword arguments of the ...
[ "Gets", "the", "autodiff", "of", "current", "symbol", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L1797-L1820
[ "def", "gradient", "(", "self", ",", "wrt", ")", ":", "handle", "=", "SymbolHandle", "(", ")", "c_wrt", "=", "c_str_array", "(", "wrt", ")", "check_call", "(", "_LIB", ".", "MXSymbolGrad", "(", "self", ".", "handle", ",", "mx_uint", "(", "len", "(", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
Symbol.eval
Evaluates a symbol given arguments. The `eval` method combines a call to `bind` (which returns an executor) with a call to `forward` (executor method). For the common use case, where you might repeatedly evaluate with same arguments, eval is slow. In that case, you should call `...
python/mxnet/symbol/symbol.py
def eval(self, ctx=None, **kwargs): """Evaluates a symbol given arguments. The `eval` method combines a call to `bind` (which returns an executor) with a call to `forward` (executor method). For the common use case, where you might repeatedly evaluate with same arguments, eval i...
def eval(self, ctx=None, **kwargs): """Evaluates a symbol given arguments. The `eval` method combines a call to `bind` (which returns an executor) with a call to `forward` (executor method). For the common use case, where you might repeatedly evaluate with same arguments, eval i...
[ "Evaluates", "a", "symbol", "given", "arguments", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L1824-L1862
[ "def", "eval", "(", "self", ",", "ctx", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "ctx", "is", "None", ":", "ctx", "=", "current_context", "(", ")", "return", "self", ".", "bind", "(", "ctx", ",", "kwargs", ")", ".", "forward", "(", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
Symbol.get_backend_symbol
Return symbol for target backend. Parameters ---------- backend : str The backend names. Returns ------- out : Symbol The created Symbol for target backend.
python/mxnet/symbol/symbol.py
def get_backend_symbol(self, backend): """Return symbol for target backend. Parameters ---------- backend : str The backend names. Returns ------- out : Symbol The created Symbol for target backend. """ out = SymbolHandle(...
def get_backend_symbol(self, backend): """Return symbol for target backend. Parameters ---------- backend : str The backend names. Returns ------- out : Symbol The created Symbol for target backend. """ out = SymbolHandle(...
[ "Return", "symbol", "for", "target", "backend", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol/symbol.py#L2536-L2551
[ "def", "get_backend_symbol", "(", "self", ",", "backend", ")", ":", "out", "=", "SymbolHandle", "(", ")", "check_call", "(", "_LIB", ".", "MXGenBackendSubgraph", "(", "self", ".", "handle", ",", "c_str", "(", "backend", ")", ",", "ctypes", ".", "byref", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
PixelShuffle1D.hybrid_forward
Perform pixel-shuffling on the input.
python/mxnet/gluon/contrib/nn/basic_layers.py
def hybrid_forward(self, F, x): """Perform pixel-shuffling on the input.""" f = self._factor # (N, C*f, W) x = F.reshape(x, (0, -4, -1, f, 0)) # (N, C, f, W) x = F.transpose(x, (0, 1, 3, 2)) # (N, C, W, f) x = F.reshape(x, (0, 0, ...
def hybrid_forward(self, F, x): """Perform pixel-shuffling on the input.""" f = self._factor # (N, C*f, W) x = F.reshape(x, (0, -4, -1, f, 0)) # (N, C, f, W) x = F.transpose(x, (0, 1, 3, 2)) # (N, C, W, f) x = F.reshape(x, (0, 0, ...
[ "Perform", "pixel", "-", "shuffling", "on", "the", "input", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/gluon/contrib/nn/basic_layers.py#L279-L286
[ "def", "hybrid_forward", "(", "self", ",", "F", ",", "x", ")", ":", "f", "=", "self", ".", "_factor", "# (N, C*f, W)", "x", "=", "F", ".", "reshape", "(", "x", ",", "(", "0", ",", "-", "4", ",", "-", "1", ",", "f", ",", "0", ")", ")", "# (N...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
PixelShuffle2D.hybrid_forward
Perform pixel-shuffling on the input.
python/mxnet/gluon/contrib/nn/basic_layers.py
def hybrid_forward(self, F, x): """Perform pixel-shuffling on the input.""" f1, f2 = self._factors # (N, f1*f2*C, H, W) x = F.reshape(x, (0, -4, -1, f1 * f2, 0, 0)) # (N, C, f1*f2, H, W) x = F.reshape(x, (0, 0, -4, f1, f2, 0, 0)) ...
def hybrid_forward(self, F, x): """Perform pixel-shuffling on the input.""" f1, f2 = self._factors # (N, f1*f2*C, H, W) x = F.reshape(x, (0, -4, -1, f1 * f2, 0, 0)) # (N, C, f1*f2, H, W) x = F.reshape(x, (0, 0, -4, f1, f2, 0, 0)) ...
[ "Perform", "pixel", "-", "shuffling", "on", "the", "input", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/gluon/contrib/nn/basic_layers.py#L340-L348
[ "def", "hybrid_forward", "(", "self", ",", "F", ",", "x", ")", ":", "f1", ",", "f2", "=", "self", ".", "_factors", "# (N, f1*f2*C, H, W)", "x", "=", "F", ".", "reshape", "(", "x", ",", "(", "0", ",", "-", "4", ",", "-", "1", ",", "f1", "*", "...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
PixelShuffle3D.hybrid_forward
Perform pixel-shuffling on the input.
python/mxnet/gluon/contrib/nn/basic_layers.py
def hybrid_forward(self, F, x): """Perform pixel-shuffling on the input.""" # `transpose` doesn't support 8D, need other implementation f1, f2, f3 = self._factors # (N, C*f1*f2*f3, D, H, W) x = F.reshape(x, (0, -4, -1, f1 * f2...
def hybrid_forward(self, F, x): """Perform pixel-shuffling on the input.""" # `transpose` doesn't support 8D, need other implementation f1, f2, f3 = self._factors # (N, C*f1*f2*f3, D, H, W) x = F.reshape(x, (0, -4, -1, f1 * f2...
[ "Perform", "pixel", "-", "shuffling", "on", "the", "input", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/gluon/contrib/nn/basic_layers.py#L402-L416
[ "def", "hybrid_forward", "(", "self", ",", "F", ",", "x", ")", ":", "# `transpose` doesn't support 8D, need other implementation", "f1", ",", "f2", ",", "f3", "=", "self", ".", "_factors", "# (N, C*f1*f2*f3, D, H, W)", "x", "=", "F", ".", "reshape", "(", "x", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
retry
Retry calling the decorated function using an exponential backoff. http://www.saltycrane.com/blog/2009/11/trying-out-retry-decorator-python/ original from: http://wiki.python.org/moin/PythonDecoratorLibrary#Retry :param target_exception: the exception to check. may be a tuple of exceptions to chec...
ci/util.py
def retry(target_exception, tries=4, delay_s=1, backoff=2): """Retry calling the decorated function using an exponential backoff. http://www.saltycrane.com/blog/2009/11/trying-out-retry-decorator-python/ original from: http://wiki.python.org/moin/PythonDecoratorLibrary#Retry :param target_exception: t...
def retry(target_exception, tries=4, delay_s=1, backoff=2): """Retry calling the decorated function using an exponential backoff. http://www.saltycrane.com/blog/2009/11/trying-out-retry-decorator-python/ original from: http://wiki.python.org/moin/PythonDecoratorLibrary#Retry :param target_exception: t...
[ "Retry", "calling", "the", "decorated", "function", "using", "an", "exponential", "backoff", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/ci/util.py#L45-L81
[ "def", "retry", "(", "target_exception", ",", "tries", "=", "4", ",", "delay_s", "=", "1", ",", "backoff", "=", "2", ")", ":", "import", "time", "from", "functools", "import", "wraps", "def", "decorated_retry", "(", "f", ")", ":", "@", "wraps", "(", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
load_model
Returns a module loaded with the provided model. Parameters ---------- model_name: str Prefix of the MXNet model name as stored on the local directory. epoch_num : int Epoch number of model we would like to load. input_shape: tuple The shape of the input data in the form o...
tools/coreml/converter/utils.py
def load_model(model_name, epoch_num, data_shapes, label_shapes, label_names, gpus=''): """Returns a module loaded with the provided model. Parameters ---------- model_name: str Prefix of the MXNet model name as stored on the local directory. epoch_num : int Epoch number of model w...
def load_model(model_name, epoch_num, data_shapes, label_shapes, label_names, gpus=''): """Returns a module loaded with the provided model. Parameters ---------- model_name: str Prefix of the MXNet model name as stored on the local directory. epoch_num : int Epoch number of model w...
[ "Returns", "a", "module", "loaded", "with", "the", "provided", "model", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/tools/coreml/converter/utils.py#L21-L65
[ "def", "load_model", "(", "model_name", ",", "epoch_num", ",", "data_shapes", ",", "label_shapes", ",", "label_names", ",", "gpus", "=", "''", ")", ":", "sym", ",", "arg_params", ",", "aux_params", "=", "mx", ".", "model", ".", "load_checkpoint", "(", "mod...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
create_module
Creates a new MXNet module. Parameters ---------- sym : Symbol An MXNet symbol. input_shape: tuple The shape of the input data in the form of (batch_size, channels, height, width) files: list of strings List of URLs pertaining to files that need to be downloaded in order t...
tools/coreml/converter/utils.py
def create_module(sym, data_shapes, label_shapes, label_names, gpus=''): """Creates a new MXNet module. Parameters ---------- sym : Symbol An MXNet symbol. input_shape: tuple The shape of the input data in the form of (batch_size, channels, height, width) files: list of string...
def create_module(sym, data_shapes, label_shapes, label_names, gpus=''): """Creates a new MXNet module. Parameters ---------- sym : Symbol An MXNet symbol. input_shape: tuple The shape of the input data in the form of (batch_size, channels, height, width) files: list of string...
[ "Creates", "a", "new", "MXNet", "module", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/tools/coreml/converter/utils.py#L68-L117
[ "def", "create_module", "(", "sym", ",", "data_shapes", ",", "label_shapes", ",", "label_names", ",", "gpus", "=", "''", ")", ":", "if", "gpus", "==", "''", ":", "devices", "=", "mx", ".", "cpu", "(", ")", "else", ":", "devices", "=", "[", "mx", "....
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
evaluate_net
evalute network given validation record file Parameters: ---------- net : str or None Network name or use None to load from json without modifying path_imgrec : str path to the record validation file path_imglist : str path to the list file to replace labels in record file, ...
example/ssd/evaluate/evaluate_net.py
def evaluate_net(net, path_imgrec, num_classes, num_batch, mean_pixels, data_shape, model_prefix, epoch, ctx=mx.cpu(), batch_size=32, path_imglist="", nms_thresh=0.45, force_nms=False, ovp_thresh=0.5, use_difficult=False, class_names=None, voc07_metric...
def evaluate_net(net, path_imgrec, num_classes, num_batch, mean_pixels, data_shape, model_prefix, epoch, ctx=mx.cpu(), batch_size=32, path_imglist="", nms_thresh=0.45, force_nms=False, ovp_thresh=0.5, use_difficult=False, class_names=None, voc07_metric...
[ "evalute", "network", "given", "validation", "record", "file" ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/ssd/evaluate/evaluate_net.py#L34-L133
[ "def", "evaluate_net", "(", "net", ",", "path_imgrec", ",", "num_classes", ",", "num_batch", ",", "mean_pixels", ",", "data_shape", ",", "model_prefix", ",", "epoch", ",", "ctx", "=", "mx", ".", "cpu", "(", ")", ",", "batch_size", "=", "32", ",", "path_i...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7