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 add_loss(self, loss):
      self._losscache.append(loss)
  
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 2 for calling the StochasticBlock obj's underlying member method code with example usage: obj.add_loss(loss) without return types