Skip to main content

ClikaRT::ops::full_like

function

full_like()

Tensor full_like(
    Tensor reference,
    ScalarOrTensor fill_value,
    StreamOrDevice s = {}
)

A new tensor with reference's shape and dtype, filled with fill_value.

Parameters

  • reference: shape/dtype donor; its data is never read.
  • fill_value: the value, cast to the reference's dtype.
  • s: stream or device; absent = the reference's own device. Default: absent.

Throws

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

Returns: a new filled tensor shaped like reference.

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