getBackendDtype

Resolve the active torch backend dtype

Description

The torch floating-point dtype to use for accelerated tensors: float64 everywhere except MPS, which cannot represent float64 and so is capped at float32 (its maximum precision).

Usage

getBackendDtype()

Value

a torch dtype (torch::torch_float64() or torch::torch_float32()).

Examples

library("SpaNorm")

if (checkGPU()) getBackendDtype()