WARNING
该页面尚未翻译。 以下内容为英文原版。
tensorplay.nn.common_types
Classes
class Tensor
python
Tensor(*args, **kwargs)Methods
cpu(self) [source]
Returns a copy of this object in CPU memory. If this object is already in CPU memory, then no copy is performed and the original object is returned.
cuda(self, device=None, non_blocking=False) [source]
Returns a copy of this object in CUDA memory. If this object is already in CUDA memory and on the correct device, then no copy is performed and the original object is returned.
double(self) [source]
flatten(self, start_dim=0, end_dim=-1) [source]
Flattens a contiguous range of dims.
float(self) [source]
int(self) [source]
is_float(self) -> bool [source]
Check if tensor is floating point.
long(self) [source]
ndimension(self) -> int [source]
Alias for dim()
t(self) [source]
Returns the transpose of the tensor. Aliased to transpose(0, 1) to ensure correct autograd behavior (TransposeBackward).
unflatten(self, dim, sizes) [source]
Expands a dimension of the input tensor over multiple dimensions.
