Updates elements of a tensor at specified positions, returning a new tensor.
You can also use the [<- operator.
Usage
# S3 method for class 'AnvilBox'
x[...] <- value
# S3 method for class 'AnvilTensor'
x[...] <- value
nv_subset_assign(x, ..., value)Arguments
- x
(
tensorish)
Tensor to update.- ...
Subset specifications, one per dimension. Seevignette("subsetting")for details.- value
(
tensorish)
Replacement values. Scalars are broadcast to the subset shape. Non-scalar values must match the subset shape.
Value
tensorish
A new tensor with the same shape as x and the subset replaced.
See also
nv_subset(), vignette("subsetting") for a comprehensive guide.