the code i want to use has an arrow operator ("->") on their definition of the function
I understand what this operator meaning as the pre-specifiation of in/output variable type.
but i don’t know how to call this to refer/search the document. the first question is (1) what is the name of this operator or this rule?
and as my code described below, this function has different number of outputs depending on the name of the class. the error msg is
*** TypeError: dropout(): argument ‘input’ (position 1) must be Tensor, not tuple
i think the reason is pre-specifiation of the output as only “Tensor”. the second question is … (2) how can i fix it?
def forward(self, inputs: Tensor, masks: Optional[Tensor] = None) -> Tensor:
if self.module.__class__.__name__ is 'CLASSNAME_1':
out_x, out_y = self.module(inputs, masks)
return out_x, out_y
else:
out = self.module(inputs)
return out