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

Function maskNallocate

caffe2/experiments/python/SparseTransformer.py:57–70  ·  view source on GitHub ↗

Combine mask and weights create wcsr, iw, jw, return their names

(weight_name)

Source from the content-addressed store, hash-verified

55
56
57def maskNallocate(weight_name):
58 """
59 Combine mask and weights
60 create wcsr, iw, jw, return their names
61 """
62 w = workspace.FetchBlob(weight_name)
63 w_csr = scipy.sparse.csr_matrix(w)
64 wcsr = w_csr.data
65 iw = w_csr.indptr
66 jw = w_csr.indices
67 workspace.FeedBlob(weight_name + "wcsr", wcsr)
68 workspace.FeedBlob(weight_name + "iw", iw)
69 workspace.FeedBlob(weight_name + "jw", jw)
70 return weight_name + "wcsr", weight_name + "iw", weight_name + "jw"
71
72
73def transFCRelu(cur, id2node, name2id, ops, model):

Callers 1

transFCReluFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…