bittensor.utils.registration.torch_utils#
Torch compatibility utilities for Bittensor.
Attributes#
Classes#
A lazy-loading proxy for the torch module. |
Functions#
|
Convert function operating on numpy Input&Output to legacy torch Input&Output API if use_torch() is True. |
Force the use of torch over numpy for certain operations. |
Module Contents#
- class bittensor.utils.registration.torch_utils.LazyLoadedTorch#
A lazy-loading proxy for the torch module.
- bittensor.utils.registration.torch_utils.legacy_torch_api_compat(func)#
Convert function operating on numpy Input&Output to legacy torch Input&Output API if use_torch() is True.
- Parameters:
func – Function with numpy Input/Output to be decorated.
- Returns:
Decorated function.
- Return type:
decorated
- bittensor.utils.registration.torch_utils.log_no_torch_error()#
- bittensor.utils.registration.torch_utils.torch#