(self, *args, **kwargs)
Abstract train step function, traced at the beginning of training.

        A typical implementation for a classifier could be
        ```
        class Classifier(BaseModel):

            def _train_step_implementation(
                self,
                image: Tensor,
                label: Tensor,
                opt: Optimizer = None
            ):
                logits = self.forward(image)
                loss = F.cross_entropy_with_softmax(logits, label)
                if opt is not None:
                    opt.zero_grad()
                    opt.backward(loss)
                    opt.step()
        ```

        This implementation is wrapped in a `megengine.jit.trace` object, which equals to
        something like
        ```
        @jit.trace
        def train_step(image, label, opt=None):
            return _train_step_implemenation(image, label, opt=opt)
        ```

        And we call `model.train_step(np_image, np_label, opt=sgd_optimizer)` to
        perform the wrapped training step.
Abstract train step function, traced at the beginning of training.
Abstract train step function traced at the beginning of training .
def _train_step_implementation(self, *args, **kwargs):
        """Abstract train step function, traced at the beginning of training.

        A typical implementation for a classifier could be
        ```
        class Classifier(BaseModel):

            def _train_step_implementation(
                self,
                image: Tensor,
                label: Tensor,
                opt: Optimizer = None
            ):
                logits = self.forward(image)
                loss = F.cross_entropy_with_softmax(logits, label)
                if opt is not None:
                    opt.zero_grad()
                    opt.backward(loss)
                    opt.step()
        ```

        This implementation is wrapped in a `megengine.jit.trace` object, which equals to
        something like
        ```
        @jit.trace
        def train_step(image, label, opt=None):
            return _train_step_implemenation(image, label, opt=opt)
        ```

        And we call `model.train_step(np_image, np_label, opt=sgd_optimizer)` to
        perform the wrapped training step.
        """
        raise NotImplementedError
def _train_step_implementation ( self , * args , * * kwargs ) : raise NotImplementedError