I am tracing a model to export it to c++ via the command:
torch.jit.trace(model.eval(), example_inp).
Does the tracing done as above still work if I include in the forward pass of the model something like the following code snippet?
def forward(self,x):
if self.eval:
return x + 5
else:
return x
Or I have to go through annotation to export the model even with this minimal control flow?