def forward(self, observations, input_actions=None):
observations = self.input_block(observations)<EOL>if input_actions is not None:<EOL><INDENT>actions = input_actions<EOL>value_input = torch.cat([observations, actions], dim=<NUM_LIT:1>)<EOL>value_hidden = self.value_backbone(value_input)<EOL>values = self.critic_head(value_hidden)<EOL><DEDENT>else:<EOL><INDENT>policy_hidden = self.policy_backbone(observations)<EOL>actions = self.action_head(policy_hidden)<EOL>value_input = torch.cat([observations, actions], dim=<NUM_LIT:1>)<EOL>value_hidden = self.value_backbone(value_input)<EOL>values = self.critic_head(value_hidden)<EOL><DEDENT>return actions, values<EOL>
Calculate model outputs