Skip to main content

ClikaRT::ops::ones_like

function

ones_like()

Tensor ones_like(Tensor reference, StreamOrDevice s = {})

A one-filled tensor with reference's shape and dtype (data never read); s absent = the reference's own device.

Throws

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

Returns: a new one-filled tensor shaped like reference.

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