MCPcopy Create free account
hub / github.com/pytorch/pytorch / _apply_dropout

Method _apply_dropout

caffe2/python/rnn_cell.py:874–886  ·  view source on GitHub ↗
(self, model, output)

Source from the content-addressed store, hash-verified

872 return output
873
874 def _apply_dropout(self, model, output):
875 if self.dropout_ratio and not self.forward_only:
876 with core.NameScope(self.name or ''):
877 output = brew.dropout(
878 model,
879 output,
880 str(output) + '_with_dropout_mask{}'.format(self.mask),
881 ratio=float(self.dropout_ratio),
882 is_test=self.is_test,
883 use_cudnn=self.use_cudnn,
884 )
885 self.mask += 1
886 return output
887
888
889class MultiRNNCellInitializer:

Callers 2

_prepare_outputMethod · 0.95

Calls 1

formatMethod · 0.45

Tested by

no test coverage detected