4af3f8bcc859276d2e40d2dad69fdec6bf373f72,python/dgl/backend/mxnet.py,,unpack,#Any#Any#,49
Before Change
return F.concat(*tensors, dim=0)
def unpack(x, indices_or_sections=1):
return th.split(x, indices_or_sections)
// TODO this doesn"t exist for symbol.
def shape(x):
return x.shape
After Change
def unpack(x, split_sizes_or_sections=1):
if isinstance(split_sizes_or_sections, list):
np_arr = x.asnumpy()
indices = np.cumsum(split_sizes_or_sections)
res = np.split(np_arr, indices[:-1])
return [tensor(arr, dtype=x.dtype) for arr in res]
else:
return F.split(x, split_sizes_or_sections)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: dmlc/dgl
Commit Name: 4af3f8bcc859276d2e40d2dad69fdec6bf373f72
Time: 2018-10-18
Author: zhengda1936@gmail.com
File Name: python/dgl/backend/mxnet.py
Class Name:
Method Name: unpack
Project Name: dmlc/dgl
Commit Name: 96984faca42c70440de09b0d8db5ab5ede73a5ca
Time: 2020-05-14
Author: zhengda1936@gmail.com
File Name: python/dgl/distributed/dist_graph.py
Class Name:
Method Name: _get_shared_mem_metadata
Project Name: dmlc/gluon-nlp
Commit Name: 02c0ef855321a2c9e681927b9cdaf0996c310893
Time: 2020-10-14
Author: xshiab@connect.ust.hk
File Name: tests/test_models.py
Class Name:
Method Name: test_get_backbone