Skip to content

[BUG] _td.py uses comparison of lists as truth value without calling any/all #1476

@pancan21

Description

@pancan21

Describe the bug

tensordict/tensordict/_td.py

Lines 2581 to 2582 in f7b5e05

is_diff = dest[idx].tolist() != value.tolist()
if is_diff:

To Reproduce

This is a logic error nothing required to reproduce just look at the code.

Reason and Possible fixes

I assume using any() would recreate the intended behavior.

Checklist

  • I have checked that there is no similar issue in the repo (required)
  • I have read the documentation (required)
  • I have provided a minimal working example to reproduce the bug (required)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions