You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In torchrl/objectives/value/utils.py#L287-L290, the code currently uses tensor.shape[-2] to choose between torch.int16 and torch.int32. This should use the time dimension (time_dim) instead, especially since it's used in _fast_td_lambda_return_estimate where the inputs are transposed first. As a result, the condition may be incorrect for certain input shapes (when the size of time_dim exceeds the int16 range, but F dimension of _fast_td_lambda_return_estimate inputs is within this range).
Code Reference:
# int16 supports length up to 32767
dtype = (
torch.int16 if tensor.shape[-2] < torch.iinfo(torch.int16).max else torch.int32
)
In torchrl/objectives/value/utils.py#L287-L290, the code currently uses
tensor.shape[-2]
to choose betweentorch.int16
andtorch.int32
. This should use the time dimension (time_dim
) instead, especially since it's used in_fast_td_lambda_return_estimate
where the inputs are transposed first. As a result, the condition may be incorrect for certain input shapes (when the size oftime_dim
exceeds theint16
range, butF
dimension of_fast_td_lambda_return_estimate
inputs is within this range).Code Reference:
Proposed Fix:
The text was updated successfully, but these errors were encountered: