Creates a tensor filled with a scalar value. More memory-efficient than
nv_tensor(value, shape = shape) for large tensors.
Arguments
- value
(
numeric(1))
Scalar value to fill the tensor with.- shape
(
integer())
Shape of the output tensor.- dtype
(
character(1)|NULL)
Data type. IfNULL(default), inferred fromvalue.- ambiguous
(
logical(1))
Whether the type is ambiguous. Ambiguous types usually arise from R literals (e.g.,1L,1.0) and follow special promotion rules. See thevignette("type-promotion")for more details.
Value
tensorish
Has the given shape and dtype.
See also
nvl_fill() for the underlying primitive.