Learn R Programming

rTorch (version 0.4.2)

dim.torch.Tensor: Dimensions of a tensor

Description

Get the dimensions of a tensor displaying it as a vector.

Usage

# S3 method for torch.Tensor
dim(x)

Arguments

x

tensor

Value

a vector of integers with the dimensions of the tensor

Examples

Run this code
# NOT RUN {
uo = torch$ones(3L, 5L)  # it is a 3x5 tensor
dim(uo)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab