mindspore.Tensor

View Source On Gitee
class mindspore.Tensor(input_data=None, dtype=None, shape=None, init=None, internal=False, const_arg=False, device=None)[source]

Tensor is a data structure that stores an n-dimensional array.

Note

If init interface is used to initialize Tensor, the Tensor.init_data API needs to be called to load the actual data to Tensor.

Warning

To convert dtype of a Tensor, it is recommended to use Tensor.astype() rather than Tensor(sourceTensor, dtype=newDtype).

Parameters
  • input_data (Union[Tensor, float, int, bool, tuple, list, numpy.ndarray]) – The data to be stored. It can be another Tensor, Python number or NumPy ndarray. Default: None .

  • dtype (mindspore.dtype) – Used to indicate the data type of the output Tensor. The argument should be defined in mindspore.dtype. If it is None , the data type of the output Tensor will be the same as the input_data. Default: None .

  • shape (Union[tuple, list, int, mindspore.Symbol]) – Used to indicate the shape of the output Tensor. If input_data is available, shape doesn't need to be set. If None or Symbol exists in shape , a tensor of dynamic shape is created, input_data doesn't need to be set; if only integers exist in shape, a tensor of static shape is created, input_data or init must be set. Default: None .

  • init (Initializer) – The information of init data. init is used for delayed initialization in parallel mode, when using init, dtype and shape must be set. Default: None .

  • internal (bool) – Whether it is created by the framework. 'True' means that the tensor is created by framework. 'False' means that the tensor is created by user. Default: False .

  • const_arg (bool) – Whether the tensor is a constant when it is used for the argument of a network. Default: False .

  • device (str) – This parameter is reserved and does not need to be configured. Default: None .

Outputs:

Tensor.

Note

The default value None of input_data works as a placeholder, it does not mean that we can create a NoneType Tensor. Tensor with shape contains 0 is not fully tested and supported.

Examples

>>> import numpy as np
>>> import mindspore as ms
>>> from mindspore import Tensor
>>> from mindspore.common.initializer import One
>>> # initialize a tensor with numpy.ndarray
>>> t1 = Tensor(np.zeros([1, 2, 3]), ms.float32)
>>> print(t1)
[[[0. 0. 0.]
[0. 0. 0.]]]
>>> print(type(t1))
<class 'mindspore.common.tensor.Tensor'>
>>> print(t1.shape)
(1, 2, 3)
>>> print(t1.dtype)
Float32
>>>
>>> # initialize a tensor with a float scalar
>>> t2 = Tensor(0.1)
>>> print(t2)
0.1
>>> print(type(t2))
<class 'mindspore.common.tensor.Tensor'>
>>> print(t2.shape)
()
>>> print(t2.dtype)
Float32
>>>
>>> # initialize a tensor with a tuple
>>> t3 = Tensor((1, 2))
>>> print(t3)
[1 2]
>>> print(type(t3))
<class 'mindspore.common.tensor.Tensor'>
>>> print(t3.shape)
(2,)
>>> print(t3.dtype)
Int64
...
>>> # initialize a tensor with init
>>> t4 = Tensor(shape = (1, 3), dtype=ms.float32, init=One())
>>> print(t4)
[[1. 1. 1.]]
>>> print(type(t4))
<class 'mindspore.common.tensor.Tensor'>
>>> print(t4.shape)
(1, 3)
>>> print(t4.dtype)
Float32

mindspore.Tensor.__abs__

Alias for Tensor.abs().

mindspore.Tensor.__add__

Alias for Tensor.add().

mindspore.Tensor.__isub__

Alias for mindspore.Tensor.sub()

mindspore.Tensor.__sub__

Alias for mindspore.Tensor.sub()

mindspore.Tensor.abs

Returns absolute value of a tensor element-wise.

mindspore.Tensor.absolute

Alias for Tensor.abs().

mindspore.Tensor.acos

mindspore.Tensor.acosh

mindspore.Tensor.add

Adds other value to self element-wise.

mindspore.Tensor.addbmm

