Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes redundant assignments in Metagraph #2680

Merged
merged 2 commits into from
Feb 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions bittensor/core/metagraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,14 +773,6 @@ def _set_metagraph_attributes(self, block: int):
[neuron.validator_trust for neuron in self.neurons],
dtype=self._dtype_registry["float32"],
)
self.total_stake = self._create_tensor(
[neuron.total_stake.tao for neuron in self.neurons],
dtype=self._dtype_registry["float32"],
)
self.stake = self._create_tensor(
[neuron.stake.tao for neuron in self.neurons],
dtype=self._dtype_registry["float32"],
)
self.axons = [n.axon_info for n in self.neurons]

def save(self, root_dir: Optional[list[str]] = None) -> "MetagraphMixin":
Expand Down Expand Up @@ -1634,7 +1626,7 @@ def __init__(
subtensor: Optional["Subtensor"] = None,
):
super().__init__(netuid, network, lite, sync, subtensor)
if sync:
if self.should_sync:
self.sync()

def sync(
Expand Down
Loading