def forward(self, x: Tensor) -> InceptionOutputs: x = self._transform_input(x) x, aux = self._forward(x) aux_defined = self.training and self.aux_logits if torch.jit.is_scripting(): if not aux_defined: warnings.warn("Scripted Inception3 always returns Inception3 Tuple") return InceptionOutputs(x, aux) else: return self.eager_outputs(x, aux)
def eager_outputs(self, x: Tensor, aux: Optional[Tensor]) -> InceptionOutputs: if self.training and self.aux_logits: return InceptionOutputs(x, aux) else: return x # type: ignore[return-value]