(
self,
tensordict,
)
| 285 | |
| 286 | |
| 287 | def _loss_actor( |
| 288 | self, |
| 289 | tensordict, |
| 290 | ) -> torch.Tensor: |
| 291 | td_copy = tensordict.select(*self.actor_in_keys) |
| 292 | # Get an action from the actor network: since we made it functional, we need to pass the params |
| 293 | with self.actor_network_params.to_module(self.actor_network): |
| 294 | td_copy = self.actor_network(td_copy) |
| 295 | # get the value associated with that action |
| 296 | with self.value_network_params.detach().to_module(self.value_network): |
| 297 | td_copy = self.value_network(td_copy) |
| 298 | return -td_copy.get("state_action_value") |
| 299 | |
| 300 | |
| 301 | ############################################################################### |
nothing calls this directly
no outgoing calls
no test coverage detected