예제 #1
0
 def forward(self, visual_obs: torch.Tensor) -> torch.Tensor:
     hidden = self.conv_layers(visual_obs)
     hidden = torch.reshape(hidden, (-1, self.final_flat))
     return self.dense(hidden)
예제 #2
0
 def forward(self, visual_obs: torch.Tensor) -> torch.Tensor:
     if not exporting_to_onnx.is_exporting():
         visual_obs = visual_obs.permute([0, 3, 1, 2])
     hidden = self.conv_layers(visual_obs)
     hidden = torch.reshape(hidden, (-1, self.final_flat))
     return self.dense(hidden)