nn_tensor_fill

Function nn_tensor_fill 

Source
pub unsafe extern "C" fn nn_tensor_fill(
    tensor: *mut NNTensor,
    constant: f64,
) -> NNError
Expand description

Fills the tensor with the provided constant. The constant is captured as double precision (64-bit floating point) which has 53-bits of precision on whole numbers. This means the constant CANNOT represent all 64-bit integers but it CAN represent all 32-bit and lower integers. If full 64-bit integer support is required @ref nn_tensor_map can be used though it is less efficient with some engines because of the addition memory transfer required.

The double will be cast appropriately to the target tensor’s type before filling the tensor.

@public @memberof NNTensor @since 2.0