class_docstr: Defines Monte Carlo dropout Module as defined
  in the paper https://arxiv.org/pdf/1506.02142.pdf.
  In summary, This technique uses the regular dropout
  which can be interpreted as a Bayesian approximation of
  a well-known probabilistic model: the Gaussian process.
  We can treat the many different networks
  (with different neurons dropped out) as Monte Carlo samples
  from the space of all available models. This provides mathematical
  grounds to reason about the model’s uncertainty and, as it turns out,
  often improves its performance.
code: def train(self, mode: bool = True):
      # NOTE: we could use the line below if self.mc_dropout_rate represented
      # a rate to be applied at inference time, and self.applied_rate the
      # actual rate to be used in self.forward(). However, the original paper
      # considers the same rate for training and inference; we also stick to this.
  
      # self.applied_rate = self.p if mode else self.mc_dropout_rate
  
      if mode:  # in train mode, keep dropout as is
          self.mc_dropout_enabled = True
  
file_path: darts/darts/utils/torch.py
imports: from functools import wraps
  from inspect import signature
  from typing import Any, Callable, TypeVar
  import torch.nn
  import torch.nn.functional
  from numpy.random import randint
  from sklearn.utils import check_random_state
  from torch import Tensor
  from torch.random import fork_rng, manual_seed
  from darts.logging import get_logger, raise_if_not
label_desc: Use image node_id 1 for calling the MonteCarloDropout obj's underlying member method code with example usage: obj.train(mode) without return types