MCPcopy
hub / github.com/dmlc/dgl / clone_detach_and_grad

Function clone_detach_and_grad

tests/python/pytorch/sparse/utils.py:10–13  ·  view source on GitHub ↗
(t)

Source from the content-addressed store, hash-verified

8
9
10def clone_detach_and_grad(t):
11 t = t.clone().detach()
12 t.requires_grad_()
13 return t
14
15
16def rand_stride(t):

Callers 5

sparse_matrix_to_denseFunction · 0.85
test_sddmmFunction · 0.85
test_bsddmmFunction · 0.85
test_spmmFunction · 0.85
test_bspmmFunction · 0.85

Calls 1

cloneMethod · 0.45

Tested by 4

test_sddmmFunction · 0.68
test_bsddmmFunction · 0.68
test_spmmFunction · 0.68
test_bspmmFunction · 0.68