For details, please refer to mindspore.ops.addbmm().

mindspore.Tensor.addcdiv

For details, please refer to mindspore.ops.addcdiv().

mindspore.Tensor.addcmul

For details, please refer to mindspore.ops.addcmul().

mindspore.Tensor.addmm

For details, please refer to mindspore.ops.addmm().

mindspore.Tensor.addmm_

For details, please refer to mindspore.ops.addmm().

mindspore.Tensor.addmv

For details, please refer to mindspore.ops.addmv().

mindspore.Tensor.addr

For details, please refer to mindspore.ops.addr().

mindspore.Tensor.adjoint

For details, please refer to mindspore.ops.adjoint().

mindspore.Tensor.all

Reduces a dimension of self by the "logical AND" of all elements in the dimension, by default.

mindspore.Tensor.amax

For details, please refer to mindspore.ops.amax().

mindspore.Tensor.amin

For details, please refer to mindspore.ops.amin().

mindspore.Tensor.aminmax

For details, please refer to mindspore.ops.aminmax().

mindspore.Tensor.any

Reduces a dimension of self by the "logical OR" of all elements in the dimension, by default.

mindspore.Tensor.angle

For details, please refer to mindspore.ops.angle().

mindspore.Tensor.approximate_equal

For details, please refer to mindspore.ops.approximate_equal().

mindspore.Tensor.arccos

mindspore.Tensor.arccosh

mindspore.Tensor.arcsin

mindspore.Tensor.arcsinh

mindspore.Tensor.arctan

mindspore.Tensor.arctan2

Alias for Tensor.atan2().

mindspore.Tensor.arctanh

mindspore.Tensor.argmax

Return the indices of the maximum values of self across a dimension.

mindspore.Tensor.argmax_with_value

Returns the maximum value with corresponding index.

mindspore.Tensor.argmin

Returns the indices of the minimum value of self across the axis.

mindspore.Tensor.argmin_with_value

Returns the minimum value with corresponding index.

mindspore.Tensor.argsort

Sorts self along the given dimension in specified order and return the sorted indices.

mindspore.Tensor.argwhere

For details, please refer to mindspore.ops.argwhere().

mindspore.Tensor.asin

mindspore.Tensor.asinh

mindspore.Tensor.asnumpy

Convert tensor to numpy array.

mindspore.Tensor.assign_value

Assign another tensor value to this tensor.

mindspore.Tensor.astype

Return a copy of the tensor, cast to a specified type.

mindspore.Tensor.atan

mindspore.Tensor.atan2

Returns arctangent of self/other element-wise.

mindspore.Tensor.atanh

Computes inverse hyperbolic tangent of self element-wise.

mindspore.Tensor.baddbmm

For details, please refer to mindspore.ops.baddbmm().

mindspore.Tensor.bernoulli

For details, please refer to mindspore.ops.bernoulli().

mindspore.Tensor.bincount

Count the occurrences of each value in the self.

mindspore.Tensor.bitwise_and

For details, please refer to mindspore.ops.bitwise_and().

mindspore.Tensor.bitwise_left_shift

For details, please refer to mindspore.ops.bitwise_left_shift().

mindspore.Tensor.bitwise_or

For details, please refer to mindspore.ops.bitwise_or().

mindspore.Tensor.bitwise_right_shift

For details, please refer to mindspore.ops.bitwise_right_shift().

mindspore.Tensor.bitwise_xor

For details, please refer to mindspore.ops.bitwise_xor().

mindspore.Tensor.bmm

For details, please refer to mindspore.ops.bmm().

mindspore.Tensor.bool

Converts input tensor dtype to bool.

mindspore.Tensor.broadcast_to

For details, please refer to mindspore.ops.broadcast_to().

mindspore.Tensor.byte

Converts input tensor dtype to uint8.

mindspore.Tensor.cauchy

Fills the tensor with numbers drawn from the Cauchy distribution.

mindspore.Tensor.ceil

Rounds a tensor up to the closest integer element-wise.

mindspore.Tensor.cholesky

For details, please refer to mindspore.ops.cholesky().

