MCPcopy
hub / github.com/ddbourgin/numpy-ml / torchify

Function torchify

numpy_ml/tests/nn_torch_models.py:17–18  ·  view source on GitHub ↗
(var, requires_grad=True)

Source from the content-addressed store, hash-verified

15
16
17def torchify(var, requires_grad=True):
18 return torch.autograd.Variable(torch.FloatTensor(var), requires_grad=requires_grad)
19
20
21def torch_gradient_generator(fn, **kwargs):

Callers 15

test_pad1DFunction · 0.85
extract_gradsMethod · 0.85
__init__Method · 0.85
forwardMethod · 0.85
forwardMethod · 0.85
extract_gradsMethod · 0.85
forwardMethod · 0.85
extract_gradsMethod · 0.85
forwardMethod · 0.85
forwardMethod · 0.85
forwardMethod · 0.85
forwardMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_pad1DFunction · 0.68