Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
vmoens committed Aug 5, 2024
1 parent e76d8cb commit 4af379a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion torchrl/data/tensor_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4118,10 +4118,11 @@ def type_check(
self._specs[_key].type_check(value[_key], _key)

def is_in(self, val: Union[dict, TensorDictBase]) -> bool:
print(val)
for key, item in self._specs.items():
if item is None or (isinstance(item, CompositeSpec) and item.is_empty()):
continue
val_item = val[key]
val_item = val.get(key, NO_DEFAULT)
if not item.is_in(val_item):
return False
return True
Expand Down

0 comments on commit 4af379a

Please sign in to comment.