Skip to content

Commit

Permalink
[BugFix] Better comparison of tensorclasses
Browse files Browse the repository at this point in the history
ghstack-source-id: 8def6f01f2b6d09714319a56f96b166ac1fd49d5
Pull Request resolved: #1137
  • Loading branch information
vmoens committed Dec 12, 2024
1 parent d7506c4 commit eb4a56e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tensordict/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1548,6 +1548,11 @@ def assert_close(

from tensordict._lazy import LazyStackedTensorDict

if is_tensorclass(actual):
actual = actual._tensordict
if is_tensorclass(expected):
expected = expected._tensordict

if isinstance(actual, LazyStackedTensorDict) and isinstance(
expected, LazyStackedTensorDict
):
Expand Down

1 comment on commit eb4a56e

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'GPU Benchmark Results'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: eb4a56e Previous: d7506c4 Ratio
benchmarks/common/common_ops_test.py::test_membership_stacked_nested_last 127285.04251738776 iter/sec (stddev: 5.809995989755761e-7) 279358.31831664284 iter/sec (stddev: 4.7382331178825414e-7) 2.19
benchmarks/common/common_ops_test.py::test_membership_stacked_nested_leaf_last 126981.82559235435 iter/sec (stddev: 5.167689590897718e-7) 276921.25579035835 iter/sec (stddev: 3.8945214447507207e-7) 2.18

This comment was automatically generated by workflow using github-action-benchmark.

CC: @vmoens

Please sign in to comment.