MCPcopy Create free account
hub / github.com/OUCMachineLearning/OUCML / mask2d

Function mask2d

AutoML/darts-master/rnn/utils.py:87–92  ·  view source on GitHub ↗
(B, D, keep_prob, cuda=True)

Source from the content-addressed store, hash-verified

85
86
87def mask2d(B, D, keep_prob, cuda=True):
88 m = torch.floor(torch.rand(B, D) + keep_prob) / keep_prob
89 m = Variable(m, requires_grad=False)
90 if cuda:
91 m = m.cuda()
92 return m
93

Callers 1

forwardMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected