Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
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
17
def
torchify(var, requires_grad=True):
18
return
torch.autograd.Variable(torch.FloatTensor(var), requires_grad=requires_grad)
19
20
21
def
torch_gradient_generator(fn, **kwargs):
Callers
15
test_pad1D
Function · 0.85
extract_grads
Method · 0.85
__init__
Method · 0.85
forward
Method · 0.85
forward
Method · 0.85
extract_grads
Method · 0.85
forward
Method · 0.85
extract_grads
Method · 0.85
forward
Method · 0.85
forward
Method · 0.85
forward
Method · 0.85
forward
Method · 0.85
Calls
no outgoing calls
Tested by
1
test_pad1D
Function · 0.68