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
reduce_mean
Reduce the array along a given axis by mean value
python/mxnet/contrib/onnx/onnx2mx/_op_translations.py
def reduce_mean(attrs, inputs, proto_obj): """Reduce the array along a given axis by mean value""" new_attrs = translation_utils._fix_attribute_names(attrs, {'axes':'axis'}) return 'mean', new_attrs, inputs
def reduce_mean(attrs, inputs, proto_obj): """Reduce the array along a given axis by mean value""" new_attrs = translation_utils._fix_attribute_names(attrs, {'axes':'axis'}) return 'mean', new_attrs, inputs
[ "Reduce", "the", "array", "along", "a", "given", "axis", "by", "mean", "value" ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/onnx2mx/_op_translations.py#L620-L623
[ "def", "reduce_mean", "(", "attrs", ",", "inputs", ",", "proto_obj", ")", ":", "new_attrs", "=", "translation_utils", ".", "_fix_attribute_names", "(", "attrs", ",", "{", "'axes'", ":", "'axis'", "}", ")", "return", "'mean'", ",", "new_attrs", ",", "inputs" ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
reduce_min
Reduce the array along a given axis by minimum value
python/mxnet/contrib/onnx/onnx2mx/_op_translations.py
def reduce_min(attrs, inputs, proto_obj): """Reduce the array along a given axis by minimum value""" new_attrs = translation_utils._fix_attribute_names(attrs, {'axes':'axis'}) return 'min', new_attrs, inputs
def reduce_min(attrs, inputs, proto_obj): """Reduce the array along a given axis by minimum value""" new_attrs = translation_utils._fix_attribute_names(attrs, {'axes':'axis'}) return 'min', new_attrs, inputs
[ "Reduce", "the", "array", "along", "a", "given", "axis", "by", "minimum", "value" ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/onnx2mx/_op_translations.py#L625-L628
[ "def", "reduce_min", "(", "attrs", ",", "inputs", ",", "proto_obj", ")", ":", "new_attrs", "=", "translation_utils", ".", "_fix_attribute_names", "(", "attrs", ",", "{", "'axes'", ":", "'axis'", "}", ")", "return", "'min'", ",", "new_attrs", ",", "inputs" ]
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
reduce_sum
Reduce the array along a given axis by sum value
python/mxnet/contrib/onnx/onnx2mx/_op_translations.py
def reduce_sum(attrs, inputs, proto_obj): """Reduce the array along a given axis by sum value""" new_attrs = translation_utils._fix_attribute_names(attrs, {'axes':'axis'}) return 'sum', new_attrs, inputs
def reduce_sum(attrs, inputs, proto_obj): """Reduce the array along a given axis by sum value""" new_attrs = translation_utils._fix_attribute_names(attrs, {'axes':'axis'}) return 'sum', new_attrs, inputs
[ "Reduce", "the", "array", "along", "a", "given", "axis", "by", "sum", "value" ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/onnx2mx/_op_translations.py#L630-L633
[ "def", "reduce_sum", "(", "attrs", ",", "inputs", ",", "proto_obj", ")", ":", "new_attrs", "=", "translation_utils", ".", "_fix_attribute_names", "(", "attrs", ",", "{", "'axes'", ":", "'axis'", "}", ")", "return", "'sum'", ",", "new_attrs", ",", "inputs" ]
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
reduce_prod
Reduce the array along a given axis by product value
python/mxnet/contrib/onnx/onnx2mx/_op_translations.py
def reduce_prod(attrs, inputs, proto_obj): """Reduce the array along a given axis by product value""" new_attrs = translation_utils._fix_attribute_names(attrs, {'axes':'axis'}) return 'prod', new_attrs, inputs
def reduce_prod(attrs, inputs, proto_obj): """Reduce the array along a given axis by product value""" new_attrs = translation_utils._fix_attribute_names(attrs, {'axes':'axis'}) return 'prod', new_attrs, inputs
[ "Reduce", "the", "array", "along", "a", "given", "axis", "by", "product", "value" ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/onnx2mx/_op_translations.py#L635-L638
[ "def", "reduce_prod", "(", "attrs", ",", "inputs", ",", "proto_obj", ")", ":", "new_attrs", "=", "translation_utils", ".", "_fix_attribute_names", "(", "attrs", ",", "{", "'axes'", ":", "'axis'", "}", ")", "return", "'prod'", ",", "new_attrs", ",", "inputs" ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
reduce_log_sum
Reduce the array along a given axis by log sum value
python/mxnet/contrib/onnx/onnx2mx/_op_translations.py
def reduce_log_sum(attrs, inputs, proto_obj): """Reduce the array along a given axis by log sum value""" keep_dims = True if 'keepdims' not in attrs else attrs.get('keepdims') sum_op = symbol.sum(inputs[0], axis=attrs.get('axes'), keepdims=keep_dims) log_sym = symbol.log(sum_op) ...
def reduce_log_sum(attrs, inputs, proto_obj): """Reduce the array along a given axis by log sum value""" keep_dims = True if 'keepdims' not in attrs else attrs.get('keepdims') sum_op = symbol.sum(inputs[0], axis=attrs.get('axes'), keepdims=keep_dims) log_sym = symbol.log(sum_op) ...
[ "Reduce", "the", "array", "along", "a", "given", "axis", "by", "log", "sum", "value" ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/onnx2mx/_op_translations.py#L640-L646
[ "def", "reduce_log_sum", "(", "attrs", ",", "inputs", ",", "proto_obj", ")", ":", "keep_dims", "=", "True", "if", "'keepdims'", "not", "in", "attrs", "else", "attrs", ".", "get", "(", "'keepdims'", ")", "sum_op", "=", "symbol", ".", "sum", "(", "inputs",...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
reduce_log_sum_exp
Reduce the array along a given axis by log sum exp value
python/mxnet/contrib/onnx/onnx2mx/_op_translations.py
def reduce_log_sum_exp(attrs, inputs, proto_obj): """Reduce the array along a given axis by log sum exp value""" keep_dims = True if 'keepdims' not in attrs else attrs.get('keepdims') exp_op = symbol.exp(inputs[0]) sum_op = symbol.sum(exp_op, axis=attrs.get('axes'), keepdims=keep...
def reduce_log_sum_exp(attrs, inputs, proto_obj): """Reduce the array along a given axis by log sum exp value""" keep_dims = True if 'keepdims' not in attrs else attrs.get('keepdims') exp_op = symbol.exp(inputs[0]) sum_op = symbol.sum(exp_op, axis=attrs.get('axes'), keepdims=keep...
[ "Reduce", "the", "array", "along", "a", "given", "axis", "by", "log", "sum", "exp", "value" ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/onnx2mx/_op_translations.py#L648-L655
[ "def", "reduce_log_sum_exp", "(", "attrs", ",", "inputs", ",", "proto_obj", ")", ":", "keep_dims", "=", "True", "if", "'keepdims'", "not", "in", "attrs", "else", "attrs", ".", "get", "(", "'keepdims'", ")", "exp_op", "=", "symbol", ".", "exp", "(", "inpu...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
reduce_sum_square
Reduce the array along a given axis by sum square value
python/mxnet/contrib/onnx/onnx2mx/_op_translations.py
def reduce_sum_square(attrs, inputs, proto_obj): """Reduce the array along a given axis by sum square value""" square_op = symbol.square(inputs[0]) sum_op = symbol.sum(square_op, axis=attrs.get('axes'), keepdims=attrs.get('keepdims')) return sum_op, attrs, inputs
def reduce_sum_square(attrs, inputs, proto_obj): """Reduce the array along a given axis by sum square value""" square_op = symbol.square(inputs[0]) sum_op = symbol.sum(square_op, axis=attrs.get('axes'), keepdims=attrs.get('keepdims')) return sum_op, attrs, inputs
[ "Reduce", "the", "array", "along", "a", "given", "axis", "by", "sum", "square", "value" ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/onnx2mx/_op_translations.py#L657-L662
[ "def", "reduce_sum_square", "(", "attrs", ",", "inputs", ",", "proto_obj", ")", ":", "square_op", "=", "symbol", ".", "square", "(", "inputs", "[", "0", "]", ")", "sum_op", "=", "symbol", ".", "sum", "(", "square_op", ",", "axis", "=", "attrs", ".", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
reduce_l1
Reduce input tensor by l1 normalization.
python/mxnet/contrib/onnx/onnx2mx/_op_translations.py
def reduce_l1(attrs, inputs, proto_obj): """Reduce input tensor by l1 normalization.""" new_attrs = translation_utils._fix_attribute_names(attrs, {'axes':'axis'}) new_attrs = translation_utils._add_extra_attributes(new_attrs, {'ord' : 1}) return 'n...
def reduce_l1(attrs, inputs, proto_obj): """Reduce input tensor by l1 normalization.""" new_attrs = translation_utils._fix_attribute_names(attrs, {'axes':'axis'}) new_attrs = translation_utils._add_extra_attributes(new_attrs, {'ord' : 1}) return 'n...
[ "Reduce", "input", "tensor", "by", "l1", "normalization", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/onnx2mx/_op_translations.py#L664-L669
[ "def", "reduce_l1", "(", "attrs", ",", "inputs", ",", "proto_obj", ")", ":", "new_attrs", "=", "translation_utils", ".", "_fix_attribute_names", "(", "attrs", ",", "{", "'axes'", ":", "'axis'", "}", ")", "new_attrs", "=", "translation_utils", ".", "_add_extra_...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
reduce_l2
Reduce input tensor by l2 normalization.
python/mxnet/contrib/onnx/onnx2mx/_op_translations.py
def reduce_l2(attrs, inputs, proto_obj): """Reduce input tensor by l2 normalization.""" new_attrs = translation_utils._fix_attribute_names(attrs, {'axes':'axis'}) return 'norm', new_attrs, inputs
def reduce_l2(attrs, inputs, proto_obj): """Reduce input tensor by l2 normalization.""" new_attrs = translation_utils._fix_attribute_names(attrs, {'axes':'axis'}) return 'norm', new_attrs, inputs
[ "Reduce", "input", "tensor", "by", "l2", "normalization", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/onnx2mx/_op_translations.py#L679-L682
[ "def", "reduce_l2", "(", "attrs", ",", "inputs", ",", "proto_obj", ")", ":", "new_attrs", "=", "translation_utils", ".", "_fix_attribute_names", "(", "attrs", ",", "{", "'axes'", ":", "'axis'", "}", ")", "return", "'norm'", ",", "new_attrs", ",", "inputs" ]
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
avg_pooling
Average pooling
python/mxnet/contrib/onnx/onnx2mx/_op_translations.py
def avg_pooling(attrs, inputs, proto_obj): """ Average pooling""" new_attrs = translation_utils._fix_attribute_names(attrs, {'kernel_shape': 'kernel', 'strides': 'stride', ...
def avg_pooling(attrs, inputs, proto_obj): """ Average pooling""" new_attrs = translation_utils._fix_attribute_names(attrs, {'kernel_shape': 'kernel', 'strides': 'stride', ...
[ "Average", "pooling" ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/onnx2mx/_op_translations.py#L684-L696
[ "def", "avg_pooling", "(", "attrs", ",", "inputs", ",", "proto_obj", ")", ":", "new_attrs", "=", "translation_utils", ".", "_fix_attribute_names", "(", "attrs", ",", "{", "'kernel_shape'", ":", "'kernel'", ",", "'strides'", ":", "'stride'", ",", "'pads'", ":",...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
lp_pooling
LP Pooling
python/mxnet/contrib/onnx/onnx2mx/_op_translations.py
def lp_pooling(attrs, inputs, proto_obj): """LP Pooling""" p_value = attrs.get('p', 2) new_attrs = translation_utils._fix_attribute_names(attrs, {'kernel_shape': 'kernel', 'strides': 'stride', ...
def lp_pooling(attrs, inputs, proto_obj): """LP Pooling""" p_value = attrs.get('p', 2) new_attrs = translation_utils._fix_attribute_names(attrs, {'kernel_shape': 'kernel', 'strides': 'stride', ...
[ "LP", "Pooling" ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/onnx2mx/_op_translations.py#L698-L712
[ "def", "lp_pooling", "(", "attrs", ",", "inputs", ",", "proto_obj", ")", ":", "p_value", "=", "attrs", ".", "get", "(", "'p'", ",", "2", ")", "new_attrs", "=", "translation_utils", ".", "_fix_attribute_names", "(", "attrs", ",", "{", "'kernel_shape'", ":",...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
max_roi_pooling
Max ROI Pooling.
python/mxnet/contrib/onnx/onnx2mx/_op_translations.py
def max_roi_pooling(attrs, inputs, proto_obj): """Max ROI Pooling.""" new_attrs = translation_utils._fix_attribute_names(attrs, {'pooled_shape': 'pooled_size', 'spatial_scale': 'spatial_scale' ...
def max_roi_pooling(attrs, inputs, proto_obj): """Max ROI Pooling.""" new_attrs = translation_utils._fix_attribute_names(attrs, {'pooled_shape': 'pooled_size', 'spatial_scale': 'spatial_scale' ...
[ "Max", "ROI", "Pooling", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/onnx2mx/_op_translations.py#L729-L735
[ "def", "max_roi_pooling", "(", "attrs", ",", "inputs", ",", "proto_obj", ")", ":", "new_attrs", "=", "translation_utils", ".", "_fix_attribute_names", "(", "attrs", ",", "{", "'pooled_shape'", ":", "'pooled_size'", ",", "'spatial_scale'", ":", "'spatial_scale'", "...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
depthtospace
Rearranges data from depth into blocks of spatial data.
python/mxnet/contrib/onnx/onnx2mx/_op_translations.py
def depthtospace(attrs, inputs, proto_obj): """Rearranges data from depth into blocks of spatial data.""" new_attrs = translation_utils._fix_attribute_names(attrs, {'blocksize':'block_size'}) return "depth_to_space", new_attrs, inputs
def depthtospace(attrs, inputs, proto_obj): """Rearranges data from depth into blocks of spatial data.""" new_attrs = translation_utils._fix_attribute_names(attrs, {'blocksize':'block_size'}) return "depth_to_space", new_attrs, inputs
[ "Rearranges", "data", "from", "depth", "into", "blocks", "of", "spatial", "data", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/onnx2mx/_op_translations.py#L737-L741
[ "def", "depthtospace", "(", "attrs", ",", "inputs", ",", "proto_obj", ")", ":", "new_attrs", "=", "translation_utils", ".", "_fix_attribute_names", "(", "attrs", ",", "{", "'blocksize'", ":", "'block_size'", "}", ")", "return", "\"depth_to_space\"", ",", "new_at...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
spacetodepth
Rearranges blocks of spatial data into depth.
python/mxnet/contrib/onnx/onnx2mx/_op_translations.py
def spacetodepth(attrs, inputs, proto_obj): """Rearranges blocks of spatial data into depth.""" new_attrs = translation_utils._fix_attribute_names(attrs, {'blocksize':'block_size'}) return "space_to_depth", new_attrs, inputs
def spacetodepth(attrs, inputs, proto_obj): """Rearranges blocks of spatial data into depth.""" new_attrs = translation_utils._fix_attribute_names(attrs, {'blocksize':'block_size'}) return "space_to_depth", new_attrs, inputs
[ "Rearranges", "blocks", "of", "spatial", "data", "into", "depth", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/onnx2mx/_op_translations.py#L743-L747
[ "def", "spacetodepth", "(", "attrs", ",", "inputs", ",", "proto_obj", ")", ":", "new_attrs", "=", "translation_utils", ".", "_fix_attribute_names", "(", "attrs", ",", "{", "'blocksize'", ":", "'block_size'", "}", ")", "return", "\"space_to_depth\"", ",", "new_at...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
hardmax
Returns batched one-hot vectors.
python/mxnet/contrib/onnx/onnx2mx/_op_translations.py
def hardmax(attrs, inputs, proto_obj): """Returns batched one-hot vectors.""" input_tensor_data = proto_obj.model_metadata.get('input_tensor_data')[0] input_shape = input_tensor_data[1] axis = int(attrs.get('axis', 1)) axis = axis if axis >= 0 else len(input_shape) + axis if axis == len(input_...
def hardmax(attrs, inputs, proto_obj): """Returns batched one-hot vectors.""" input_tensor_data = proto_obj.model_metadata.get('input_tensor_data')[0] input_shape = input_tensor_data[1] axis = int(attrs.get('axis', 1)) axis = axis if axis >= 0 else len(input_shape) + axis if axis == len(input_...
[ "Returns", "batched", "one", "-", "hot", "vectors", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/onnx2mx/_op_translations.py#L749-L772
[ "def", "hardmax", "(", "attrs", ",", "inputs", ",", "proto_obj", ")", ":", "input_tensor_data", "=", "proto_obj", ".", "model_metadata", ".", "get", "(", "'input_tensor_data'", ")", "[", "0", "]", "input_shape", "=", "input_tensor_data", "[", "1", "]", "axis...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
lpnormalization
ONNX does not have eps attribute, so cannot map it to L2normalization in MXNet without that, it works as norm operator discussion in PR: https://github.com/onnx/onnx/pull/1330
python/mxnet/contrib/onnx/onnx2mx/_op_translations.py
def lpnormalization(attrs, inputs, proto_obj): """ONNX does not have eps attribute, so cannot map it to L2normalization in MXNet without that, it works as norm operator discussion in PR: https://github.com/onnx/onnx/pull/1330""" new_attrs = translation_utils._fix_attribute_names(attrs, {'p': 'ord'}) ...
def lpnormalization(attrs, inputs, proto_obj): """ONNX does not have eps attribute, so cannot map it to L2normalization in MXNet without that, it works as norm operator discussion in PR: https://github.com/onnx/onnx/pull/1330""" new_attrs = translation_utils._fix_attribute_names(attrs, {'p': 'ord'}) ...
[ "ONNX", "does", "not", "have", "eps", "attribute", "so", "cannot", "map", "it", "to", "L2normalization", "in", "MXNet", "without", "that", "it", "works", "as", "norm", "operator", "discussion", "in", "PR", ":", "https", ":", "//", "github", ".", "com", "...
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/contrib/onnx/onnx2mx/_op_translations.py#L774-L781
[ "def", "lpnormalization", "(", "attrs", ",", "inputs", ",", "proto_obj", ")", ":", "new_attrs", "=", "translation_utils", ".", "_fix_attribute_names", "(", "attrs", ",", "{", "'p'", ":", "'ord'", "}", ")", "axis", "=", "int", "(", "attrs", ".", "get", "(...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
download_mp4
download mp4s
example/gluon/lipnet/utils/download_data.py
def download_mp4(from_idx, to_idx, _params): """ download mp4s """ succ = set() fail = set() for idx in range(from_idx, to_idx): name = 's' + str(idx) save_folder = '{src_path}/{nm}'.format(src_path=_params['src_path'], nm=name) if idx == 0 or os.path.isdir(save_folder): ...
def download_mp4(from_idx, to_idx, _params): """ download mp4s """ succ = set() fail = set() for idx in range(from_idx, to_idx): name = 's' + str(idx) save_folder = '{src_path}/{nm}'.format(src_path=_params['src_path'], nm=name) if idx == 0 or os.path.isdir(save_folder): ...
[ "download", "mp4s" ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/gluon/lipnet/utils/download_data.py#L28-L52
[ "def", "download_mp4", "(", "from_idx", ",", "to_idx", ",", "_params", ")", ":", "succ", "=", "set", "(", ")", "fail", "=", "set", "(", ")", "for", "idx", "in", "range", "(", "from_idx", ",", "to_idx", ")", ":", "name", "=", "'s'", "+", "str", "(...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
download_align
download aligns
example/gluon/lipnet/utils/download_data.py
def download_align(from_idx, to_idx, _params): """ download aligns """ succ = set() fail = set() for idx in range(from_idx, to_idx): name = 's' + str(idx) if idx == 0: continue script = "http://spandh.dcs.shef.ac.uk/gridcorpus/{nm}/align/{nm}.tar".format(nm=na...
def download_align(from_idx, to_idx, _params): """ download aligns """ succ = set() fail = set() for idx in range(from_idx, to_idx): name = 's' + str(idx) if idx == 0: continue script = "http://spandh.dcs.shef.ac.uk/gridcorpus/{nm}/align/{nm}.tar".format(nm=na...
[ "download", "aligns" ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/gluon/lipnet/utils/download_data.py#L55-L77
[ "def", "download_align", "(", "from_idx", ",", "to_idx", ",", "_params", ")", ":", "succ", "=", "set", "(", ")", "fail", "=", "set", "(", ")", "for", "idx", "in", "range", "(", "from_idx", ",", "to_idx", ")", ":", "name", "=", "'s'", "+", "str", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
run_ut_py3_qemu
Run unit tests in the emulator and copy the results back to the host through the mounted volume in /mxnet
ci/docker/qemu/runtime_functions.py
def run_ut_py3_qemu(): """Run unit tests in the emulator and copy the results back to the host through the mounted volume in /mxnet""" from vmcontrol import VM with VM() as vm: qemu_provision(vm.ssh_port) logging.info("execute tests") qemu_ssh(vm.ssh_port, "./runtime_functions.py...
def run_ut_py3_qemu(): """Run unit tests in the emulator and copy the results back to the host through the mounted volume in /mxnet""" from vmcontrol import VM with VM() as vm: qemu_provision(vm.ssh_port) logging.info("execute tests") qemu_ssh(vm.ssh_port, "./runtime_functions.py...
[ "Run", "unit", "tests", "in", "the", "emulator", "and", "copy", "the", "results", "back", "to", "the", "host", "through", "the", "mounted", "volume", "in", "/", "mxnet" ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/ci/docker/qemu/runtime_functions.py#L61-L72
[ "def", "run_ut_py3_qemu", "(", ")", ":", "from", "vmcontrol", "import", "VM", "with", "VM", "(", ")", "as", "vm", ":", "qemu_provision", "(", "vm", ".", "ssh_port", ")", "logging", ".", "info", "(", "\"execute tests\"", ")", "qemu_ssh", "(", "vm", ".", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
run_ut_python3_qemu_internal
this runs inside the vm
ci/docker/qemu/runtime_functions.py
def run_ut_python3_qemu_internal(): """this runs inside the vm""" pkg = glob.glob('mxnet_dist/*.whl')[0] logging.info("=== NOW Running inside QEMU ===") logging.info("PIP Installing %s", pkg) check_call(['sudo', 'pip3', 'install', pkg]) logging.info("PIP Installing mxnet/test_requirements.txt") ...
def run_ut_python3_qemu_internal(): """this runs inside the vm""" pkg = glob.glob('mxnet_dist/*.whl')[0] logging.info("=== NOW Running inside QEMU ===") logging.info("PIP Installing %s", pkg) check_call(['sudo', 'pip3', 'install', pkg]) logging.info("PIP Installing mxnet/test_requirements.txt") ...
[ "this", "runs", "inside", "the", "vm" ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/ci/docker/qemu/runtime_functions.py#L74-L83
[ "def", "run_ut_python3_qemu_internal", "(", ")", ":", "pkg", "=", "glob", ".", "glob", "(", "'mxnet_dist/*.whl'", ")", "[", "0", "]", "logging", ".", "info", "(", "\"=== NOW Running inside QEMU ===\"", ")", "logging", ".", "info", "(", "\"PIP Installing %s\"", "...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
_get_subword_units
Return subword-units presentation, given a word/token.
example/nce-loss/text8_data.py
def _get_subword_units(token, gram): """Return subword-units presentation, given a word/token. """ if token == '</s>': # special token for padding purpose. return [token] t = '#' + token + '#' return [t[i:i + gram] for i in range(0, len(t) - gram + 1)]
def _get_subword_units(token, gram): """Return subword-units presentation, given a word/token. """ if token == '</s>': # special token for padding purpose. return [token] t = '#' + token + '#' return [t[i:i + gram] for i in range(0, len(t) - gram + 1)]
[ "Return", "subword", "-", "units", "presentation", "given", "a", "word", "/", "token", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/nce-loss/text8_data.py#L68-L74
[ "def", "_get_subword_units", "(", "token", ",", "gram", ")", ":", "if", "token", "==", "'</s>'", ":", "# special token for padding purpose.", "return", "[", "token", "]", "t", "=", "'#'", "+", "token", "+", "'#'", "return", "[", "t", "[", "i", ":", "i", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
fit
Train the model using Caffe operator in MXNet
example/caffe/train_model.py
def fit(args, network, data_loader, eval_metrics=None, batch_end_callback=None): """Train the model using Caffe operator in MXNet""" # kvstore kv = mx.kvstore.create(args.kv_store) # logging head = '%(asctime)-15s Node[' + str(kv.rank) + '] %(message)s' if 'log_file' in args and args.log_file i...
def fit(args, network, data_loader, eval_metrics=None, batch_end_callback=None): """Train the model using Caffe operator in MXNet""" # kvstore kv = mx.kvstore.create(args.kv_store) # logging head = '%(asctime)-15s Node[' + str(kv.rank) + '] %(message)s' if 'log_file' in args and args.log_file i...
[ "Train", "the", "model", "using", "Caffe", "operator", "in", "MXNet" ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/caffe/train_model.py#L23-L109
[ "def", "fit", "(", "args", ",", "network", ",", "data_loader", ",", "eval_metrics", "=", "None", ",", "batch_end_callback", "=", "None", ")", ":", "# kvstore", "kv", "=", "mx", ".", "kvstore", ".", "create", "(", "args", ".", "kv_store", ")", "# logging"...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
Atari8080Preprocessor.preprocess
Preprocess a 210x160x3 uint8 frame into a 6400 (80x80) (1 x input_size) float vector.
example/reinforcement-learning/parallel_actor_critic/envs.py
def preprocess(self, img): """ Preprocess a 210x160x3 uint8 frame into a 6400 (80x80) (1 x input_size) float vector. """ # Crop, down-sample, erase background and set foreground to 1. # See https://gist.github.com/karpathy/a4166c7fe253700972fcbc77e4ea32c5 img = im...
def preprocess(self, img): """ Preprocess a 210x160x3 uint8 frame into a 6400 (80x80) (1 x input_size) float vector. """ # Crop, down-sample, erase background and set foreground to 1. # See https://gist.github.com/karpathy/a4166c7fe253700972fcbc77e4ea32c5 img = im...
[ "Preprocess", "a", "210x160x3", "uint8", "frame", "into", "a", "6400", "(", "80x80", ")", "(", "1", "x", "input_size", ")", "float", "vector", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/reinforcement-learning/parallel_actor_critic/envs.py#L29-L46
[ "def", "preprocess", "(", "self", ",", "img", ")", ":", "# Crop, down-sample, erase background and set foreground to 1.", "# See https://gist.github.com/karpathy/a4166c7fe253700972fcbc77e4ea32c5", "img", "=", "img", "[", "35", ":", "195", "]", "img", "=", "img", "[", ":",...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
_new_empty_handle
Returns a new empty handle. Empty handle can be used to hold a result. Returns ------- handle A new empty `NDArray` handle.
python/mxnet/ndarray/ndarray.py
def _new_empty_handle(): """Returns a new empty handle. Empty handle can be used to hold a result. Returns ------- handle A new empty `NDArray` handle. """ hdl = NDArrayHandle() check_call(_LIB.MXNDArrayCreateNone(ctypes.byref(hdl))) return hdl
def _new_empty_handle(): """Returns a new empty handle. Empty handle can be used to hold a result. Returns ------- handle A new empty `NDArray` handle. """ hdl = NDArrayHandle() check_call(_LIB.MXNDArrayCreateNone(ctypes.byref(hdl))) return hdl
[ "Returns", "a", "new", "empty", "handle", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L107-L119
[ "def", "_new_empty_handle", "(", ")", ":", "hdl", "=", "NDArrayHandle", "(", ")", "check_call", "(", "_LIB", ".", "MXNDArrayCreateNone", "(", "ctypes", ".", "byref", "(", "hdl", ")", ")", ")", "return", "hdl" ]
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
_new_alloc_handle
Return a new handle with specified shape and context. Empty handle is only used to hold results. Returns ------- handle A new empty `NDArray` handle.
python/mxnet/ndarray/ndarray.py
def _new_alloc_handle(shape, ctx, delay_alloc, dtype=mx_real_t): """Return a new handle with specified shape and context. Empty handle is only used to hold results. Returns ------- handle A new empty `NDArray` handle. """ hdl = NDArrayHandle() check_call(_LIB.MXNDArrayCreateEx(...
def _new_alloc_handle(shape, ctx, delay_alloc, dtype=mx_real_t): """Return a new handle with specified shape and context. Empty handle is only used to hold results. Returns ------- handle A new empty `NDArray` handle. """ hdl = NDArrayHandle() check_call(_LIB.MXNDArrayCreateEx(...
[ "Return", "a", "new", "handle", "with", "specified", "shape", "and", "context", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L122-L141
[ "def", "_new_alloc_handle", "(", "shape", ",", "ctx", ",", "delay_alloc", ",", "dtype", "=", "mx_real_t", ")", ":", "hdl", "=", "NDArrayHandle", "(", ")", "check_call", "(", "_LIB", ".", "MXNDArrayCreateEx", "(", "c_array_buf", "(", "mx_uint", ",", "native_a...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
_get_indexing_dispatch_code
Returns a dispatch code for calling basic or advanced indexing functions.
python/mxnet/ndarray/ndarray.py
def _get_indexing_dispatch_code(key): """Returns a dispatch code for calling basic or advanced indexing functions.""" if isinstance(key, (NDArray, np.ndarray)): return _NDARRAY_ADVANCED_INDEXING elif isinstance(key, list): # TODO(junwu): Add support for nested lists besides integer list ...
def _get_indexing_dispatch_code(key): """Returns a dispatch code for calling basic or advanced indexing functions.""" if isinstance(key, (NDArray, np.ndarray)): return _NDARRAY_ADVANCED_INDEXING elif isinstance(key, list): # TODO(junwu): Add support for nested lists besides integer list ...
[ "Returns", "a", "dispatch", "code", "for", "calling", "basic", "or", "advanced", "indexing", "functions", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L2278-L2301
[ "def", "_get_indexing_dispatch_code", "(", "key", ")", ":", "if", "isinstance", "(", "key", ",", "(", "NDArray", ",", "np", ".", "ndarray", ")", ")", ":", "return", "_NDARRAY_ADVANCED_INDEXING", "elif", "isinstance", "(", "key", ",", "list", ")", ":", "# T...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
_get_index_range
Given start, stop, step and array length, return absolute values of start, stop, and step for generating index range. The returned values have been compensated by adding length if they are less than zero for all the cases but slice(None, None, -1). Note that the returned value of stop is not necessarily...
python/mxnet/ndarray/ndarray.py
def _get_index_range(start, stop, length, step=1): """Given start, stop, step and array length, return absolute values of start, stop, and step for generating index range. The returned values have been compensated by adding length if they are less than zero for all the cases but slice(None, None, -1). ...
def _get_index_range(start, stop, length, step=1): """Given start, stop, step and array length, return absolute values of start, stop, and step for generating index range. The returned values have been compensated by adding length if they are less than zero for all the cases but slice(None, None, -1). ...
[ "Given", "start", "stop", "step", "and", "array", "length", "return", "absolute", "values", "of", "start", "stop", "and", "step", "for", "generating", "index", "range", ".", "The", "returned", "values", "have", "been", "compensated", "by", "adding", "length", ...
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L2304-L2344
[ "def", "_get_index_range", "(", "start", ",", "stop", ",", "length", ",", "step", "=", "1", ")", ":", "if", "step", "==", "0", ":", "raise", "ValueError", "(", "'step size cannot be zero'", ")", "if", "length", "<", "0", ":", "raise", "ValueError", "(", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
_get_oshape_of_gather_nd_op
Given data and index shapes, get the output `NDArray` shape. This basically implements the infer shape logic of op gather_nd.
python/mxnet/ndarray/ndarray.py
def _get_oshape_of_gather_nd_op(dshape, ishape): """Given data and index shapes, get the output `NDArray` shape. This basically implements the infer shape logic of op gather_nd.""" assert len(dshape) > 0 and len(ishape) > 0 oshape = list(ishape[1:]) if ishape[0] < len(dshape): oshape.extend(...
def _get_oshape_of_gather_nd_op(dshape, ishape): """Given data and index shapes, get the output `NDArray` shape. This basically implements the infer shape logic of op gather_nd.""" assert len(dshape) > 0 and len(ishape) > 0 oshape = list(ishape[1:]) if ishape[0] < len(dshape): oshape.extend(...
[ "Given", "data", "and", "index", "shapes", "get", "the", "output", "NDArray", "shape", ".", "This", "basically", "implements", "the", "infer", "shape", "logic", "of", "op", "gather_nd", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L2347-L2354
[ "def", "_get_oshape_of_gather_nd_op", "(", "dshape", ",", "ishape", ")", ":", "assert", "len", "(", "dshape", ")", ">", "0", "and", "len", "(", "ishape", ")", ">", "0", "oshape", "=", "list", "(", "ishape", "[", "1", ":", "]", ")", "if", "ishape", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
_get_dim_size
Given start, stop, and stop, calculate the number of elements of this slice.
python/mxnet/ndarray/ndarray.py
def _get_dim_size(start, stop, step): """Given start, stop, and stop, calculate the number of elements of this slice.""" assert step != 0 if step > 0: assert start < stop dim_size = (stop - start - 1) // step + 1 else: assert stop < start dim_size = (start - stop - 1)...
def _get_dim_size(start, stop, step): """Given start, stop, and stop, calculate the number of elements of this slice.""" assert step != 0 if step > 0: assert start < stop dim_size = (stop - start - 1) // step + 1 else: assert stop < start dim_size = (start - stop - 1)...
[ "Given", "start", "stop", "and", "stop", "calculate", "the", "number", "of", "elements", "of", "this", "slice", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L2357-L2367
[ "def", "_get_dim_size", "(", "start", ",", "stop", ",", "step", ")", ":", "assert", "step", "!=", "0", "if", "step", ">", "0", ":", "assert", "start", "<", "stop", "dim_size", "=", "(", "stop", "-", "start", "-", "1", ")", "//", "step", "+", "1",...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
_get_broadcast_shape
Given two shapes that are not identical, find the shape that both input shapes can broadcast to.
python/mxnet/ndarray/ndarray.py
def _get_broadcast_shape(shape1, shape2): """Given two shapes that are not identical, find the shape that both input shapes can broadcast to.""" if shape1 == shape2: return shape1 length1 = len(shape1) length2 = len(shape2) if length1 > length2: shape = list(shape1) else: ...
def _get_broadcast_shape(shape1, shape2): """Given two shapes that are not identical, find the shape that both input shapes can broadcast to.""" if shape1 == shape2: return shape1 length1 = len(shape1) length2 = len(shape2) if length1 > length2: shape = list(shape1) else: ...
[ "Given", "two", "shapes", "that", "are", "not", "identical", "find", "the", "shape", "that", "both", "input", "shapes", "can", "broadcast", "to", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L2370-L2388
[ "def", "_get_broadcast_shape", "(", "shape1", ",", "shape2", ")", ":", "if", "shape1", "==", "shape2", ":", "return", "shape1", "length1", "=", "len", "(", "shape1", ")", "length2", "=", "len", "(", "shape2", ")", "if", "length1", ">", "length2", ":", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
ones
Returns a new array filled with all ones, with the given shape and type. Parameters ---------- shape : int or tuple of int or list of int The shape of the empty array. ctx : Context, optional An optional device context. Defaults to the current default context (``mxnet.context.cu...
python/mxnet/ndarray/ndarray.py
def ones(shape, ctx=None, dtype=None, **kwargs): """Returns a new array filled with all ones, with the given shape and type. Parameters ---------- shape : int or tuple of int or list of int The shape of the empty array. ctx : Context, optional An optional device context. Def...
def ones(shape, ctx=None, dtype=None, **kwargs): """Returns a new array filled with all ones, with the given shape and type. Parameters ---------- shape : int or tuple of int or list of int The shape of the empty array. ctx : Context, optional An optional device context. Def...
[ "Returns", "a", "new", "array", "filled", "with", "all", "ones", "with", "the", "given", "shape", "and", "type", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L2402-L2436
[ "def", "ones", "(", "shape", ",", "ctx", "=", "None", ",", "dtype", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable= unused-argument", "if", "ctx", "is", "None", ":", "ctx", "=", "current_context", "(", ")", "dtype", "=", "mx_real_t", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
full
Returns a new array of given shape and type, filled with the given value `val`. Parameters -------- shape : int or tuple of int The shape of the new array. val : scalar Fill value. ctx : Context, optional Device context (default is the current default context). dtype : `...
python/mxnet/ndarray/ndarray.py
def full(shape, val, ctx=None, dtype=mx_real_t, out=None): """Returns a new array of given shape and type, filled with the given value `val`. Parameters -------- shape : int or tuple of int The shape of the new array. val : scalar Fill value. ctx : Context, optional Devi...
def full(shape, val, ctx=None, dtype=mx_real_t, out=None): """Returns a new array of given shape and type, filled with the given value `val`. Parameters -------- shape : int or tuple of int The shape of the new array. val : scalar Fill value. ctx : Context, optional Devi...
[ "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/ndarray/ndarray.py#L2440-L2472
[ "def", "full", "(", "shape", ",", "val", ",", "ctx", "=", "None", ",", "dtype", "=", "mx_real_t", ",", "out", "=", "None", ")", ":", "out", "=", "empty", "(", "shape", ",", "ctx", ",", "dtype", ")", "if", "out", "is", "None", "else", "out", "ou...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
array
Creates an array from any object exposing the array interface. Parameters ---------- source_array : array_like An object exposing the array interface, an object whose `__array__` method returns an array, or any (nested) sequence. ctx : Context, optional Device context (default i...
python/mxnet/ndarray/ndarray.py
def array(source_array, ctx=None, dtype=None): """Creates an array from any object exposing the array interface. Parameters ---------- source_array : array_like An object exposing the array interface, an object whose `__array__` method returns an array, or any (nested) sequence. ctx...
def array(source_array, ctx=None, dtype=None): """Creates an array from any object exposing the array interface. Parameters ---------- source_array : array_like An object exposing the array interface, an object whose `__array__` method returns an array, or any (nested) sequence. ctx...
[ "Creates", "an", "array", "from", "any", "object", "exposing", "the", "array", "interface", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L2475-L2505
[ "def", "array", "(", "source_array", ",", "ctx", "=", "None", ",", "dtype", "=", "None", ")", ":", "if", "isinstance", "(", "source_array", ",", "NDArray", ")", ":", "dtype", "=", "source_array", ".", "dtype", "if", "dtype", "is", "None", "else", "dtyp...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
moveaxis
Moves the `source` axis into the `destination` position while leaving the other axes in their original order Parameters ---------- tensor : mx.nd.array The array which axes should be reordered source : int or sequence of int Original position of the axes to move. Can be negative but...
python/mxnet/ndarray/ndarray.py
def moveaxis(tensor, source, destination): """Moves the `source` axis into the `destination` position while leaving the other axes in their original order Parameters ---------- tensor : mx.nd.array The array which axes should be reordered source : int or sequence of int Original...
def moveaxis(tensor, source, destination): """Moves the `source` axis into the `destination` position while leaving the other axes in their original order Parameters ---------- tensor : mx.nd.array The array which axes should be reordered source : int or sequence of int Original...
[ "Moves", "the", "source", "axis", "into", "the", "destination", "position", "while", "leaving", "the", "other", "axes", "in", "their", "original", "order" ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L2508-L2556
[ "def", "moveaxis", "(", "tensor", ",", "source", ",", "destination", ")", ":", "try", ":", "source", "=", "np", ".", "core", ".", "numeric", ".", "normalize_axis_tuple", "(", "source", ",", "tensor", ".", "ndim", ")", "except", "IndexError", ":", "raise"...
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 an `NDArray`....
python/mxnet/ndarray/ndarray.py
def arange(start, stop=None, step=1.0, repeat=1, infer_range=None, ctx=None, dtype=mx_real_t): """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 ...
def arange(start, stop=None, step=1.0, repeat=1, infer_range=None, ctx=None, dtype=mx_real_t): """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 ...
[ "Returns", "evenly", "spaced", "values", "within", "a", "given", "interval", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L2560-L2610
[ "def", "arange", "(", "start", ",", "stop", "=", "None", ",", "step", "=", "1.0", ",", "repeat", "=", "1", ",", "infer_range", "=", "None", ",", "ctx", "=", "None", ",", "dtype", "=", "mx_real_t", ")", ":", "if", "infer_range", "is", "not", "None",...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
_ufunc_helper
Helper function for element-wise operation. The function will perform numpy-like broadcasting if needed and call different functions. Parameters -------- lhs : NDArray or numeric value Left-hand side operand. rhs : NDArray or numeric value Right-hand operand, fn_array : functi...
python/mxnet/ndarray/ndarray.py
def _ufunc_helper(lhs, rhs, fn_array, fn_scalar, lfn_scalar, rfn_scalar=None): """ Helper function for element-wise operation. The function will perform numpy-like broadcasting if needed and call different functions. Parameters -------- lhs : NDArray or numeric value Left-hand side operand....
def _ufunc_helper(lhs, rhs, fn_array, fn_scalar, lfn_scalar, rfn_scalar=None): """ Helper function for element-wise operation. The function will perform numpy-like broadcasting if needed and call different functions. Parameters -------- lhs : NDArray or numeric value Left-hand side operand....
[ "Helper", "function", "for", "element", "-", "wise", "operation", ".", "The", "function", "will", "perform", "numpy", "-", "like", "broadcasting", "if", "needed", "and", "call", "different", "functions", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L2615-L2659
[ "def", "_ufunc_helper", "(", "lhs", ",", "rhs", ",", "fn_array", ",", "fn_scalar", ",", "lfn_scalar", ",", "rfn_scalar", "=", "None", ")", ":", "if", "isinstance", "(", "lhs", ",", "numeric_types", ")", ":", "if", "isinstance", "(", "rhs", ",", "numeric_...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
add
Returns element-wise sum of the input arrays with broadcasting. Equivalent to ``lhs + rhs``, ``mx.nd.broadcast_add(lhs, rhs)`` and ``mx.nd.broadcast_plus(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are br...
python/mxnet/ndarray/ndarray.py
def add(lhs, rhs): """Returns element-wise sum of the input arrays with broadcasting. Equivalent to ``lhs + rhs``, ``mx.nd.broadcast_add(lhs, rhs)`` and ``mx.nd.broadcast_plus(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, ...
def add(lhs, rhs): """Returns element-wise sum of the input arrays with broadcasting. Equivalent to ``lhs + rhs``, ``mx.nd.broadcast_add(lhs, rhs)`` and ``mx.nd.broadcast_plus(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, ...
[ "Returns", "element", "-", "wise", "sum", "of", "the", "input", "arrays", "with", "broadcasting", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L2663-L2721
[ "def", "add", "(", "lhs", ",", "rhs", ")", ":", "# pylint: disable= no-member, protected-access", "return", "_ufunc_helper", "(", "lhs", ",", "rhs", ",", "op", ".", "broadcast_add", ",", "operator", ".", "add", ",", "_internal", ".", "_plus_scalar", ",", "None...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
subtract
Returns element-wise difference of the input arrays with broadcasting. Equivalent to ``lhs - rhs``, ``mx.nd.broadcast_sub(lhs, rhs)`` and ``mx.nd.broadcast_minus(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the array...
python/mxnet/ndarray/ndarray.py
def subtract(lhs, rhs): """Returns element-wise difference of the input arrays with broadcasting. Equivalent to ``lhs - rhs``, ``mx.nd.broadcast_sub(lhs, rhs)`` and ``mx.nd.broadcast_minus(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them ha...
def subtract(lhs, rhs): """Returns element-wise difference of the input arrays with broadcasting. Equivalent to ``lhs - rhs``, ``mx.nd.broadcast_sub(lhs, rhs)`` and ``mx.nd.broadcast_minus(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them ha...
[ "Returns", "element", "-", "wise", "difference", "of", "the", "input", "arrays", "with", "broadcasting", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L2725-L2783
[ "def", "subtract", "(", "lhs", ",", "rhs", ")", ":", "# pylint: disable= no-member, protected-access", "return", "_ufunc_helper", "(", "lhs", ",", "rhs", ",", "op", ".", "broadcast_sub", ",", "operator", ".", "sub", ",", "_internal", ".", "_minus_scalar", ",", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
multiply
Returns element-wise product of the input arrays with broadcasting. Equivalent to ``lhs * rhs`` and ``mx.nd.broadcast_mul(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are broadcastable to a common shape. ...
python/mxnet/ndarray/ndarray.py
def multiply(lhs, rhs): """Returns element-wise product of the input arrays with broadcasting. Equivalent to ``lhs * rhs`` and ``mx.nd.broadcast_mul(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are broadca...
def multiply(lhs, rhs): """Returns element-wise product of the input arrays with broadcasting. Equivalent to ``lhs * rhs`` and ``mx.nd.broadcast_mul(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are broadca...
[ "Returns", "element", "-", "wise", "product", "of", "the", "input", "arrays", "with", "broadcasting", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L2787-L2844
[ "def", "multiply", "(", "lhs", ",", "rhs", ")", ":", "# pylint: disable= no-member, protected-access", "return", "_ufunc_helper", "(", "lhs", ",", "rhs", ",", "op", ".", "broadcast_mul", ",", "operator", ".", "mul", ",", "_internal", ".", "_mul_scalar", ",", "...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
divide
Returns element-wise division of the input arrays with broadcasting. Equivalent to ``lhs / rhs`` and ``mx.nd.broadcast_div(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are broadcastable to a common shape. ...
python/mxnet/ndarray/ndarray.py
def divide(lhs, rhs): """Returns element-wise division of the input arrays with broadcasting. Equivalent to ``lhs / rhs`` and ``mx.nd.broadcast_div(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are broadcas...
def divide(lhs, rhs): """Returns element-wise division of the input arrays with broadcasting. Equivalent to ``lhs / rhs`` and ``mx.nd.broadcast_div(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are broadcas...
[ "Returns", "element", "-", "wise", "division", "of", "the", "input", "arrays", "with", "broadcasting", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L2848-L2901
[ "def", "divide", "(", "lhs", ",", "rhs", ")", ":", "# pylint: disable= no-member, protected-access", "return", "_ufunc_helper", "(", "lhs", ",", "rhs", ",", "op", ".", "broadcast_div", ",", "operator", ".", "truediv", ",", "_internal", ".", "_div_scalar", ",", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
modulo
Returns element-wise modulo of the input arrays with broadcasting. Equivalent to ``lhs % rhs`` and ``mx.nd.broadcast_mod(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are broadcastable to a common shape. P...
python/mxnet/ndarray/ndarray.py
def modulo(lhs, rhs): """Returns element-wise modulo of the input arrays with broadcasting. Equivalent to ``lhs % rhs`` and ``mx.nd.broadcast_mod(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are broadcasta...
def modulo(lhs, rhs): """Returns element-wise modulo of the input arrays with broadcasting. Equivalent to ``lhs % rhs`` and ``mx.nd.broadcast_mod(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are broadcasta...
[ "Returns", "element", "-", "wise", "modulo", "of", "the", "input", "arrays", "with", "broadcasting", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L2905-L2958
[ "def", "modulo", "(", "lhs", ",", "rhs", ")", ":", "# pylint: disable= no-member, protected-access", "return", "_ufunc_helper", "(", "lhs", ",", "rhs", ",", "op", ".", "broadcast_mod", ",", "operator", ".", "mod", ",", "_internal", ".", "_mod_scalar", ",", "_i...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
power
Returns result of first array elements raised to powers from second array, element-wise with broadcasting. Equivalent to ``base ** exp`` and ``mx.nd.broadcast_power(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the ar...
python/mxnet/ndarray/ndarray.py
def power(base, exp): """Returns result of first array elements raised to powers from second array, element-wise with broadcasting. Equivalent to ``base ** exp`` and ``mx.nd.broadcast_power(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them h...
def power(base, exp): """Returns result of first array elements raised to powers from second array, element-wise with broadcasting. Equivalent to ``base ** exp`` and ``mx.nd.broadcast_power(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them h...
[ "Returns", "result", "of", "first", "array", "elements", "raised", "to", "powers", "from", "second", "array", "element", "-", "wise", "with", "broadcasting", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L2962-L3020
[ "def", "power", "(", "base", ",", "exp", ")", ":", "# pylint: disable= no-member, protected-access", "return", "_ufunc_helper", "(", "base", ",", "exp", ",", "op", ".", "broadcast_power", ",", "operator", ".", "pow", ",", "_internal", ".", "_power_scalar", ",", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
maximum
Returns element-wise maximum of the input arrays with broadcasting. Equivalent to ``mx.nd.broadcast_maximum(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are broadcastable to a common shape. Parameters ...
python/mxnet/ndarray/ndarray.py
def maximum(lhs, rhs): """Returns element-wise maximum of the input arrays with broadcasting. Equivalent to ``mx.nd.broadcast_maximum(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are broadcastable to a com...
def maximum(lhs, rhs): """Returns element-wise maximum of the input arrays with broadcasting. Equivalent to ``mx.nd.broadcast_maximum(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are broadcastable to a com...
[ "Returns", "element", "-", "wise", "maximum", "of", "the", "input", "arrays", "with", "broadcasting", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L3024-L3077
[ "def", "maximum", "(", "lhs", ",", "rhs", ")", ":", "# pylint: disable= no-member, protected-access", "return", "_ufunc_helper", "(", "lhs", ",", "rhs", ",", "op", ".", "broadcast_maximum", ",", "lambda", "x", ",", "y", ":", "x", "if", "x", ">", "y", "else...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
minimum
Returns element-wise minimum of the input arrays with broadcasting. Equivalent to ``mx.nd.broadcast_minimum(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are broadcastable to a common shape. Parameters ...
python/mxnet/ndarray/ndarray.py
def minimum(lhs, rhs): """Returns element-wise minimum of the input arrays with broadcasting. Equivalent to ``mx.nd.broadcast_minimum(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are broadcastable to a com...
def minimum(lhs, rhs): """Returns element-wise minimum of the input arrays with broadcasting. Equivalent to ``mx.nd.broadcast_minimum(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are broadcastable to a com...
[ "Returns", "element", "-", "wise", "minimum", "of", "the", "input", "arrays", "with", "broadcasting", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L3081-L3134
[ "def", "minimum", "(", "lhs", ",", "rhs", ")", ":", "# pylint: disable= no-member, protected-access", "return", "_ufunc_helper", "(", "lhs", ",", "rhs", ",", "op", ".", "broadcast_minimum", ",", "lambda", "x", ",", "y", ":", "x", "if", "x", "<", "y", "else...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
equal
Returns the result of element-wise **equal to** (==) comparison operation with broadcasting. For each element in input arrays, return 1(true) if corresponding elements are same, otherwise return 0(false). Equivalent to ``lhs == rhs`` and ``mx.nd.broadcast_equal(lhs, rhs)``. .. note:: If t...
python/mxnet/ndarray/ndarray.py
def equal(lhs, rhs): """Returns the result of element-wise **equal to** (==) comparison operation with broadcasting. For each element in input arrays, return 1(true) if corresponding elements are same, otherwise return 0(false). Equivalent to ``lhs == rhs`` and ``mx.nd.broadcast_equal(lhs, rhs)``....
def equal(lhs, rhs): """Returns the result of element-wise **equal to** (==) comparison operation with broadcasting. For each element in input arrays, return 1(true) if corresponding elements are same, otherwise return 0(false). Equivalent to ``lhs == rhs`` and ``mx.nd.broadcast_equal(lhs, rhs)``....
[ "Returns", "the", "result", "of", "element", "-", "wise", "**", "equal", "to", "**", "(", "==", ")", "comparison", "operation", "with", "broadcasting", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L3138-L3198
[ "def", "equal", "(", "lhs", ",", "rhs", ")", ":", "# pylint: disable= no-member, protected-access", "return", "_ufunc_helper", "(", "lhs", ",", "rhs", ",", "op", ".", "broadcast_equal", ",", "lambda", "x", ",", "y", ":", "1", "if", "x", "==", "y", "else", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
not_equal
Returns the result of element-wise **not equal to** (!=) comparison operation with broadcasting. For each element in input arrays, return 1(true) if corresponding elements are different, otherwise return 0(false). Equivalent to ``lhs != rhs`` and ``mx.nd.broadcast_not_equal(lhs, rhs)``. .. note::...
python/mxnet/ndarray/ndarray.py
def not_equal(lhs, rhs): """Returns the result of element-wise **not equal to** (!=) comparison operation with broadcasting. For each element in input arrays, return 1(true) if corresponding elements are different, otherwise return 0(false). Equivalent to ``lhs != rhs`` and ``mx.nd.broadcast_not_e...
def not_equal(lhs, rhs): """Returns the result of element-wise **not equal to** (!=) comparison operation with broadcasting. For each element in input arrays, return 1(true) if corresponding elements are different, otherwise return 0(false). Equivalent to ``lhs != rhs`` and ``mx.nd.broadcast_not_e...
[ "Returns", "the", "result", "of", "element", "-", "wise", "**", "not", "equal", "to", "**", "(", "!", "=", ")", "comparison", "operation", "with", "broadcasting", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L3202-L3265
[ "def", "not_equal", "(", "lhs", ",", "rhs", ")", ":", "# pylint: disable= no-member, protected-access", "return", "_ufunc_helper", "(", "lhs", ",", "rhs", ",", "op", ".", "broadcast_not_equal", ",", "lambda", "x", ",", "y", ":", "1", "if", "x", "!=", "y", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
greater
Returns the result of element-wise **greater than** (>) comparison operation with broadcasting. For each element in input arrays, return 1(true) if lhs elements are greater than rhs, otherwise return 0(false). Equivalent to ``lhs > rhs`` and ``mx.nd.broadcast_greater(lhs, rhs)``. .. note:: ...
python/mxnet/ndarray/ndarray.py
def greater(lhs, rhs): """Returns the result of element-wise **greater than** (>) comparison operation with broadcasting. For each element in input arrays, return 1(true) if lhs elements are greater than rhs, otherwise return 0(false). Equivalent to ``lhs > rhs`` and ``mx.nd.broadcast_greater(lhs,...
def greater(lhs, rhs): """Returns the result of element-wise **greater than** (>) comparison operation with broadcasting. For each element in input arrays, return 1(true) if lhs elements are greater than rhs, otherwise return 0(false). Equivalent to ``lhs > rhs`` and ``mx.nd.broadcast_greater(lhs,...
[ "Returns", "the", "result", "of", "element", "-", "wise", "**", "greater", "than", "**", "(", ">", ")", "comparison", "operation", "with", "broadcasting", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L3269-L3329
[ "def", "greater", "(", "lhs", ",", "rhs", ")", ":", "# pylint: disable= no-member, protected-access", "return", "_ufunc_helper", "(", "lhs", ",", "rhs", ",", "op", ".", "broadcast_greater", ",", "lambda", "x", ",", "y", ":", "1", "if", "x", ">", "y", "else...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
greater_equal
Returns the result of element-wise **greater than or equal to** (>=) comparison operation with broadcasting. For each element in input arrays, return 1(true) if lhs elements are greater than equal to rhs, otherwise return 0(false). Equivalent to ``lhs >= rhs`` and ``mx.nd.broadcast_greater_equal(lhs, ...
python/mxnet/ndarray/ndarray.py
def greater_equal(lhs, rhs): """Returns the result of element-wise **greater than or equal to** (>=) comparison operation with broadcasting. For each element in input arrays, return 1(true) if lhs elements are greater than equal to rhs, otherwise return 0(false). Equivalent to ``lhs >= rhs`` and `...
def greater_equal(lhs, rhs): """Returns the result of element-wise **greater than or equal to** (>=) comparison operation with broadcasting. For each element in input arrays, return 1(true) if lhs elements are greater than equal to rhs, otherwise return 0(false). Equivalent to ``lhs >= rhs`` and `...
[ "Returns", "the", "result", "of", "element", "-", "wise", "**", "greater", "than", "or", "equal", "to", "**", "(", ">", "=", ")", "comparison", "operation", "with", "broadcasting", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L3333-L3393
[ "def", "greater_equal", "(", "lhs", ",", "rhs", ")", ":", "# pylint: disable= no-member, protected-access", "return", "_ufunc_helper", "(", "lhs", ",", "rhs", ",", "op", ".", "broadcast_greater_equal", ",", "lambda", "x", ",", "y", ":", "1", "if", "x", ">=", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
lesser
Returns the result of element-wise **lesser than** (<) comparison operation with broadcasting. For each element in input arrays, return 1(true) if lhs elements are less than rhs, otherwise return 0(false). Equivalent to ``lhs < rhs`` and ``mx.nd.broadcast_lesser(lhs, rhs)``. .. note:: If ...
python/mxnet/ndarray/ndarray.py
def lesser(lhs, rhs): """Returns the result of element-wise **lesser than** (<) comparison operation with broadcasting. For each element in input arrays, return 1(true) if lhs elements are less than rhs, otherwise return 0(false). Equivalent to ``lhs < rhs`` and ``mx.nd.broadcast_lesser(lhs, rhs)`...
def lesser(lhs, rhs): """Returns the result of element-wise **lesser than** (<) comparison operation with broadcasting. For each element in input arrays, return 1(true) if lhs elements are less than rhs, otherwise return 0(false). Equivalent to ``lhs < rhs`` and ``mx.nd.broadcast_lesser(lhs, rhs)`...
[ "Returns", "the", "result", "of", "element", "-", "wise", "**", "lesser", "than", "**", "(", "<", ")", "comparison", "operation", "with", "broadcasting", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L3397-L3457
[ "def", "lesser", "(", "lhs", ",", "rhs", ")", ":", "# pylint: disable= no-member, protected-access", "return", "_ufunc_helper", "(", "lhs", ",", "rhs", ",", "op", ".", "broadcast_lesser", ",", "lambda", "x", ",", "y", ":", "1", "if", "x", "<", "y", "else",...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
lesser_equal
Returns the result of element-wise **lesser than or equal to** (<=) comparison operation with broadcasting. For each element in input arrays, return 1(true) if lhs elements are lesser than equal to rhs, otherwise return 0(false). Equivalent to ``lhs <= rhs`` and ``mx.nd.broadcast_lesser_equal(lhs, rhs...
python/mxnet/ndarray/ndarray.py
def lesser_equal(lhs, rhs): """Returns the result of element-wise **lesser than or equal to** (<=) comparison operation with broadcasting. For each element in input arrays, return 1(true) if lhs elements are lesser than equal to rhs, otherwise return 0(false). Equivalent to ``lhs <= rhs`` and ``mx...
def lesser_equal(lhs, rhs): """Returns the result of element-wise **lesser than or equal to** (<=) comparison operation with broadcasting. For each element in input arrays, return 1(true) if lhs elements are lesser than equal to rhs, otherwise return 0(false). Equivalent to ``lhs <= rhs`` and ``mx...
[ "Returns", "the", "result", "of", "element", "-", "wise", "**", "lesser", "than", "or", "equal", "to", "**", "(", "<", "=", ")", "comparison", "operation", "with", "broadcasting", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L3461-L3521
[ "def", "lesser_equal", "(", "lhs", ",", "rhs", ")", ":", "# pylint: disable= no-member, protected-access", "return", "_ufunc_helper", "(", "lhs", ",", "rhs", ",", "op", ".", "broadcast_lesser_equal", ",", "lambda", "x", ",", "y", ":", "1", "if", "x", "<=", "...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
logical_and
Returns the result of element-wise **logical and** comparison operation with broadcasting. For each element in input arrays, return 1(true) if lhs elements and rhs elements are true, otherwise return 0(false). Equivalent to ``lhs and rhs`` and ``mx.nd.broadcast_logical_and(lhs, rhs)``. .. note:: ...
python/mxnet/ndarray/ndarray.py
def logical_and(lhs, rhs): """Returns the result of element-wise **logical and** comparison operation with broadcasting. For each element in input arrays, return 1(true) if lhs elements and rhs elements are true, otherwise return 0(false). Equivalent to ``lhs and rhs`` and ``mx.nd.broadcast_logica...
def logical_and(lhs, rhs): """Returns the result of element-wise **logical and** comparison operation with broadcasting. For each element in input arrays, return 1(true) if lhs elements and rhs elements are true, otherwise return 0(false). Equivalent to ``lhs and rhs`` and ``mx.nd.broadcast_logica...
[ "Returns", "the", "result", "of", "element", "-", "wise", "**", "logical", "and", "**", "comparison", "operation", "with", "broadcasting", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L3524-L3581
[ "def", "logical_and", "(", "lhs", ",", "rhs", ")", ":", "# pylint: disable= no-member, protected-access", "return", "_ufunc_helper", "(", "lhs", ",", "rhs", ",", "op", ".", "broadcast_logical_and", ",", "lambda", "x", ",", "y", ":", "1", "if", "x", "and", "y...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
logical_or
Returns the result of element-wise **logical or** comparison operation with broadcasting. For each element in input arrays, return 1(true) if lhs elements or rhs elements are true, otherwise return 0(false). Equivalent to ``lhs or rhs`` and ``mx.nd.broadcast_logical_or(lhs, rhs)``. .. note:: ...
python/mxnet/ndarray/ndarray.py
def logical_or(lhs, rhs): """Returns the result of element-wise **logical or** comparison operation with broadcasting. For each element in input arrays, return 1(true) if lhs elements or rhs elements are true, otherwise return 0(false). Equivalent to ``lhs or rhs`` and ``mx.nd.broadcast_logical_or...
def logical_or(lhs, rhs): """Returns the result of element-wise **logical or** comparison operation with broadcasting. For each element in input arrays, return 1(true) if lhs elements or rhs elements are true, otherwise return 0(false). Equivalent to ``lhs or rhs`` and ``mx.nd.broadcast_logical_or...
[ "Returns", "the", "result", "of", "element", "-", "wise", "**", "logical", "or", "**", "comparison", "operation", "with", "broadcasting", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L3584-L3641
[ "def", "logical_or", "(", "lhs", ",", "rhs", ")", ":", "# pylint: disable= no-member, protected-access", "return", "_ufunc_helper", "(", "lhs", ",", "rhs", ",", "op", ".", "broadcast_logical_or", ",", "lambda", "x", ",", "y", ":", "1", "if", "x", "or", "y", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
logical_xor
Returns the result of element-wise **logical xor** comparison operation with broadcasting. For each element in input arrays, return 1(true) if lhs elements or rhs elements are true, otherwise return 0(false). Equivalent to ``bool(lhs) ^ bool(rhs)`` and ``mx.nd.broadcast_logical_xor(lhs, rhs)``. ....
python/mxnet/ndarray/ndarray.py
def logical_xor(lhs, rhs): """Returns the result of element-wise **logical xor** comparison operation with broadcasting. For each element in input arrays, return 1(true) if lhs elements or rhs elements are true, otherwise return 0(false). Equivalent to ``bool(lhs) ^ bool(rhs)`` and ``mx.nd.broadca...
def logical_xor(lhs, rhs): """Returns the result of element-wise **logical xor** comparison operation with broadcasting. For each element in input arrays, return 1(true) if lhs elements or rhs elements are true, otherwise return 0(false). Equivalent to ``bool(lhs) ^ bool(rhs)`` and ``mx.nd.broadca...
[ "Returns", "the", "result", "of", "element", "-", "wise", "**", "logical", "xor", "**", "comparison", "operation", "with", "broadcasting", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L3644-L3695
[ "def", "logical_xor", "(", "lhs", ",", "rhs", ")", ":", "# pylint: disable= no-member, protected-access", "return", "_ufunc_helper", "(", "lhs", ",", "rhs", ",", "op", ".", "broadcast_logical_xor", ",", "lambda", "x", ",", "y", ":", "1", "if", "bool", "(", "...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
concatenate
DEPRECATED, use ``concat`` instead Parameters ---------- arrays : list of `NDArray` Arrays to be concatenate. They must have identical shape except the first dimension. They also must have the same data type. axis : int The axis along which to concatenate. always_copy : bool...
python/mxnet/ndarray/ndarray.py
def concatenate(arrays, axis=0, always_copy=True): """DEPRECATED, use ``concat`` instead Parameters ---------- arrays : list of `NDArray` Arrays to be concatenate. They must have identical shape except the first dimension. They also must have the same data type. axis : int T...
def concatenate(arrays, axis=0, always_copy=True): """DEPRECATED, use ``concat`` instead Parameters ---------- arrays : list of `NDArray` Arrays to be concatenate. They must have identical shape except the first dimension. They also must have the same data type. axis : int T...
[ "DEPRECATED", "use", "concat", "instead" ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L3705-L3759
[ "def", "concatenate", "(", "arrays", ",", "axis", "=", "0", ",", "always_copy", "=", "True", ")", ":", "assert", "isinstance", "(", "arrays", ",", "list", ")", "assert", "len", "(", "arrays", ")", ">", "0", "assert", "isinstance", "(", "arrays", "[", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
imdecode
DEPRECATED, use mx.img instead Parameters ---------- str_img : str Binary image data clip_rect : iterable of 4 int Clip decoded image to rectangle (x0, y0, x1, y1). out : NDArray Output buffer. Can be 3 dimensional (c, h, w) or 4 dimensional (n, c, h, w). index : int ...
python/mxnet/ndarray/ndarray.py
def imdecode(str_img, clip_rect=(0, 0, 0, 0), out=None, index=0, channels=3, mean=None): """DEPRECATED, use mx.img instead Parameters ---------- str_img : str Binary image data clip_rect : iterable of 4 int Clip decoded image to rectangle (x0, y0, x1, y1). out : NDArray ...
def imdecode(str_img, clip_rect=(0, 0, 0, 0), out=None, index=0, channels=3, mean=None): """DEPRECATED, use mx.img instead Parameters ---------- str_img : str Binary image data clip_rect : iterable of 4 int Clip decoded image to rectangle (x0, y0, x1, y1). out : NDArray ...
[ "DEPRECATED", "use", "mx", ".", "img", "instead" ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L3763-L3802
[ "def", "imdecode", "(", "str_img", ",", "clip_rect", "=", "(", "0", ",", "0", ",", "0", ",", "0", ")", ",", "out", "=", "None", ",", "index", "=", "0", ",", "channels", "=", "3", ",", "mean", "=", "None", ")", ":", "# pylint: disable= no-member, pr...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
zeros
Returns a new array filled with all zeros, with the given shape and type. Parameters ---------- shape : int or tuple of int The shape of the empty array. ctx : Context, optional An optional device context (default is the current default context). dtype : str or numpy.dtype, optional...
python/mxnet/ndarray/ndarray.py
def zeros(shape, ctx=None, dtype=None, **kwargs): """Returns a new array filled with all zeros, with the given shape and type. Parameters ---------- shape : int or tuple of int The shape of the empty array. ctx : Context, optional An optional device context (default is the current d...
def zeros(shape, ctx=None, dtype=None, **kwargs): """Returns a new array filled with all zeros, with the given shape and type. Parameters ---------- shape : int or tuple of int The shape of the empty array. ctx : Context, optional An optional device context (default is the current d...
[ "Returns", "a", "new", "array", "filled", "with", "all", "zeros", "with", "the", "given", "shape", "and", "type", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L3805-L3838
[ "def", "zeros", "(", "shape", ",", "ctx", "=", "None", ",", "dtype", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable= unused-argument", "if", "ctx", "is", "None", ":", "ctx", "=", "current_context", "(", ")", "dtype", "=", "mx_real_t",...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
eye
Return a 2-D array 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) refers to the main diag...
python/mxnet/ndarray/ndarray.py
def eye(N, M=0, k=0, ctx=None, dtype=None, **kwargs): """Return a 2-D array 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 I...
def eye(N, M=0, k=0, ctx=None, dtype=None, **kwargs): """Return a 2-D array 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 I...
[ "Return", "a", "2", "-", "D", "array", "with", "ones", "on", "the", "diagonal", "and", "zeros", "elsewhere", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L3841-L3880
[ "def", "eye", "(", "N", ",", "M", "=", "0", ",", "k", "=", "0", ",", "ctx", "=", "None", ",", "dtype", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable= unused-argument", "if", "ctx", "is", "None", ":", "ctx", "=", "current_contex...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
empty
Returns a new array of given shape and type, without initializing entries. Parameters ---------- shape : int or tuple of int The shape of the empty array. ctx : Context, optional An optional device context (default is the current default context). dtype : str or numpy.dtype, optiona...
python/mxnet/ndarray/ndarray.py
def empty(shape, ctx=None, dtype=None): """Returns a new array of given shape and type, without initializing entries. Parameters ---------- shape : int or tuple of int The shape of the empty array. ctx : Context, optional An optional device context (default is the current default co...
def empty(shape, ctx=None, dtype=None): """Returns a new array of given shape and type, without initializing entries. Parameters ---------- shape : int or tuple of int The shape of the empty array. ctx : Context, optional An optional device context (default is the current default co...
[ "Returns", "a", "new", "array", "of", "given", "shape", "and", "type", "without", "initializing", "entries", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L3884-L3908
[ "def", "empty", "(", "shape", ",", "ctx", "=", "None", ",", "dtype", "=", "None", ")", ":", "if", "isinstance", "(", "shape", ",", "int", ")", ":", "shape", "=", "(", "shape", ",", ")", "if", "ctx", "is", "None", ":", "ctx", "=", "current_context...
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/ndarray/ndarray.py
def histogram(a, bins=10, range=None): """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 ...
def histogram(a, bins=10, range=None): """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 ...
[ "Compute", "the", "histogram", "of", "the", "input", "data", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L3912-L3946
[ "def", "histogram", "(", "a", ",", "bins", "=", "10", ",", "range", "=", "None", ")", ":", "# pylint: disable= no-member, protected-access", "if", "isinstance", "(", "bins", ",", "NDArray", ")", ":", "return", "_internal", ".", "_histogram", "(", "data", "="...
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/ndarray/ndarray.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/ndarray/ndarray.py#L3949-L3992
[ "def", "split_v2", "(", "ary", ",", "indices_or_sections", ",", "axis", "=", "0", ",", "squeeze_axis", "=", "False", ")", ":", "indices", "=", "[", "]", "axis_size", "=", "ary", ".", "shape", "[", "axis", "]", "if", "isinstance", "(", "indices_or_section...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
to_dlpack_for_read
Returns a reference view of NDArray that represents as DLManagedTensor until all previous write operations on the current array are finished. Parameters ---------- data: NDArray input data. Returns ------- PyCapsule (the pointer of DLManagedTensor) a reference view of ND...
python/mxnet/ndarray/ndarray.py
def to_dlpack_for_read(data): """Returns a reference view of NDArray that represents as DLManagedTensor until all previous write operations on the current array are finished. Parameters ---------- data: NDArray input data. Returns ------- PyCapsule (the pointer of DLManagedT...
def to_dlpack_for_read(data): """Returns a reference view of NDArray that represents as DLManagedTensor until all previous write operations on the current array are finished. Parameters ---------- data: NDArray input data. Returns ------- PyCapsule (the pointer of DLManagedT...
[ "Returns", "a", "reference", "view", "of", "NDArray", "that", "represents", "as", "DLManagedTensor", "until", "all", "previous", "write", "operations", "on", "the", "current", "array", "are", "finished", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L4007-L4036
[ "def", "to_dlpack_for_read", "(", "data", ")", ":", "data", ".", "wait_to_read", "(", ")", "dlpack", "=", "DLPackHandle", "(", ")", "check_call", "(", "_LIB", ".", "MXNDArrayToDLPack", "(", "data", ".", "handle", ",", "ctypes", ".", "byref", "(", "dlpack",...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
to_dlpack_for_write
Returns a reference view of NDArray that represents as DLManagedTensor until all previous read/write operations on the current array are finished. Parameters ---------- data: NDArray input data. Returns ------- PyCapsule (the pointer of DLManagedTensor) a reference view ...
python/mxnet/ndarray/ndarray.py
def to_dlpack_for_write(data): """Returns a reference view of NDArray that represents as DLManagedTensor until all previous read/write operations on the current array are finished. Parameters ---------- data: NDArray input data. Returns ------- PyCapsule (the pointer of DLMa...
def to_dlpack_for_write(data): """Returns a reference view of NDArray that represents as DLManagedTensor until all previous read/write operations on the current array are finished. Parameters ---------- data: NDArray input data. Returns ------- PyCapsule (the pointer of DLMa...
[ "Returns", "a", "reference", "view", "of", "NDArray", "that", "represents", "as", "DLManagedTensor", "until", "all", "previous", "read", "/", "write", "operations", "on", "the", "current", "array", "are", "finished", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L4038-L4068
[ "def", "to_dlpack_for_write", "(", "data", ")", ":", "check_call", "(", "_LIB", ".", "MXNDArrayWaitToWrite", "(", "data", ".", "handle", ")", ")", "dlpack", "=", "DLPackHandle", "(", ")", "check_call", "(", "_LIB", ".", "MXNDArrayToDLPack", "(", "data", ".",...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
from_dlpack
Returns a NDArray backed by a dlpack tensor. Parameters ---------- dlpack: PyCapsule (the pointer of DLManagedTensor) input data Returns ------- NDArray a NDArray backed by a dlpack tensor Examples -------- >>> x = mx.nd.ones((2,3)) >>> y = mx.nd.to_dlpack_for_...
python/mxnet/ndarray/ndarray.py
def from_dlpack(dlpack): """Returns a NDArray backed by a dlpack tensor. Parameters ---------- dlpack: PyCapsule (the pointer of DLManagedTensor) input data Returns ------- NDArray a NDArray backed by a dlpack tensor Examples -------- >>> x = mx.nd.ones((2,3)) ...
def from_dlpack(dlpack): """Returns a NDArray backed by a dlpack tensor. Parameters ---------- dlpack: PyCapsule (the pointer of DLManagedTensor) input data Returns ------- NDArray a NDArray backed by a dlpack tensor Examples -------- >>> x = mx.nd.ones((2,3)) ...
[ "Returns", "a", "NDArray", "backed", "by", "a", "dlpack", "tensor", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L4070-L4117
[ "def", "from_dlpack", "(", "dlpack", ")", ":", "handle", "=", "NDArrayHandle", "(", ")", "dlpack", "=", "ctypes", ".", "py_object", "(", "dlpack", ")", "assert", "ctypes", ".", "pythonapi", ".", "PyCapsule_IsValid", "(", "dlpack", ",", "_c_str_dltensor", ")"...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
from_numpy
Returns an MXNet's NDArray backed by Numpy's ndarray. Parameters ---------- ndarray: numpy.ndarray input data zero_copy: bool Whether we use DLPack's zero-copy conversion to convert to MXNet's NDArray. This is only available for c-contiguous arrays, i.e. array.flags[C_CONTIGUOU...
python/mxnet/ndarray/ndarray.py
def from_numpy(ndarray, zero_copy=True): """Returns an MXNet's NDArray backed by Numpy's ndarray. Parameters ---------- ndarray: numpy.ndarray input data zero_copy: bool Whether we use DLPack's zero-copy conversion to convert to MXNet's NDArray. This is only available for c...
def from_numpy(ndarray, zero_copy=True): """Returns an MXNet's NDArray backed by Numpy's ndarray. Parameters ---------- ndarray: numpy.ndarray input data zero_copy: bool Whether we use DLPack's zero-copy conversion to convert to MXNet's NDArray. This is only available for c...
[ "Returns", "an", "MXNet", "s", "NDArray", "backed", "by", "Numpy", "s", "ndarray", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L4167-L4222
[ "def", "from_numpy", "(", "ndarray", ",", "zero_copy", "=", "True", ")", ":", "def", "_make_manager_ctx", "(", "obj", ")", ":", "pyobj", "=", "ctypes", ".", "py_object", "(", "obj", ")", "void_p", "=", "ctypes", ".", "c_void_p", ".", "from_buffer", "(", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
NDArray._get_index_nd
Returns an index array for use in scatter_nd and gather_nd.
python/mxnet/ndarray/ndarray.py
def _get_index_nd(self, key): """Returns an index array for use in scatter_nd and gather_nd.""" def _is_advanced_index(index): """The definition of advanced index here includes integers as well, while integers are considered as basic index type when the key contains only ...
def _get_index_nd(self, key): """Returns an index array for use in scatter_nd and gather_nd.""" def _is_advanced_index(index): """The definition of advanced index here includes integers as well, while integers are considered as basic index type when the key contains only ...
[ "Returns", "an", "index", "array", "for", "use", "in", "scatter_nd", "and", "gather_nd", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L518-L662
[ "def", "_get_index_nd", "(", "self", ",", "key", ")", ":", "def", "_is_advanced_index", "(", "index", ")", ":", "\"\"\"The definition of advanced index here includes integers as well, while\n integers are considered as basic index type when the key contains only\n s...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
NDArray._prepare_value_nd
Given value and vshape, create an `NDArray` from value with the same context and dtype as the current one and broadcast it to vshape.
python/mxnet/ndarray/ndarray.py
def _prepare_value_nd(self, value, vshape): """Given value and vshape, create an `NDArray` from value with the same context and dtype as the current one and broadcast it to vshape.""" if isinstance(value, numeric_types): value_nd = full(shape=vshape, val=value, ctx=self.context, dtyp...
def _prepare_value_nd(self, value, vshape): """Given value and vshape, create an `NDArray` from value with the same context and dtype as the current one and broadcast it to vshape.""" if isinstance(value, numeric_types): value_nd = full(shape=vshape, val=value, ctx=self.context, dtyp...
[ "Given", "value", "and", "vshape", "create", "an", "NDArray", "from", "value", "with", "the", "same", "context", "and", "dtype", "as", "the", "current", "one", "and", "broadcast", "it", "to", "vshape", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L664-L681
[ "def", "_prepare_value_nd", "(", "self", ",", "value", ",", "vshape", ")", ":", "if", "isinstance", "(", "value", ",", "numeric_types", ")", ":", "value_nd", "=", "full", "(", "shape", "=", "vshape", ",", "val", "=", "value", ",", "ctx", "=", "self", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
NDArray._set_nd_basic_indexing
This function is called by __setitem__ when key is a basic index, i.e. an integer, or a slice, or a tuple of integers and slices. No restrictions on the values of slices' steps.
python/mxnet/ndarray/ndarray.py
def _set_nd_basic_indexing(self, key, value): """This function is called by __setitem__ when key is a basic index, i.e. an integer, or a slice, or a tuple of integers and slices. No restrictions on the values of slices' steps.""" shape = self.shape if isinstance(key, integer_type...
def _set_nd_basic_indexing(self, key, value): """This function is called by __setitem__ when key is a basic index, i.e. an integer, or a slice, or a tuple of integers and slices. No restrictions on the values of slices' steps.""" shape = self.shape if isinstance(key, integer_type...
[ "This", "function", "is", "called", "by", "__setitem__", "when", "key", "is", "a", "basic", "index", "i", ".", "e", ".", "an", "integer", "or", "a", "slice", "or", "a", "tuple", "of", "integers", "and", "slices", ".", "No", "restrictions", "on", "the",...
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L683-L765
[ "def", "_set_nd_basic_indexing", "(", "self", ",", "key", ",", "value", ")", ":", "shape", "=", "self", ".", "shape", "if", "isinstance", "(", "key", ",", "integer_types", ")", ":", "if", "key", "<", "0", ":", "key", "+=", "shape", "[", "0", "]", "...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
NDArray._set_nd_advanced_indexing
This function is called by __setitem__ when key is an advanced index.
python/mxnet/ndarray/ndarray.py
def _set_nd_advanced_indexing(self, key, value): """This function is called by __setitem__ when key is an advanced index.""" indices = self._get_index_nd(key) vshape = _get_oshape_of_gather_nd_op(self.shape, indices.shape) value_nd = self._prepare_value_nd(value, vshape) _interna...
def _set_nd_advanced_indexing(self, key, value): """This function is called by __setitem__ when key is an advanced index.""" indices = self._get_index_nd(key) vshape = _get_oshape_of_gather_nd_op(self.shape, indices.shape) value_nd = self._prepare_value_nd(value, vshape) _interna...
[ "This", "function", "is", "called", "by", "__setitem__", "when", "key", "is", "an", "advanced", "index", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L767-L773
[ "def", "_set_nd_advanced_indexing", "(", "self", ",", "key", ",", "value", ")", ":", "indices", "=", "self", ".", "_get_index_nd", "(", "key", ")", "vshape", "=", "_get_oshape_of_gather_nd_op", "(", "self", ".", "shape", ",", "indices", ".", "shape", ")", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
NDArray._get_nd_basic_indexing
This function is called when key is a slice, or an integer, or a tuple of slices or integers
python/mxnet/ndarray/ndarray.py
def _get_nd_basic_indexing(self, key): """This function is called when key is a slice, or an integer, or a tuple of slices or integers""" shape = self.shape if isinstance(key, integer_types): if key > shape[0] - 1: raise IndexError( 'index ...
def _get_nd_basic_indexing(self, key): """This function is called when key is a slice, or an integer, or a tuple of slices or integers""" shape = self.shape if isinstance(key, integer_types): if key > shape[0] - 1: raise IndexError( 'index ...
[ "This", "function", "is", "called", "when", "key", "is", "a", "slice", "or", "an", "integer", "or", "a", "tuple", "of", "slices", "or", "integers" ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L775-L838
[ "def", "_get_nd_basic_indexing", "(", "self", ",", "key", ")", ":", "shape", "=", "self", ".", "shape", "if", "isinstance", "(", "key", ",", "integer_types", ")", ":", "if", "key", ">", "shape", "[", "0", "]", "-", "1", ":", "raise", "IndexError", "(...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
NDArray._sync_copyfrom
Performs a synchronized copy from the `source_array` to the current array. This is called through ``x[:] = source_array``, where the `source_array` is a `numpy.ndarray` or array-like object. This function blocks until all the pending read/write operations with respect to the current `NDA...
python/mxnet/ndarray/ndarray.py
def _sync_copyfrom(self, source_array): """Performs a synchronized copy from the `source_array` to the current array. This is called through ``x[:] = source_array``, where the `source_array` is a `numpy.ndarray` or array-like object. This function blocks until all the pending read/write ...
def _sync_copyfrom(self, source_array): """Performs a synchronized copy from the `source_array` to the current array. This is called through ``x[:] = source_array``, where the `source_array` is a `numpy.ndarray` or array-like object. This function blocks until all the pending read/write ...
[ "Performs", "a", "synchronized", "copy", "from", "the", "source_array", "to", "the", "current", "array", ".", "This", "is", "called", "through", "x", "[", ":", "]", "=", "source_array", "where", "the", "source_array", "is", "a", "numpy", ".", "ndarray", "o...
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L845-L880
[ "def", "_sync_copyfrom", "(", "self", ",", "source_array", ")", ":", "if", "not", "isinstance", "(", "source_array", ",", "np", ".", "ndarray", ")", ":", "try", ":", "source_array", "=", "np", ".", "array", "(", "source_array", ",", "dtype", "=", "self",...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
NDArray._slice
Returns a sliced NDArray that shares memory with the current one. This is called through ``x[start:stop]``. Parameters ---------- start : int Starting inclusive index of slice in the first dim. stop : int Finishing exclusive index of slice in the first di...
python/mxnet/ndarray/ndarray.py
def _slice(self, start, stop): """Returns a sliced NDArray that shares memory with the current one. This is called through ``x[start:stop]``. Parameters ---------- start : int Starting inclusive index of slice in the first dim. stop : int Finishin...
def _slice(self, start, stop): """Returns a sliced NDArray that shares memory with the current one. This is called through ``x[start:stop]``. Parameters ---------- start : int Starting inclusive index of slice in the first dim. stop : int Finishin...
[ "Returns", "a", "sliced", "NDArray", "that", "shares", "memory", "with", "the", "current", "one", ".", "This", "is", "called", "through", "x", "[", "start", ":", "stop", "]", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L882-L910
[ "def", "_slice", "(", "self", ",", "start", ",", "stop", ")", ":", "handle", "=", "NDArrayHandle", "(", ")", "start", ",", "stop", ",", "_", "=", "_get_index_range", "(", "start", ",", "stop", ",", "self", ".", "shape", "[", "0", "]", ")", "check_c...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
NDArray._at
Returns a view of the array sliced at `idx` in the first dim. This is called through ``x[idx]``. Parameters ---------- idx : int index for slicing the `NDArray` in the first dim. Returns ------- NDArray `NDArray` sharing the memory with t...
python/mxnet/ndarray/ndarray.py
def _at(self, idx): """Returns a view of the array sliced at `idx` in the first dim. This is called through ``x[idx]``. Parameters ---------- idx : int index for slicing the `NDArray` in the first dim. Returns ------- NDArray `NDA...
def _at(self, idx): """Returns a view of the array sliced at `idx` in the first dim. This is called through ``x[idx]``. Parameters ---------- idx : int index for slicing the `NDArray` in the first dim. Returns ------- NDArray `NDA...
[ "Returns", "a", "view", "of", "the", "array", "sliced", "at", "idx", "in", "the", "first", "dim", ".", "This", "is", "called", "through", "x", "[", "idx", "]", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L912-L944
[ "def", "_at", "(", "self", ",", "idx", ")", ":", "handle", "=", "NDArrayHandle", "(", ")", "if", "idx", "<", "0", ":", "length", "=", "self", ".", "shape", "[", "0", "]", "idx", "+=", "length", "if", "idx", "<", "0", ":", "raise", "IndexError", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
NDArray.reshape
Returns a **view** of this array with a new shape without altering any data. Parameters ---------- shape : tuple of int, or n ints The new shape should not change the array size, namely ``np.prod(new_shape)`` should be equal to ``np.prod(self.shape)``. Some d...
python/mxnet/ndarray/ndarray.py
def reshape(self, *shape, **kwargs): """Returns a **view** of this array with a new shape without altering any data. Parameters ---------- shape : tuple of int, or n ints The new shape should not change the array size, namely ``np.prod(new_shape)`` should be equa...
def reshape(self, *shape, **kwargs): """Returns a **view** of this array with a new shape without altering any data. Parameters ---------- shape : tuple of int, or n ints The new shape should not change the array size, namely ``np.prod(new_shape)`` should be equa...
[ "Returns", "a", "**", "view", "**", "of", "this", "array", "with", "a", "new", "shape", "without", "altering", "any", "data", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L946-L1067
[ "def", "reshape", "(", "self", ",", "*", "shape", ",", "*", "*", "kwargs", ")", ":", "if", "len", "(", "shape", ")", "==", "1", "and", "isinstance", "(", "shape", "[", "0", "]", ",", "(", "list", ",", "tuple", ")", ")", ":", "shape", "=", "sh...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
NDArray.broadcast_to
Broadcasts the input array to a new shape. Broadcasting is only allowed on axes with size 1. The new shape cannot change the number of dimensions. For example, you could broadcast from shape (2, 1) to (2, 3), but not from shape (2, 3) to (2, 3, 3). Parameters ----------...
python/mxnet/ndarray/ndarray.py
def broadcast_to(self, shape): """Broadcasts the input array to a new shape. Broadcasting is only allowed on axes with size 1. The new shape cannot change the number of dimensions. For example, you could broadcast from shape (2, 1) to (2, 3), but not from shape (2, 3) to (2, 3, ...
def broadcast_to(self, shape): """Broadcasts the input array to a new shape. Broadcasting is only allowed on axes with size 1. The new shape cannot change the number of dimensions. For example, you could broadcast from shape (2, 1) to (2, 3), but not from shape (2, 3) to (2, 3, ...
[ "Broadcasts", "the", "input", "array", "to", "a", "new", "shape", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L1710-L1759
[ "def", "broadcast_to", "(", "self", ",", "shape", ")", ":", "cur_shape", "=", "self", ".", "shape", "err_str", "=", "'operands could not be broadcast together with remapped shapes'", "'[original->remapped]: {} and requested shape {}'", ".", "format", "(", "cur_shape", ",", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
NDArray.shape
Tuple of array dimensions. Examples -------- >>> x = mx.nd.array([1, 2, 3, 4]) >>> x.shape (4L,) >>> y = mx.nd.zeros((2, 3, 4)) >>> y.shape (2L, 3L, 4L)
python/mxnet/ndarray/ndarray.py
def shape(self): """Tuple of array dimensions. Examples -------- >>> x = mx.nd.array([1, 2, 3, 4]) >>> x.shape (4L,) >>> y = mx.nd.zeros((2, 3, 4)) >>> y.shape (2L, 3L, 4L) """ ndim = mx_int() pdata = ctypes.POINTER(mx_int)...
def shape(self): """Tuple of array dimensions. Examples -------- >>> x = mx.nd.array([1, 2, 3, 4]) >>> x.shape (4L,) >>> y = mx.nd.zeros((2, 3, 4)) >>> y.shape (2L, 3L, 4L) """ ndim = mx_int() pdata = ctypes.POINTER(mx_int)...
[ "Tuple", "of", "array", "dimensions", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L1836-L1855
[ "def", "shape", "(", "self", ")", ":", "ndim", "=", "mx_int", "(", ")", "pdata", "=", "ctypes", ".", "POINTER", "(", "mx_int", ")", "(", ")", "check_call", "(", "_LIB", ".", "MXNDArrayGetShapeEx", "(", "self", ".", "handle", ",", "ctypes", ".", "byre...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
NDArray.context
Device context of the array. Examples -------- >>> x = mx.nd.array([1, 2, 3, 4]) >>> x.context cpu(0) >>> type(x.context) <class 'mxnet.context.Context'> >>> y = mx.nd.zeros((2,3), mx.gpu(0)) >>> y.context gpu(0)
python/mxnet/ndarray/ndarray.py
def context(self): """Device context of the array. Examples -------- >>> x = mx.nd.array([1, 2, 3, 4]) >>> x.context cpu(0) >>> type(x.context) <class 'mxnet.context.Context'> >>> y = mx.nd.zeros((2,3), mx.gpu(0)) >>> y.context gpu...
def context(self): """Device context of the array. Examples -------- >>> x = mx.nd.array([1, 2, 3, 4]) >>> x.context cpu(0) >>> type(x.context) <class 'mxnet.context.Context'> >>> y = mx.nd.zeros((2,3), mx.gpu(0)) >>> y.context gpu...
[ "Device", "context", "of", "the", "array", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L1879-L1897
[ "def", "context", "(", "self", ")", ":", "dev_typeid", "=", "ctypes", ".", "c_int", "(", ")", "dev_id", "=", "ctypes", ".", "c_int", "(", ")", "check_call", "(", "_LIB", ".", "MXNDArrayGetContext", "(", "self", ".", "handle", ",", "ctypes", ".", "byref...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
NDArray.dtype
Data-type of the array's elements. Returns ------- numpy.dtype This NDArray's data type. Examples -------- >>> x = mx.nd.zeros((2,3)) >>> x.dtype <type 'numpy.float32'> >>> y = mx.nd.zeros((2,3), dtype='int32') >>> y.dtype ...
python/mxnet/ndarray/ndarray.py
def dtype(self): """Data-type of the array's elements. Returns ------- numpy.dtype This NDArray's data type. Examples -------- >>> x = mx.nd.zeros((2,3)) >>> x.dtype <type 'numpy.float32'> >>> y = mx.nd.zeros((2,3), dtype='int...
def dtype(self): """Data-type of the array's elements. Returns ------- numpy.dtype This NDArray's data type. Examples -------- >>> x = mx.nd.zeros((2,3)) >>> x.dtype <type 'numpy.float32'> >>> y = mx.nd.zeros((2,3), dtype='int...
[ "Data", "-", "type", "of", "the", "array", "s", "elements", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L1900-L1920
[ "def", "dtype", "(", "self", ")", ":", "mx_dtype", "=", "ctypes", ".", "c_int", "(", ")", "check_call", "(", "_LIB", ".", "MXNDArrayGetDType", "(", "self", ".", "handle", ",", "ctypes", ".", "byref", "(", "mx_dtype", ")", ")", ")", "return", "_DTYPE_MX...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
NDArray._fresh_grad
Whether this array's corresponding gradient array (registered via `autograd.mark_variables`) has been updated by `autograd.backward` since last reset. `_fresh_grad` need to be manually set to False after consuming gradient (usually after updating this array).
python/mxnet/ndarray/ndarray.py
def _fresh_grad(self): """Whether this array's corresponding gradient array (registered via `autograd.mark_variables`) has been updated by `autograd.backward` since last reset. `_fresh_grad` need to be manually set to False after consuming gradient (usually after updating this ...
def _fresh_grad(self): """Whether this array's corresponding gradient array (registered via `autograd.mark_variables`) has been updated by `autograd.backward` since last reset. `_fresh_grad` need to be manually set to False after consuming gradient (usually after updating this ...
[ "Whether", "this", "array", "s", "corresponding", "gradient", "array", "(", "registered", "via", "autograd", ".", "mark_variables", ")", "has", "been", "updated", "by", "autograd", ".", "backward", "since", "last", "reset", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L1957-L1968
[ "def", "_fresh_grad", "(", "self", ")", ":", "out", "=", "ctypes", ".", "c_int", "(", ")", "check_call", "(", "_LIB", ".", "MXNDArrayGetGradState", "(", "self", ".", "handle", ",", "ctypes", ".", "byref", "(", "out", ")", ")", ")", "return", "out", "...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
NDArray.asnumpy
Returns a ``numpy.ndarray`` object with value copied from this array. Examples -------- >>> x = mx.nd.ones((2,3)) >>> y = x.asnumpy() >>> type(y) <type 'numpy.ndarray'> >>> y array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) ...
python/mxnet/ndarray/ndarray.py
def asnumpy(self): """Returns a ``numpy.ndarray`` object with value copied from this array. Examples -------- >>> x = mx.nd.ones((2,3)) >>> y = x.asnumpy() >>> type(y) <type 'numpy.ndarray'> >>> y array([[ 1., 1., 1.], [ 1., 1., ...
def asnumpy(self): """Returns a ``numpy.ndarray`` object with value copied from this array. Examples -------- >>> x = mx.nd.ones((2,3)) >>> y = x.asnumpy() >>> type(y) <type 'numpy.ndarray'> >>> y array([[ 1., 1., 1.], [ 1., 1., ...
[ "Returns", "a", "numpy", ".", "ndarray", "object", "with", "value", "copied", "from", "this", "array", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L1974-L1996
[ "def", "asnumpy", "(", "self", ")", ":", "data", "=", "np", ".", "empty", "(", "self", ".", "shape", ",", "dtype", "=", "self", ".", "dtype", ")", "check_call", "(", "_LIB", ".", "MXNDArraySyncCopyToCPU", "(", "self", ".", "handle", ",", "data", ".",...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
NDArray.astype
Returns a copy of the array after casting to a specified type. Parameters ---------- dtype : numpy.dtype or str The type of the returned array. copy : bool Default `True`. By default, astype always returns a newly allocated ndarray on the same context...
python/mxnet/ndarray/ndarray.py
def astype(self, dtype, copy=True): """Returns a copy of the array after casting to a specified type. Parameters ---------- dtype : numpy.dtype or str The type of the returned array. copy : bool Default `True`. By default, astype always returns a newly ...
def astype(self, dtype, copy=True): """Returns a copy of the array after casting to a specified type. Parameters ---------- dtype : numpy.dtype or str The type of the returned array. copy : bool Default `True`. By default, astype always returns a newly ...
[ "Returns", "a", "copy", "of", "the", "array", "after", "casting", "to", "a", "specified", "type", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L2015-L2048
[ "def", "astype", "(", "self", ",", "dtype", ",", "copy", "=", "True", ")", ":", "if", "not", "copy", "and", "np", ".", "dtype", "(", "dtype", ")", "==", "self", ".", "dtype", ":", "return", "self", "res", "=", "empty", "(", "self", ".", "shape", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
NDArray.copyto
Copies the value of this array to another array. If ``other`` is a ``NDArray`` object, then ``other.shape`` and ``self.shape`` should be the same. This function copies the value from ``self`` to ``other``. If ``other`` is a context, a new ``NDArray`` will be first created on th...
python/mxnet/ndarray/ndarray.py
def copyto(self, other): """Copies the value of this array to another array. If ``other`` is a ``NDArray`` object, then ``other.shape`` and ``self.shape`` should be the same. This function copies the value from ``self`` to ``other``. If ``other`` is a context, a new ``NDArray``...
def copyto(self, other): """Copies the value of this array to another array. If ``other`` is a ``NDArray`` object, then ``other.shape`` and ``self.shape`` should be the same. This function copies the value from ``self`` to ``other``. If ``other`` is a context, a new ``NDArray``...
[ "Copies", "the", "value", "of", "this", "array", "to", "another", "array", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L2050-L2094
[ "def", "copyto", "(", "self", ",", "other", ")", ":", "if", "isinstance", "(", "other", ",", "NDArray", ")", ":", "if", "other", ".", "handle", "is", "self", ".", "handle", ":", "warnings", ".", "warn", "(", "'You are attempting to copy an array to itself'",...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
NDArray.as_in_context
Returns an array on the target device with the same value as this array. If the target context is the same as ``self.context``, then ``self`` is returned. Otherwise, a copy is made. Parameters ---------- context : Context The target context. Returns ...
python/mxnet/ndarray/ndarray.py
def as_in_context(self, context): """Returns an array on the target device with the same value as this array. If the target context is the same as ``self.context``, then ``self`` is returned. Otherwise, a copy is made. Parameters ---------- context : Context ...
def as_in_context(self, context): """Returns an array on the target device with the same value as this array. If the target context is the same as ``self.context``, then ``self`` is returned. Otherwise, a copy is made. Parameters ---------- context : Context ...
[ "Returns", "an", "array", "on", "the", "target", "device", "with", "the", "same", "value", "as", "this", "array", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L2114-L2143
[ "def", "as_in_context", "(", "self", ",", "context", ")", ":", "if", "self", ".", "context", "==", "context", ":", "return", "self", "return", "self", ".", "copyto", "(", "context", ")" ]
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
NDArray.attach_grad
Attach a gradient buffer to this NDArray, so that `backward` can compute gradient with respect to it. Parameters ---------- grad_req : {'write', 'add', 'null'} How gradient will be accumulated. - 'write': gradient will be overwritten on every backward. ...
python/mxnet/ndarray/ndarray.py
def attach_grad(self, grad_req='write', stype=None): """Attach a gradient buffer to this NDArray, so that `backward` can compute gradient with respect to it. Parameters ---------- grad_req : {'write', 'add', 'null'} How gradient will be accumulated. - 'wr...
def attach_grad(self, grad_req='write', stype=None): """Attach a gradient buffer to this NDArray, so that `backward` can compute gradient with respect to it. Parameters ---------- grad_req : {'write', 'add', 'null'} How gradient will be accumulated. - 'wr...
[ "Attach", "a", "gradient", "buffer", "to", "this", "NDArray", "so", "that", "backward", "can", "compute", "gradient", "with", "respect", "to", "it", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L2145-L2168
[ "def", "attach_grad", "(", "self", ",", "grad_req", "=", "'write'", ",", "stype", "=", "None", ")", ":", "from", ".", "import", "zeros", "as", "_zeros", "if", "stype", "is", "not", "None", ":", "grad", "=", "_zeros", "(", "self", ".", "shape", ",", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
NDArray.grad
Returns gradient buffer attached to this NDArray.
python/mxnet/ndarray/ndarray.py
def grad(self): """Returns gradient buffer attached to this NDArray.""" from . import _ndarray_cls hdl = NDArrayHandle() check_call(_LIB.MXNDArrayGetGrad(self.handle, ctypes.byref(hdl))) if hdl.value is None: return None return _ndarray_cls(hdl)
def grad(self): """Returns gradient buffer attached to this NDArray.""" from . import _ndarray_cls hdl = NDArrayHandle() check_call(_LIB.MXNDArrayGetGrad(self.handle, ctypes.byref(hdl))) if hdl.value is None: return None return _ndarray_cls(hdl)
[ "Returns", "gradient", "buffer", "attached", "to", "this", "NDArray", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L2171-L2178
[ "def", "grad", "(", "self", ")", ":", "from", ".", "import", "_ndarray_cls", "hdl", "=", "NDArrayHandle", "(", ")", "check_call", "(", "_LIB", ".", "MXNDArrayGetGrad", "(", "self", ".", "handle", ",", "ctypes", ".", "byref", "(", "hdl", ")", ")", ")", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
NDArray.detach
Returns a new NDArray, detached from the current graph.
python/mxnet/ndarray/ndarray.py
def detach(self): """Returns a new NDArray, detached from the current graph.""" from . import _ndarray_cls hdl = NDArrayHandle() check_call(_LIB.MXNDArrayDetach(self.handle, ctypes.byref(hdl))) return _ndarray_cls(hdl)
def detach(self): """Returns a new NDArray, detached from the current graph.""" from . import _ndarray_cls hdl = NDArrayHandle() check_call(_LIB.MXNDArrayDetach(self.handle, ctypes.byref(hdl))) return _ndarray_cls(hdl)
[ "Returns", "a", "new", "NDArray", "detached", "from", "the", "current", "graph", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L2180-L2185
[ "def", "detach", "(", "self", ")", ":", "from", ".", "import", "_ndarray_cls", "hdl", "=", "NDArrayHandle", "(", ")", "check_call", "(", "_LIB", ".", "MXNDArrayDetach", "(", "self", ".", "handle", ",", "ctypes", ".", "byref", "(", "hdl", ")", ")", ")",...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
NDArray.backward
Compute the gradients of this NDArray w.r.t variables. Parameters ---------- out_grad : NDArray, optional Gradient with respect to head. retain_graph : bool, optional Whether to retain the computaion graph for another backward pass on the same graph. ...
python/mxnet/ndarray/ndarray.py
def backward(self, out_grad=None, retain_graph=False, train_mode=True): """Compute the gradients of this NDArray w.r.t variables. Parameters ---------- out_grad : NDArray, optional Gradient with respect to head. retain_graph : bool, optional Whether to re...
def backward(self, out_grad=None, retain_graph=False, train_mode=True): """Compute the gradients of this NDArray w.r.t variables. Parameters ---------- out_grad : NDArray, optional Gradient with respect to head. retain_graph : bool, optional Whether to re...
[ "Compute", "the", "gradients", "of", "this", "NDArray", "w", ".", "r", ".", "t", "variables", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/ndarray/ndarray.py#L2187-L2215
[ "def", "backward", "(", "self", ",", "out_grad", "=", "None", ",", "retain_graph", "=", "False", ",", "train_mode", "=", "True", ")", ":", "if", "out_grad", "is", "None", ":", "ograd_handles", "=", "[", "NDArrayHandle", "(", "0", ")", "]", "else", ":",...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
Align.build
Build the align array
example/gluon/lipnet/utils/align.py
def build(self, align_path): """ Build the align array """ file = open(align_path, 'r') lines = file.readlines() file.close() # words: list([op, ed, word]) words = [] for line in lines: _op, _ed, word = line.strip().split(' ') ...
def build(self, align_path): """ Build the align array """ file = open(align_path, 'r') lines = file.readlines() file.close() # words: list([op, ed, word]) words = [] for line in lines: _op, _ed, word = line.strip().split(' ') ...
[ "Build", "the", "align", "array" ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/gluon/lipnet/utils/align.py#L36-L52
[ "def", "build", "(", "self", ",", "align_path", ")", ":", "file", "=", "open", "(", "align_path", ",", "'r'", ")", "lines", "=", "file", ".", "readlines", "(", ")", "file", ".", "close", "(", ")", "# words: list([op, ed, word])", "words", "=", "[", "]"...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
Align.sentence
Get sentence
example/gluon/lipnet/utils/align.py
def sentence(self, padding=75): """ Get sentence """ vec = word_to_vector(self.sentence_str) vec += [-1] * (padding - self.sentence_length) return np.array(vec, dtype=np.int32)
def sentence(self, padding=75): """ Get sentence """ vec = word_to_vector(self.sentence_str) vec += [-1] * (padding - self.sentence_length) return np.array(vec, dtype=np.int32)
[ "Get", "sentence" ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/gluon/lipnet/utils/align.py#L54-L60
[ "def", "sentence", "(", "self", ",", "padding", "=", "75", ")", ":", "vec", "=", "word_to_vector", "(", "self", ".", "sentence_str", ")", "vec", "+=", "[", "-", "1", "]", "*", "(", "padding", "-", "self", ".", "sentence_length", ")", "return", "np", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
Align.word
Get words
example/gluon/lipnet/utils/align.py
def word(self, _id, padding=75): """ Get words """ word = self.words[_id][2] vec = word_to_vector(word) vec += [-1] * (padding - len(vec)) return np.array(vec, dtype=np.int32)
def word(self, _id, padding=75): """ Get words """ word = self.words[_id][2] vec = word_to_vector(word) vec += [-1] * (padding - len(vec)) return np.array(vec, dtype=np.int32)
[ "Get", "words" ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/gluon/lipnet/utils/align.py#L62-L69
[ "def", "word", "(", "self", ",", "_id", ",", "padding", "=", "75", ")", ":", "word", "=", "self", ".", "words", "[", "_id", "]", "[", "2", "]", "vec", "=", "word_to_vector", "(", "word", ")", "vec", "+=", "[", "-", "1", "]", "*", "(", "paddin...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
Align.word_frame_pos
Get the position of words
example/gluon/lipnet/utils/align.py
def word_frame_pos(self, _id): """ Get the position of words """ left = int(self.words[_id][0]/1000) right = max(left+1, int(self.words[_id][1]/1000)) return (left, right)
def word_frame_pos(self, _id): """ Get the position of words """ left = int(self.words[_id][0]/1000) right = max(left+1, int(self.words[_id][1]/1000)) return (left, right)
[ "Get", "the", "position", "of", "words" ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/gluon/lipnet/utils/align.py#L77-L83
[ "def", "word_frame_pos", "(", "self", ",", "_id", ")", ":", "left", "=", "int", "(", "self", ".", "words", "[", "_id", "]", "[", "0", "]", "/", "1000", ")", "right", "=", "max", "(", "left", "+", "1", ",", "int", "(", "self", ".", "words", "[...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
CustomModule.prepare_sparse_params
Prepares the module for processing a data batch by pulling row_sparse parameters from kvstore to all devices based on rowids. Parameters ---------- param_rowids : dict of str to NDArray of list of NDArrays
example/rnn/large_word_lm/custom_module.py
def prepare_sparse_params(self, param_rowids): '''Prepares the module for processing a data batch by pulling row_sparse parameters from kvstore to all devices based on rowids. Parameters ---------- param_rowids : dict of str to NDArray of list of NDArrays ''' if ...
def prepare_sparse_params(self, param_rowids): '''Prepares the module for processing a data batch by pulling row_sparse parameters from kvstore to all devices based on rowids. Parameters ---------- param_rowids : dict of str to NDArray of list of NDArrays ''' if ...
[ "Prepares", "the", "module", "for", "processing", "a", "data", "batch", "by", "pulling", "row_sparse", "parameters", "from", "kvstore", "to", "all", "devices", "based", "on", "rowids", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/rnn/large_word_lm/custom_module.py#L38-L60
[ "def", "prepare_sparse_params", "(", "self", ",", "param_rowids", ")", ":", "if", "not", "self", ".", "_kvstore", ":", "return", "assert", "(", "isinstance", "(", "param_rowids", ",", "dict", ")", ")", "for", "param_name", ",", "rowids", "in", "param_rowids"...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
CustomModule.save_params
Saves model parameters to file. Parameters ---------- fname : str Path to output param file. Examples -------- >>> # An example of saving module parameters. >>> mod.save_params('myfile')
example/rnn/large_word_lm/custom_module.py
def save_params(self, fname): """Saves model parameters to file. Parameters ---------- fname : str Path to output param file. Examples -------- >>> # An example of saving module parameters. >>> mod.save_params('myfile') """ arg_...
def save_params(self, fname): """Saves model parameters to file. Parameters ---------- fname : str Path to output param file. Examples -------- >>> # An example of saving module parameters. >>> mod.save_params('myfile') """ arg_...
[ "Saves", "model", "parameters", "to", "file", ".", "Parameters", "----------", "fname", ":", "str", "Path", "to", "output", "param", "file", ".", "Examples", "--------", ">>>", "#", "An", "example", "of", "saving", "module", "parameters", ".", ">>>", "mod", ...
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/rnn/large_word_lm/custom_module.py#L102-L116
[ "def", "save_params", "(", "self", ",", "fname", ")", ":", "arg_params", ",", "aux_params", "=", "self", ".", "get_params_from_kv", "(", "self", ".", "_arg_params", ",", "self", ".", "_aux_params", ")", "save_dict", "=", "{", "(", "'arg:%s'", "%", "k", "...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
CustomModule.get_params_from_kv
Copy data from kvstore to `arg_params` and `aux_params`. Parameters ---------- arg_params : list of NDArray Target parameter arrays. aux_params : list of NDArray Target aux arrays. Notes ----- - This function will inplace update the NDArray...
example/rnn/large_word_lm/custom_module.py
def get_params_from_kv(self, arg_params, aux_params): """ Copy data from kvstore to `arg_params` and `aux_params`. Parameters ---------- arg_params : list of NDArray Target parameter arrays. aux_params : list of NDArray Target aux arrays. Notes ...
def get_params_from_kv(self, arg_params, aux_params): """ Copy data from kvstore to `arg_params` and `aux_params`. Parameters ---------- arg_params : list of NDArray Target parameter arrays. aux_params : list of NDArray Target aux arrays. Notes ...
[ "Copy", "data", "from", "kvstore", "to", "arg_params", "and", "aux_params", ".", "Parameters", "----------", "arg_params", ":", "list", "of", "NDArray", "Target", "parameter", "arrays", ".", "aux_params", ":", "list", "of", "NDArray", "Target", "aux", "arrays", ...
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/rnn/large_word_lm/custom_module.py#L118-L141
[ "def", "get_params_from_kv", "(", "self", ",", "arg_params", ",", "aux_params", ")", ":", "assert", "(", "self", ".", "_kvstore", "is", "not", "None", ")", "for", "name", ",", "block", "in", "zip", "(", "self", ".", "_exec_group", ".", "param_names", ","...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
CustomModule.clip_by_global_norm_per_ctx
Clips gradient norm. The norm is computed over all gradients together, as if they were concatenated into a single vector. Gradients are modified in-place. The method is first used in `[ICML2013] On the difficulty of training recurrent neural networks` Note that the gradients...
example/rnn/large_word_lm/custom_module.py
def clip_by_global_norm_per_ctx(self, max_norm=1.0, param_names=None): """Clips gradient norm. The norm is computed over all gradients together, as if they were concatenated into a single vector. Gradients are modified in-place. The method is first used in `[ICML2013] On the ...
def clip_by_global_norm_per_ctx(self, max_norm=1.0, param_names=None): """Clips gradient norm. The norm is computed over all gradients together, as if they were concatenated into a single vector. Gradients are modified in-place. The method is first used in `[ICML2013] On the ...
[ "Clips", "gradient", "norm", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/rnn/large_word_lm/custom_module.py#L143-L174
[ "def", "clip_by_global_norm_per_ctx", "(", "self", ",", "max_norm", "=", "1.0", ",", "param_names", "=", "None", ")", ":", "assert", "self", ".", "binded", "and", "self", ".", "params_initialized", "and", "self", ".", "optimizer_initialized", "num_ctx", "=", "...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
CustomModule.rescale_grad
Rescale the gradient of provided parameters by a certain scale
example/rnn/large_word_lm/custom_module.py
def rescale_grad(self, scale=None, param_name=None): """ Rescale the gradient of provided parameters by a certain scale """ if scale is None or param_name is None: return param_idx = self._exec_group.param_names.index(param_name) grad_vals = self._exec_group.grad_arrays[param...
def rescale_grad(self, scale=None, param_name=None): """ Rescale the gradient of provided parameters by a certain scale """ if scale is None or param_name is None: return param_idx = self._exec_group.param_names.index(param_name) grad_vals = self._exec_group.grad_arrays[param...
[ "Rescale", "the", "gradient", "of", "provided", "parameters", "by", "a", "certain", "scale" ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/rnn/large_word_lm/custom_module.py#L176-L183
[ "def", "rescale_grad", "(", "self", ",", "scale", "=", "None", ",", "param_name", "=", "None", ")", ":", "if", "scale", "is", "None", "or", "param_name", "is", "None", ":", "return", "param_idx", "=", "self", ".", "_exec_group", ".", "param_names", ".", ...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
factorization_machine_model
builds factorization machine network with proper formulation: y = w_0 \sum(x_i w_i) + 0.5(\sum\sum<v_i,v_j>x_ix_j - \sum<v_iv_i>x_i^2)
example/sparse/factorization_machine/model.py
def factorization_machine_model(factor_size, num_features, lr_mult_config, wd_mult_config, init_config): """ builds factorization machine network with proper formulation: y = w_0 \sum(x_i w_i) + 0.5(\sum\sum<v_i,v_j>x_ix_j - \sum<v_iv_i>x_i^2) """ x = mx.symbol.Variable("...
def factorization_machine_model(factor_size, num_features, lr_mult_config, wd_mult_config, init_config): """ builds factorization machine network with proper formulation: y = w_0 \sum(x_i w_i) + 0.5(\sum\sum<v_i,v_j>x_ix_j - \sum<v_iv_i>x_i^2) """ x = mx.symbol.Variable("...
[ "builds", "factorization", "machine", "network", "with", "proper", "formulation", ":", "y", "=", "w_0", "\\", "sum", "(", "x_i", "w_i", ")", "+", "0", ".", "5", "(", "\\", "sum", "\\", "sum<v_i", "v_j", ">", "x_ix_j", "-", "\\", "sum<v_iv_i", ">", "x...
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/sparse/factorization_machine/model.py#L20-L54
[ "def", "factorization_machine_model", "(", "factor_size", ",", "num_features", ",", "lr_mult_config", ",", "wd_mult_config", ",", "init_config", ")", ":", "x", "=", "mx", ".", "symbol", ".", "Variable", "(", "\"data\"", ",", "stype", "=", "'csr'", ")", "# fact...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
batchify
Reshape data into (num_example, batch_size)
example/rnn/word_lm/data.py
def batchify(data, batch_size): """Reshape data into (num_example, batch_size)""" nbatch = data.shape[0] // batch_size data = data[:nbatch * batch_size] data = data.reshape((batch_size, nbatch)).T return data
def batchify(data, batch_size): """Reshape data into (num_example, batch_size)""" nbatch = data.shape[0] // batch_size data = data[:nbatch * batch_size] data = data.reshape((batch_size, nbatch)).T return data
[ "Reshape", "data", "into", "(", "num_example", "batch_size", ")" ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/rnn/word_lm/data.py#L72-L77
[ "def", "batchify", "(", "data", ",", "batch_size", ")", ":", "nbatch", "=", "data", ".", "shape", "[", "0", "]", "//", "batch_size", "data", "=", "data", "[", ":", "nbatch", "*", "batch_size", "]", "data", "=", "data", ".", "reshape", "(", "(", "ba...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
Corpus.tokenize
Tokenizes a text file.
example/rnn/word_lm/data.py
def tokenize(self, path): """Tokenizes a text file.""" assert os.path.exists(path) # Add words to the dictionary with open(path, 'r') as f: tokens = 0 for line in f: words = line.split() + ['<eos>'] tokens += len(words) ...
def tokenize(self, path): """Tokenizes a text file.""" assert os.path.exists(path) # Add words to the dictionary with open(path, 'r') as f: tokens = 0 for line in f: words = line.split() + ['<eos>'] tokens += len(words) ...
[ "Tokenizes", "a", "text", "file", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/rnn/word_lm/data.py#L48-L70
[ "def", "tokenize", "(", "self", ",", "path", ")", ":", "assert", "os", ".", "path", ".", "exists", "(", "path", ")", "# Add words to the dictionary", "with", "open", "(", "path", ",", "'r'", ")", "as", "f", ":", "tokens", "=", "0", "for", "line", "in...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
_build_doc
Build docstring for symbolic functions.
python/mxnet/symbol_doc.py
def _build_doc(func_name, desc, arg_names, arg_types, arg_desc, key_var_num_args=None, ret_type=None): """Build docstring for symbolic functions.""" param_str = _build_param_doc(arg_names, arg_types, arg_desc) if key_v...
def _build_doc(func_name, desc, arg_names, arg_types, arg_desc, key_var_num_args=None, ret_type=None): """Build docstring for symbolic functions.""" param_str = _build_param_doc(arg_names, arg_types, arg_desc) if key_v...
[ "Build", "docstring", "for", "symbolic", "functions", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol_doc.py#L212-L236
[ "def", "_build_doc", "(", "func_name", ",", "desc", ",", "arg_names", ",", "arg_types", ",", "arg_desc", ",", "key_var_num_args", "=", "None", ",", "ret_type", "=", "None", ")", ":", "param_str", "=", "_build_param_doc", "(", "arg_names", ",", "arg_types", "...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7
train
SymbolDoc.get_output_shape
Get user friendly information of the output shapes.
python/mxnet/symbol_doc.py
def get_output_shape(sym, **input_shapes): """Get user friendly information of the output shapes.""" _, s_outputs, _ = sym.infer_shape(**input_shapes) return dict(zip(sym.list_outputs(), s_outputs))
def get_output_shape(sym, **input_shapes): """Get user friendly information of the output shapes.""" _, s_outputs, _ = sym.infer_shape(**input_shapes) return dict(zip(sym.list_outputs(), s_outputs))
[ "Get", "user", "friendly", "information", "of", "the", "output", "shapes", "." ]
apache/incubator-mxnet
python
https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/python/mxnet/symbol_doc.py#L56-L59
[ "def", "get_output_shape", "(", "sym", ",", "*", "*", "input_shapes", ")", ":", "_", ",", "s_outputs", ",", "_", "=", "sym", ".", "infer_shape", "(", "*", "*", "input_shapes", ")", "return", "dict", "(", "zip", "(", "sym", ".", "list_outputs", "(", "...
1af29e9c060a4c7d60eeaacba32afdb9a7775ba7