ClikaRT::ops::cast
function
cast()
Same-device dtype conversion.
Converts per element to target. When x already has target's dtype and force_copy is false, the input passes through unchanged (no new storage); set force_copy = true to guarantee an owning copy.
Parameters
x: the input tensor.target: the destination dtype.force_copy: always materialize a new tensor. Defaultfalse.
Throws
ClikaRT::Error: when the input's dtype/shape is not served for this operation (the machine-readable reason ridescode_name()).
Returns: x converted to target; same shape.
auto f32 = ClikaRT::ops::cast(t, ClikaRT::DataType::Float32);
Declared in ClikaRT/compute/ops.h, line 1970