Skip to contents

Returns the shape of a tensor as an integer() vector.

Usage

shape(x, ...)

Arguments

x

(tensorish)
A tensor-like object.

...

Additional arguments passed to methods (unused).

Value

integer()

Details

This is implemented via the generic tengen::shape().

Examples

x <- nv_tensor(1:4, dtype = "f32")
shape(x)
#> [1] 4