ClikaRT::ops::full
function
full()
Tensor full(
ClikaRT::Span<const ScalarOrTensor> shape,
ScalarOrTensor fill_value,
DataType dtype,
StreamOrDevice s = {},
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 slot: an integer keeps its integer-ness across the boundary and stays exact past 2^53; a tensor arm is rejected. See Tensor::full for the same contract.
Parameters
shape: extents, one per dim.fill_value: the value, cast todtype.dtype: element type.s: stream or device. Default: the default device.pinned_for: peer-pinned host allocation (seeempty). Default: absent.
Throws
ClikaRT::Error: (INVALID_ARGUMENT) whenfill_valuecarries a tensor 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 2318