mindspore.Tensor.cholesky_solve

For details, please refer to mindspore.ops.cholesky_solve().

mindspore.Tensor.choose

Construct a tensor from an index tensor and a list of tensors to choose from.

mindspore.Tensor.chunk

Cut the self Tensor into chunks sub-tensors along the specified dimension.

mindspore.Tensor.clamp

Clamps tensor values between the specified minimum value and maximum value.

mindspore.Tensor.clip

Alias for mindspore.Tensor.clamp().

mindspore.Tensor.col2im

For details, please refer to mindspore.ops.col2im().

mindspore.Tensor.conj

For details, please refer to mindspore.ops.conj().

mindspore.Tensor.contiguous

Converts a Tensor into a continuous-memory Tensor that contains the same data as the original Tensor.

mindspore.Tensor.copy

Return a copy of the tensor.

mindspore.Tensor.copysign

For details, please refer to mindspore.ops.copysign().

mindspore.Tensor.cos

Computes cosine of self element-wise.

mindspore.Tensor.cosh

For details, please refer to mindspore.ops.cosh().

mindspore.Tensor.count_nonzero

For details, please refer to mindspore.ops.count_nonzero().

mindspore.Tensor.cov

For details, please refer to mindspore.ops.cov().

mindspore.Tensor.cross

For details, please refer to mindspore.ops.cross().

mindspore.Tensor.cummax

For details, please refer to mindspore.ops.cummax().

mindspore.Tensor.cummin

For details, please refer to mindspore.ops.cummin().

mindspore.Tensor.cumprod

For details, please refer to mindspore.ops.cumprod().

mindspore.Tensor.cumsum

Computes the cumulative sum of self Tensor along dim.

mindspore.Tensor.deg2rad

For details, please refer to mindspore.ops.deg2rad().

mindspore.Tensor.diag

For details, please refer to mindspore.ops.diag().

mindspore.Tensor.diagflat

For details, please refer to mindspore.ops.diagflat().

mindspore.Tensor.diagonal

For details, please refer to mindspore.ops.diagonal().

mindspore.Tensor.diagonal_scatter

For details, please refer to mindspore.ops.diagonal_scatter().

mindspore.Tensor.diff

For details, please refer to mindspore.ops.diff().

mindspore.Tensor.digamma

For details, please refer to mindspore.ops.digamma().

mindspore.Tensor.div

Divides the self tensor by the other input tensor in floating-point type element-wise.

mindspore.Tensor.divide

Alias for mindspore.Tensor.div().

mindspore.Tensor.dot

mindspore.Tensor.dsplit

For details, please refer to mindspore.ops.dsplit().

mindspore.Tensor.dtype

Return the dtype of the tensor (mindspore.dtype).

mindspore.Tensor.eq

Computes the equivalence between two tensors element-wise.

mindspore.Tensor.equal

For details, please refer to mindspore.ops.equal().

mindspore.Tensor.erf

Computes the Gauss error function of self element-wise.

mindspore.Tensor.erfc

Computes the complementary error function of self element-wise.

mindspore.Tensor.erfinv

For details, please refer to mindspore.ops.erfinv().

mindspore.Tensor.eigvals

For details, please refer to mindspore.ops.eigvals().

mindspore.Tensor.exp

Returns exponential of a tensor element-wise.

mindspore.Tensor.expand_as

Expand the shape of the input tensor to be the same as the another input tensor.

mindspore.Tensor.expand_dims

For details, please refer to mindspore.ops.expand_dims().

mindspore.Tensor.expm1

Returns exponential then minus 1 of a tensor element-wise.

mindspore.Tensor.fill_diagonal

Fills the main diagonal of a Tensor with a specified value and returns the result.

mindspore.Tensor.flatten

Flatten a tensor along dimensions from start_dim to end_dim.

mindspore.Tensor.flip

For details, please refer to mindspore.ops.flip().

mindspore.Tensor.fliplr

For details, please refer to mindspore.ops.fliplr().

mindspore.Tensor.flipud

