ConvertTo

cvcuda.convertto(src: nvcv.Tensor, dtype: nvcv.Type, scale: float = 1, offset: float = 0, *, stream: nvcv.cuda.Stream | None = None) nvcv.Tensor

Executes the Convert To operation on the given cuda stream.

See also

Refer to the CV-CUDA C API reference for the Convert To operator for more details and usage examples.

Parameters:
  • src (nvcv.Tensor) – Input tensor containing one or more images.

  • scale (float, optional) – Scalar for output data.

  • offset (float, optional) – Offset for the data.

  • stream (nvcv.cuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

The output tensor.

Return type:

nvcv.Tensor

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.

cvcuda.convertto_into(dst: nvcv.Tensor, src: nvcv.Tensor, scale: float = 1, offset: float = 0, *, stream: nvcv.cuda.Stream | None = None) nvcv.Tensor

Executes the Convert To operation on the given cuda stream.

See also

Refer to the CV-CUDA C API reference for the Convert To operator for more details and usage examples.

Parameters:
  • dst (nvcv.Tensor) – Output tensor to store the result of the operation.

  • src (nvcv.Tensor) – Input tensor containing one or more images.

  • scale (float, optional) – Scalar for output data.

  • offset (float, optional) – Offset for the data.

  • stream (nvcv.cuda.Stream, optional) – CUDA Stream on which to perform the operation.

Returns:

None

Caution

Restrictions to several arguments may apply. Check the C API references of the CV-CUDA operator.