Skip to main content

ClikaRT::ops::fill

function

fill()

Tensor fill(
    Tensor x,
    ScalarOrTensor value,
    StreamOrDevice s = {}
)

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

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

Parameters

  • x: shape/dtype donor.
  • value: the fill value, cast to x's dtype.
  • s: optional stream override. Default: x'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 x, filled with value.

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