For details, please refer to mindspore.ops.flipud().

mindspore.Tensor.float

Converts input tensor dtype to float32.

mindspore.Tensor.float_power

For details, please refer to mindspore.ops.float_power().

mindspore.Tensor.floor

Rounds a tensor down to the closest integer element-wise.

mindspore.Tensor.floor_divide

For details, please refer to mindspore.ops.floor_divide().

mindspore.Tensor.flush_from_cache

Flush cache data to host if tensor is cache enable.

mindspore.Tensor.fold

For details, please refer to mindspore.ops.fold().

mindspore.Tensor.fmax

For details, please refer to mindspore.ops.fmax().

mindspore.Tensor.fmod

For details, please refer to mindspore.ops.fmod().

mindspore.Tensor.frac

For details, please refer to mindspore.ops.frac().

mindspore.Tensor.from_numpy

Convert numpy array to Tensor.

mindspore.Tensor.gather

Gather data from a tensor by indices.

mindspore.Tensor.gather_elements

For details, please refer to mindspore.ops.gather_elements().

mindspore.Tensor.gather_nd

For details, please refer to mindspore.ops.gather_nd().

mindspore.Tensor.ge

For details, please refer to mindspore.ops.ge().

mindspore.Tensor.geqrf

For details, please refer to mindspore.ops.geqrf().

mindspore.Tensor.ger

For details, please refer to mindspore.ops.ger().

mindspore.Tensor.greater

Compare the value of the input parameters \(self > other\) element-wise, and the output result is a bool value.

mindspore.Tensor.greater_equal

Computes the boolean value of \(self >= other\) element-wise.

mindspore.Tensor.gt

For details, please refer to :func:'mindspore.Tensor.greater'.

mindspore.Tensor.H

Returns a view of a matrix (2-D tensor) conjugated and transposed.

mindspore.Tensor.half

Converts input tensor dtype to float16.

mindspore.Tensor.hardshrink

Hard Shrink activation function.

mindspore.Tensor.has_init

Whether tensor is initialized.

mindspore.Tensor.heaviside

For details, please refer to mindspore.ops.heaviside().

mindspore.Tensor.histc

For details, please refer to mindspore.ops.histc().

mindspore.Tensor.hsplit

For details, please refer to mindspore.ops.hsplit().

mindspore.Tensor.hypot

For details, please refer to mindspore.ops.hypot().

mindspore.Tensor.i0

For details, please refer to mindspore.ops.i0().

mindspore.Tensor.igamma

For details, please refer to mindspore.ops.igamma().

mindspore.Tensor.igammac

For details, please refer to mindspore.ops.igammac().

mindspore.Tensor.imag

For details, please refer to mindspore.ops.imag().

mindspore.Tensor.index_add

For details, please refer to mindspore.ops.index_add().

mindspore.Tensor.index_fill

For details, please refer to mindspore.ops.index_fill().

mindspore.Tensor.index_put

Returns a Tensor.

mindspore.Tensor.index_put_

Returns a Tensor.

mindspore.Tensor.index_select

Generates a new Tensor that accesses the values of self along the specified axis dimension using the indices specified in index.

mindspore.Tensor.init_data

Get the tensor format data of this Tensor.

mindspore.Tensor.inner

For details, please refer to mindspore.ops.inner().

mindspore.Tensor.inplace_update

For details, please refer to mindspore.ops.inplace_update().

mindspore.Tensor.int

Converts input tensor dtype to int32.

mindspore.Tensor.inv

For details, please refer to mindspore.ops.inv().

mindspore.Tensor.inverse

Compute the inverse of the self matrix.

mindspore.Tensor.invert

For details, please refer to mindspore.ops.invert().

mindspore.Tensor.isclose

Returns a tensor of Boolean values indicating whether each element of input is "close" to the corresponding element of other.

mindspore.Tensor.isfinite

Determine which elements are finite for each position.

mindspore.Tensor.is_floating_point

For details, please refer to mindspore.ops.is_floating_point().

mindspore.Tensor.isinf

Determines which elements are inf or -inf for each position.

