Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Features] Conv3dNet and PermuteTransform #1398

Merged
merged 15 commits into from
Sep 16, 2023
Prev Previous commit
Next Next commit
dims check
Co-authored-by: Vincent Moens <[email protected]>
  • Loading branch information
xmaples and vmoens committed Jul 20, 2023
commit 8ddbc092227f6b724c7f84ff24495f5d219d54a8
5 changes: 4 additions & 1 deletion torchrl/modules/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,10 @@ def _make_net(self, device: Optional[DEVICE_TYPING]) -> nn.Module:
return layers

def forward(self, inputs: torch.Tensor) -> torch.Tensor:
*batch, C, D, L, W = inputs.shape
try:
*batch, C, D, L, W = inputs.shape
except ValueError as err:
raise ValueError(f"The input value of {self.__class__.__name__} must have at least 4 dimensions, got {inputs.ndim} instead.") from err
if len(batch) > 1:
inputs = inputs.flatten(0, len(batch) - 1)
out = super().forward(inputs)
Expand Down
Loading