Skip to main content

ClikaRT::ops::full_like

function

full_like()​

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

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

fill_value takes the same forms as full's: a bool, an integer, a double, or a tensor (0-D, or broadcastable to the reference's shape).

Parameters

  • reference: shape/dtype donor; its data is never read.
  • fill_value: the value, cast to the reference's dtype.
  • device: 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 2413