We can customize module’s behavior for train and eval using self.training in pytorch. How to do this in mxnet?

class AddGNoise(torch.nn.Module):

    def __init__(self, mean=0, stddev=1):
        super(AddGNoise, self).__init__()
        self.mean = mean
        self.stddev = stddev

    def forward(self, X):
        if self.training:
            return X + torch.empty(X.shape).normal_(mean=self.mean,std=self.stddev)
        return X

We can use self.training in pytorch, how to do this in mxnet?