torch_concepts.data.utils.convert_precision

convert_precision(tensor: Tensor, precision: int | str) Tensor[source]

Convert tensor to specified precision.

Parameters:
  • tensor – Input tensor.

  • precision – Target precision (“float16”, “float32”, or “float64”, or 16, 32, 64).

Returns:

Tensor converted to specified precision.

Return type:

Tensor