ClikaRT::ops::full
function
full()
Tensor full(
ClikaRT::Span<const ScalarOrTensor> shape,
ScalarOrTensor fill_value,
DataType dtype,
StreamOrDevice device = {},
StreamOrDevice pinned_for = {}
)
A new tensor of the given shape with every element set to fill_value.
Each shape extent is an int literal or a 0-D integer Tensor (traces symbolically). fill_value is a scalar literal or a tensor: a bool keeps Bool kind, an integer keeps its integer-ness across the boundary and stays exact past 2^53, and a tensor fills every element from its values (a 0-D tensor, or one broadcastable to shape), the same write as fill_ on an empty tensor in one kernel. Tensor::full is the literal-only form.
Parameters
shape: extents, one per dim.fill_value: the value, cast todtype.dtype: element type.device: stream or device. Default: the default device.pinned_for: peer-pinned host allocation (seeempty). Default: absent.
Throws
ClikaRT::Error: (INVALID_ARGUMENT) whenfill_valueis absent, a tensor it carries does not broadcast toshape, or an extent is negative (code_name()carries the reason).
Returns: a new filled tensor.
auto neg_inf = ClikaRT::ops::full({b, s}, -1e9, ClikaRT::DataType::Float32);
Declared in ClikaRT/compute/ops.h, line 2400