class_docstr: `StochasticBlock` extends `HybridBlock` to support accumulating loss
  in the forward phase, which is extremely useful in building Bayesian Neural Network,
  where the loss function is composed of a classification loss and a KL loss.
class_docstr_tok: ["`","StochasticBlock","`","extends","`","HybridBlock","`","to","support","accumulating","loss","in","the","forward","phase",",","which","is","extremely","useful","in","building","Bayesian","Neural","Network",",","where","the","loss","function","is","composed","of","a","classification","loss","and","a","KL","loss","."]
code: def __call__(self, *args, **kwargs):
      # pylint: disable=arguments-differ
      self._flag = False
      out = super().__call__(*args, **kwargs)
      if not self._flag:
          raise ValueError(
              "The forward function should be decorated by "
              + "StochasticBlock.collectLoss"
          )
      self._losses = out[1]
      return out[0]
  
file_path: mxnet/python/mxnet/gluon/probability/block/stochastic_block.py
imports: from functools import wraps
  from ...block import HybridBlock
  from ...utils import _indent
label_desc: Use image node_id 4 for calling the StochasticBlock obj's underlying member method code with example usage: obj.__call__() and returns: out