Skip to main content

ClikaRT::ops::fill

function

fill()​

Tensor fill(
    Tensor input,
    ScalarOrTensor value,
    StreamOrDevice device = {}
)

A new tensor with input's shape and dtype, every element set to value.

input supplies GEOMETRY only; its data is never read. value is a literal or a 0-D Tensor (a tensor value traces symbolically).

Parameters

  • input: shape/dtype donor.
  • value: the fill value, cast to input's dtype.
  • device: optional stream override. Default: input's placement.

Throws

  • ClikaRT::Error: when the input's dtype is not served for this operation (the machine-readable reason rides code_name()).

Returns: a new tensor shaped like input, filled with value.

Declared in ClikaRT/compute/ops.h, line 2268