megengine.core.tensor.array_method.ArrayMethodMixin

class ArrayMethodMixin[源代码]

属性

T

alias of transpose.

dtype

rtype

dtype

ndim

返回自身 Tensor 的维数。

shape

rtype

Union[tuple, Tensor]

size

Returns the size of the self Tensor.

方法

astype(dtype)

Returns a Tensor with the same data and number of elements with the specified dtype.

flatten()

See flatten.

item(*args)

Returns the value of this Tensor as a standard Python numbers.Number.

max([axis, keepdims])

Returns the max value of each row of the input tensor in the given dimension axis.

mean([axis, keepdims])

Returns the mean value of each row of the input tensor in the given dimension axis.

min([axis, keepdims])

Returns the min value of each row of the input tensor in the given dimension axis.

numpy()

rtype

ndarray

prod([axis, keepdims])

Returns the product of each row of the input tensor in the given dimension axis.

reshape(*args)

See reshape.

sum([axis, keepdims])

Returns the sum of each row of the input tensor in the given dimension axis.

tolist()

Returns the tensor as a (nested) list.

transpose(*args)

See transpose.