def _setup_model_loss(self, lr):
<EOL>if not hasattr(self, "<STR_LIT>"):<EOL><INDENT>self.loss = SoftCrossEntropyLoss()<EOL><DEDENT>if not hasattr(self, "<STR_LIT>"):<EOL><INDENT>self.optimizer = optim.Adam(self.parameters(), lr=lr)<EOL><DEDENT>
Setup loss and optimizer for PyTorch model.