mindspore.Tensor.isnan

For details, please refer to mindspore.ops.ne().

mindspore.Tensor.isneginf

Determines which elements are -inf for each position.

mindspore.Tensor.isposinf

For details, please refer to mindspore.ops.isposinf().

mindspore.Tensor.isreal

For details, please refer to mindspore.ops.isreal().

mindspore.Tensor.is_signed

Judge whether the data type of tensor is a signed data type.

mindspore.Tensor.is_complex

For details, please refer to mindspore.ops.is_complex().

mindspore.Tensor.is_contiguous

Determines whether the memory of tensor is contiguous.

mindspore.Tensor.item

Return the value of this tensor as standard Python number.

mindspore.Tensor.itemset

Insert scalar into a tensor (scalar is cast to tensor's dtype, if possible).

mindspore.Tensor.itemsize

Return the length of one tensor element in bytes.

mindspore.Tensor.lcm

For details, please refer to mindspore.ops.lcm().

mindspore.Tensor.ldexp

For details, please refer to mindspore.ops.ldexp().

mindspore.Tensor.le

Computes the boolean value of \(self <= other\) element-wise.

mindspore.Tensor.lerp

For details, please refer to mindspore.ops.lerp().

mindspore.Tensor.less

Computes the boolean value of \(self < other\) element-wise.

mindspore.Tensor.less_equal

Computes the boolean value of \(self <= other\) element-wise.

mindspore.Tensor.log

Returns the natural logarithm of a tensor element-wise.

mindspore.Tensor.log10

For details, please refer to mindspore.ops.log10().

mindspore.Tensor.log1p

Returns the natural logarithm of one plus the self tensor element-wise.

mindspore.Tensor.log2

Returns the logarithm to the base 2 of a tensor element-wise

mindspore.Tensor.logaddexp

For details, please refer to mindspore.ops.logaddexp().

mindspore.Tensor.logaddexp2

For details, please refer to mindspore.ops.logaddexp2().

mindspore.Tensor.logcumsumexp

For details, please refer to mindspore.ops.logcumsumexp().

mindspore.Tensor.logdet

For details, please refer to mindspore.ops.logdet().

mindspore.Tensor.logical_and

Computes the "logical AND" of two tensors element-wise.

mindspore.Tensor.logical_not

Computes the "logical NOT" of a tensor element-wise.

mindspore.Tensor.logical_or

Computes the "logical OR" of two tensors element-wise.

mindspore.Tensor.logical_xor

For details, please refer to mindspore.ops.logical_xor().

mindspore.Tensor.logit

For details, please refer to mindspore.ops.logit().

mindspore.Tensor.logsumexp

For details, please refer to mindspore.ops.logsumexp().

mindspore.Tensor.log_normal

Fills the elements of the input tensor with log normal values initialized by given mean and std:

mindspore.Tensor.long

Converts input tensor dtype to int64.

mindspore.Tensor.lt

For more details, please refer to mindspore.Tensor.less().

mindspore.Tensor.lu_solve

For details, please refer to mindspore.ops.lu_solve().

mindspore.Tensor.masked_fill

Fills elements of Tensor with value where mask is True.

mindspore.Tensor.masked_scatter

Returns a Tensor.

mindspore.Tensor.masked_select

Returns a new 1-D Tensor which indexes self according to the boolean mask.

mindspore.Tensor.matmul

Returns the matrix product of two tensors.

mindspore.Tensor.max

Return the maximum of a tensor or maximum along an axis.

mindspore.Tensor.maximum

Computes the maximum of input tensors element-wise.

mindspore.Tensor.mean

Reduces all dimension of a tensor by averaging all elements in the dimension, by default.

mindspore.Tensor.median

For details, please refer to mindspore.ops.median().

mindspore.Tensor.mH

Accessing this property is equivalent to Calling self.adjoint().

mindspore.Tensor.min

Calculates the minimum value of the input tensor.

mindspore.Tensor.minimum

Computes the minimum of input tensors element-wise.

mindspore.Tensor.mm

Returns the matrix product of two arrays.

mindspore.Tensor.movedim

For details, please refer to mindspore.ops.movedim().

mindspore.Tensor.moveaxis

For details, please refer to mindspore.ops.moveaxis().

mindspore.Tensor.move_to

Copy Tensor to target device synchronously or asynchronously, default synchronously.

mindspore.Tensor.msort

For details, please refer to mindspore.ops.msort().

mindspore.Tensor.mT

Returns the Tensor that exchanges the last two dimensions.

mindspore.Tensor.mul

Multiplies two tensors element-wise.

mindspore.Tensor.multinomial

For details, please refer to mindspore.ops.multinomial().

mindspore.Tensor.multiply

For details, please refer to mindspore.ops.multiply().

mindspore.Tensor.mvlgamma

For details, please refer to mindspore.ops.mvlgamma().

mindspore.Tensor.nan_to_num

Replace the NaN, positive infinity and negative infinity values of the self with the specified values in nan, posinf and neginf respectively.

mindspore.Tensor.nanmean

For details, please refer to mindspore.ops.nanmean().

mindspore.Tensor.nanmedian

For details, please refer to mindspore.ops.nanmedian().

mindspore.Tensor.nansum

For details, please refer to mindspore.ops.nansum().

mindspore.Tensor.narrow

Obtains a tensor of a specified length at a specified start position along a specified axis.

mindspore.Tensor.nbytes

Return the total number of bytes taken by the tensor.

mindspore.Tensor.ndim

Return the number of tensor dimensions.

mindspore.Tensor.ndimension

Alias for mindspore.Tensor.ndim().

mindspore.Tensor.ne

Alias for mindspore.Tensor.not_equal().

mindspore.Tensor.neg

Returns a tensor with negative values of self element-wise.

mindspore.Tensor.negative

Alias for mindspore.Tensor.neg().

mindspore.Tensor.nelement

Alias for mindspore.Tensor.numel().

mindspore.Tensor.new_ones

Return a tensor of size filled with ones.

mindspore.Tensor.new_zeros

Return a tensor of size filled with zeros.

mindspore.Tensor.nextafter

For details, please refer to mindspore.ops.nextafter().

mindspore.Tensor.numel

Returns a Scalar of type int that represents the total number of elements in the Tensor.

mindspore.Tensor.numpy

Alias for mindspore.Tensor.asnumpy().

mindspore.Tensor.nonzero

Return the positions of all non-zero values.

mindspore.Tensor.norm

For details, please refer to mindspore.ops.norm().

mindspore.Tensor.normal_

Update the self tensor in place by generating random numbers sampled from the normal distribution which constructed by the parameters mean and std.

mindspore.Tensor.not_equal

Computes the non-equivalence of two tensors element-wise.

mindspore.Tensor.outer

Return outer product of self and vec2.

mindspore.Tensor.orgqr

For details, please refer to mindspore.ops.orgqr().

mindspore.Tensor.ormqr

For details, please refer to mindspore.ops.ormqr(), Args input2 and input3 correspond to the args tau and other of mindspore.ops.ormqr().

mindspore.Tensor.permute

For details, please refer to mindspore.ops.permute().

mindspore.Tensor.positive

For details, please refer to mindspore.ops.positive().

mindspore.Tensor.pow

Calculates the exponent power of each element in self.

mindspore.Tensor.prod

Reduces a dimension of a tensor by multiplying all elements in the dimension, by default.

mindspore.Tensor.ptp

The name of the function comes from the acronym for "peak to peak".

mindspore.Tensor.rad2deg

For details, please refer to mindspore.ops.rad2deg().

mindspore.Tensor.random_

Fill the tensor with numbers sampled from a discrete uniform distribution over an interval \([from\_, to-1]\).

mindspore.Tensor.random_categorical

For details, please refer to mindspore.ops.random_categorical().

mindspore.Tensor.ravel

Return a contiguous flattened tensor.

mindspore.Tensor.real

For details, please refer to mindspore.ops.real().

mindspore.Tensor.reciprocal

Returns reciprocal of a tensor element-wise.

mindspore.Tensor.remainder

Computes the remainder of self divided by other element-wise.

mindspore.Tensor.renorm

For details, please refer to mindspore.ops.renorm().

mindspore.Tensor.repeat

Repeat elements of a tensor.

mindspore.Tensor.repeat_interleave

Repeat elements of a tensor along a dim, like numpy.repeat.

mindspore.Tensor.reshape

Rearranges self Tensor based on the given shape.

mindspore.Tensor.reshape_as

Change the shape of the Tensor to the shape of other without changing the data.

mindspore.Tensor.resize

Changes shape and size of tensor in-place.

mindspore.Tensor.reverse

For details, please refer to mindspore.ops.flip().

mindspore.Tensor.reverse_sequence

For details, please refer to mindspore.ops.reverse_sequence().

mindspore.Tensor.roll

For details, please refer to mindspore.ops.roll().

mindspore.Tensor.round

Returns half to even of a tensor element-wise.

mindspore.Tensor.rot90

For details, please refer to mindspore.ops.rot90().

mindspore.Tensor.rsqrt

Computes reciprocal of square root of self tensor element-wise.

mindspore.Tensor.register_hook

Registers a backward hook for tensor.

mindspore.Tensor.scatter

Update the value in src to self according to the specified index.

mindspore.Tensor.scatter_add

Add all elements in src to the index specified by index to self along dimension specified by dim.

mindspore.Tensor.scatter_div

For details, please refer to mindspore.ops.scatter_div().

mindspore.Tensor.scatter_max

For details, please refer to mindspore.ops.scatter_max().

mindspore.Tensor.scatter_min

For details, please refer to mindspore.ops.scatter_min().

mindspore.Tensor.scatter_mul

For details, please refer to mindspore.ops.scatter_mul().

mindspore.Tensor.scatter_sub

Creates a new tensor by subtracting the values from the positions in self tensor indicated by indices, with values from updates.

mindspore.Tensor.searchsorted

Finds indices where elements should be inserted to maintain order.

mindspore.Tensor.select

Slices the self tensor along the selected dimension at the given index.

mindspore.Tensor.select_scatter

For details, please refer to mindspore.ops.select_scatter().

mindspore.Tensor.set_const_arg

Specify whether the tensor is a constant when it is used for the argument of a network.

mindspore.Tensor.sgn

For details, please refer to mindspore.ops.sgn().

mindspore.Tensor.shape

For details, please refer to mindspore.ops.shape().

mindspore.Tensor.short

Return a copy of the tensor, cast to int16 type, equivalent to self.astype(mstype.int16).

mindspore.Tensor.sigmoid

Computes Sigmoid of self element-wise.

mindspore.Tensor.sign

For details, please refer to mindspore.ops.sign().

mindspore.Tensor.signbit

For details, please refer to mindspore.ops.signbit().

mindspore.Tensor.sin

Computes sine of self element-wise.

mindspore.Tensor.sinc

For details, please refer to mindspore.ops.sinc().

mindspore.Tensor.sinh

For details, please refer to mindspore.ops.sinh().

mindspore.Tensor.size

For details, please refer to mindspore.ops.size().

mindspore.Tensor.slice_scatter

For details, please refer to mindspore.ops.slice_scatter().

mindspore.Tensor.slogdet

For details, please refer to mindspore.ops.slogdet().

mindspore.Tensor.softmax

For details, please refer to mindspore.ops.softmax().

mindspore.Tensor.sort

Sorts the elements of the self tensor along the given dimension in the specified order.

mindspore.Tensor.split

Splits the Tensor into chunks along the given axis.

mindspore.Tensor.sqrt

Returns sqrt of self element-wise.

mindspore.Tensor.square

Returns square of self element-wise.

mindspore.Tensor.squeeze

For details, please refer to mindspore.ops.squeeze().

mindspore.Tensor.std

For details, please refer to mindspore.ops.std().

mindspore.Tensor.storage_offset

Tensor's offset in the underlying storage in terms of the number of storage elements.

mindspore.Tensor.stride

The stride to jump from one element to the next in the input dim.

mindspore.Tensor.strides

Return the tuple of bytes to step in each dimension when traversing a tensor.

mindspore.Tensor.sub

Subtracts scaled other value from self Tensor.

mindspore.Tensor.subtract

For details, please refer to mindspore.ops.subtract().

mindspore.Tensor.sum

Calculate sum of Tensor elements over a given dim.

mindspore.Tensor.sum_to_size

Sum self Tensor to the size.

mindspore.Tensor.svd

For details, please refer to mindspore.ops.svd().

mindspore.Tensor.swapaxes

For details, please refer to mindspore.ops.swapaxes().

mindspore.Tensor.swapdims

For details, please refer to mindspore.ops.swapdims().

mindspore.Tensor.T

Return the transposed tensor.

mindspore.Tensor.t

Transpose self .

mindspore.Tensor.take

Takes elements from a tensor along an axis.

mindspore.Tensor.tan

Computes tangent of self element-wise.

mindspore.Tensor.tanh

Computes hyperbolic tangent of self element-wise.

mindspore.Tensor.tensor_split

For details, please refer to mindspore.ops.tensor_split().

mindspore.Tensor.tile

Replicates an tensor with given dims times.

mindspore.Tensor.to

Returns a tensor with the new specified data type.

mindspore.Tensor.to_coo

Convert a Tensor to COOTensor.

mindspore.Tensor.to_csr

Convert a Tensor to CSRTensor.

mindspore.Tensor.tolist

Convert a Tensor to List.

mindspore.Tensor.topk

Finds values and indices of the k largest or smallest entries along a given dimension.

mindspore.Tensor.trace

Return the sum along diagonals of the tensor.

mindspore.Tensor.transpose

For details, please refer to mindspore.ops.transpose().

mindspore.Tensor.tril

Returns the lower triangle part of input (elements that contain the diagonal and below), and set the other elements to zeros.

mindspore.Tensor.triu

Returns the upper triangle part of 'self' (elements that contain the diagonal and below), and set the other elements to zeros.

mindspore.Tensor.true_divide

Alias for Tensor.div() with \(rounding\_mode=None\).

mindspore.Tensor.trunc

Returns a new tensor with the truncated integer values of the elements of the input tensor.

mindspore.Tensor.type

Change the dtype of the Tensor to the dtype .

mindspore.Tensor.type_as

Change the dtype of the Tensor to the dtype of other.

mindspore.Tensor.unbind

For details, please refer to mindspore.ops.unbind().

mindspore.Tensor.unfold

For details, please refer to mindspore.ops.unfold().

mindspore.Tensor.uniform

Generates random numbers in the half-open interval [from_, to).

mindspore.Tensor.unique

Returns the unique elements of self.

mindspore.Tensor.unique_consecutive

For details, please refer to mindspore.ops.unique_consecutive().

mindspore.Tensor.unique_with_pad

For details, please refer to mindspore.ops.unique_with_pad().

mindspore.Tensor.unsorted_segment_max

For details, please refer to mindspore.ops.unsorted_segment_max().

mindspore.Tensor.unsorted_segment_min

For details, please refer to mindspore.ops.unsorted_segment_min().

mindspore.Tensor.unsorted_segment_prod

For details, please refer to mindspore.ops.unsorted_segment_prod().

mindspore.Tensor.unsqueeze

For details, please refer to mindspore.ops.unsqueeze().

mindspore.Tensor.var

Compute the variance along the specified axis.

mindspore.Tensor.view

Reshape the tensor according to the input shape.

mindspore.Tensor.view_as

View self Tensor as the same shape as other .

mindspore.Tensor.where

Selects elements from self or y based on condition and returns a tensor.

mindspore.Tensor.xdivy

For details, please refer to mindspore.ops.xdivy().

mindspore.Tensor.xlogy

For details, please refer to mindspore.ops.xlogy().

mindspore.Tensor.vsplit

For details, please refer to mindspore.ops.vsplit().