tvo
- tvo.get_device()[source]
Get the torch.device that all objects in the package will use by default.
The default (‘cpu’) can be changed by setting the TVO_GPU environment variable to the number of the desired CUDA device. For example, in bash, export TVO_GPU=0 will make the framework default to device ‘cuda:0’. Note that some computations might still be performed on CPU for performance reasons.
- Return type:
device
- tvo.get_run_policy()[source]
Get the current parallelization policy. :rtype:
str
‘seq’: the framework will not perform any parallelization other than what torch tensors offer out of the box on the relevant device.
‘mpi’: the framework will perform data parallelization for the algorithms that implement it.
The policy is ‘seq’ unless the framework detects that the program is running within mpirun, in which case the policy is ‘mpi’. The default can also be overridden by setting the TVO_MPI environment variable to a non-zero value, e.g. in bash with export TVO_MPI=1.