ClikaRT::ops::ones
function
ones()
Tensor ones(
ClikaRT::Span<const ScalarOrTensor> shape,
DataType dtype,
StreamOrDevice s = {},
StreamOrDevice pinned_for = {}
)
A new tensor of the given shape with every element set to one.
Same shape-span and pinned_for contract as empty (extents are literals or 0-D integer Tensors).
Throws
ClikaRT::Error: when the input's dtype is not served for this operation (the machine-readable reason ridescode_name()).
Returns: a new one-filled tensor.
auto w = ClikaRT::ops::ones({n}, ClikaRT::DataType::Float32);
Declared in ClikaRT/compute/ops.h, line 2360