length.torch.Tensor: Length of a tensor.

Description Usage Arguments Value Examples

Description

This function is equivalent to torch$numel()

Usage

1
2
## S3 method for class 'torch.Tensor'
length(x)

Arguments

x

tensor

Value

the number of elements of a tensor as an integer

Examples

1
2
3
4
5
## Not run: 
uo = torch$ones(3L, 5L)   # tensor with 15 elements
length(uo)

## End(Not run)

rTorch documentation built on Jan. 13, 2021, 4:32 p.m.