Skip to content

Commit

Permalink
replace torch.inf with math.inf
Browse files Browse the repository at this point in the history
  • Loading branch information
biphasic committed Apr 5, 2023
1 parent 0d47a77 commit 154d84a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test_synops_counter.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import math

import numpy as np
import pytest
import torch
Expand Down Expand Up @@ -98,7 +100,7 @@ def test_linear_synops_counter():
# (3 + 5) spikes * 5 channels, over 2 samples
assert model_stats["synops"] == 20
assert layer_stats["synops"] == 20
assert layer_stats["SynOps/s"] == torch.inf
assert layer_stats["synops/s"] == math.inf


def test_linear_synops_counter_with_time():
Expand All @@ -111,7 +113,7 @@ def test_linear_synops_counter_with_time():
model(input_)
layer_stats = analyzer.get_layer_statistics()["parameter"][""]

assert layer_stats["synops"] == layer_stats["SynOps/s"] * n_steps * dt / 1000
assert layer_stats["synops"] == layer_stats["synops/s"] * n_steps * dt / 1000


def test_linear_synops_counter_across_batches():
Expand Down

0 comments on commit 154d84a

Please sign in to comment.