[Feature Request] tensordict.entry_dtype(entry)
, tensordict.entry_device(entry)
#169
Labels
enhancement
New feature or request
Motivation
In #168 we introduce
tensordict._entry_class
. Maybe it would make sense to have the same fordtype
anddevice
to avoid doing things likeif tensordict.get(key).dtype is torch.float32
.These methods should be made public and documented.
We should find a proper way to do it with lazy tensordicts (especially stack). One option would be to take the first tensordict of the list and query that method on it, implicitely assuming that homogeneous tensordicts have been stacked. This is prone bug if one stacks tensordicts with varying dtypes but that's a behaviour that is not supported anyway (as usual: do we want to apply expensive checks or just tell the users to be cautious because we don't?)
cc @tcbegley
cc @matteobettini fyi since this implies lazy-stacked tds
The text was updated successfully, but these errors were encountered: