bittensor.extrinsics.set_weights

bittensor.extrinsics.set_weights#

Attributes#

Functions#

set_weights_extrinsic(subtensor, wallet, netuid, uids, ...)

Sets the given weights and values on chain for wallet hotkey account.

Module Contents#

bittensor.extrinsics.set_weights.logger#
bittensor.extrinsics.set_weights.set_weights_extrinsic(subtensor, wallet, netuid, uids, weights, version_key=0, wait_for_inclusion=False, wait_for_finalization=False, prompt=False)[source]#

Sets the given weights and values on chain for wallet hotkey account.

Parameters:
  • subtensor (bittensor.subtensor) – Subtensor endpoint to use.

  • wallet (bittensor.wallet) – Bittensor wallet object.

  • netuid (int) – The netuid of the subnet to set weights for.

  • uids (Union[NDArray[np.int64], torch.LongTensor, list]) – The uint64 uids of destination neurons.

  • weights (Union[NDArray[np.float32], torch.FloatTensor, list]) – The weights to set. These must be float s and correspond to the passed uid s.

  • version_key (int) – The version key of the validator.

  • wait_for_inclusion (bool) – If set, waits for the extrinsic to enter a block before returning true, or returns false if the extrinsic fails to enter the block within the timeout.

  • wait_for_finalization (bool) – If set, waits for the extrinsic to be finalized on the chain before returning true, or returns false if the extrinsic fails to be finalized within the timeout.

  • prompt (bool) – If true, the call waits for confirmation from the user before proceeding.

Returns:

Flag is true if extrinsic was finalized or included in the block. If we did not wait for finalization / inclusion, the response is true.

Return type:

success (bool)