This replaces the type parameter with dataType.type this is useful in some cases where we have lost track of the type of D
convert this tensor to a Shape.
convert this tensor to a Shape. This errors if we don't have a 1-D tensor that can be cast to Int64
The name is long to avoid confusion with axes, which are the axes of this tensor
map each element to another type, then use a commutative and associative function to reduce along a set of given dimensions.
map each element to another type, then use a commutative and associative function to reduce along a set of given dimensions.
empty axes mean reduce along all axes
Returns true
if this tensor has an OnnxNumber instance available for
its data type.
Get the maximum values along a given axis.
This function computes the set of indices of a tensor for which it is non-zero.
This function computes the set of indices of a tensor for which it is non-zero. It returns a tensor of shape (rank, #nonzero), where #nonzero is the number of non-zero elements in the tensor, and rank is the rank of the original tensor. In other words each column in the output is the index for which the original tensor has a non-zero value. See https://github.com/onnx/onnx/blob/master/docs/Operators.md#NonZero for ONNX reference
Interestingly, the pytorch implementation (https://github.com/onnx/onnx/blob/master/docs/Operators.md#NonZero) returns the transpose this.
This is equivalent to numpy.reshape(data, axes) the total size is unchanged, this only remaps the addressing of the tensor
When called on a scalar (tensor with zero components), returns a scalar value.
When called on a scalar (tensor with zero components), returns a scalar value.
In other cases this method throws an error.
Iterate over all items in row major order
This is like numpy array slicing
Slice along a given axis taking one of the subtensors along that axis
Slice along a given axis taking one of the subtensors along that axis
Note this is not exactly what ONNX calls slice
same as numpy.sum discards each axis we sum, reducing the rank by that number of inputs
same as numpy.sum but keep the rank the same: leave 1 sized tensor in the place of the previous summed axis if no axes are given, sum over all axes
if the current tensor is not rowmajor, rewrite it to row-major
Transpose given the permutation list
Reverse the dimensions.
Reverse the dimensions. This is the usual transpose for a matrices