bittensor.utils.registration#

Attributes#

Classes#

LazyLoadedTorch

A lazy-loading proxy for the torch module.

Functions#

use_torch()

Force the use of torch over numpy for certain operations.

legacy_torch_api_compat(func)

Convert function operating on numpy Input&Output to legacy torch Input&Output API if use_torch() is True.

_get_real_torch()

log_no_torch_error()

Module Contents#

bittensor.utils.registration.use_torch()[source]#

Force the use of torch over numpy for certain operations.

Return type:

bool

bittensor.utils.registration.legacy_torch_api_compat(func)[source]#

Convert function operating on numpy Input&Output to legacy torch Input&Output API if use_torch() is True.

Parameters:

func (function) – Function with numpy Input/Output to be decorated.

Returns:

Decorated function.

Return type:

decorated (function)

bittensor.utils.registration._get_real_torch()[source]#
bittensor.utils.registration.log_no_torch_error()[source]#
class bittensor.utils.registration.LazyLoadedTorch[source]#

A lazy-loading proxy for the torch module.

__bool__()[source]#
__getattr__(name)[source]#
bittensor.utils.registration.torch#