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

Function _batcher

python/dgl/convert.py:1246–1253  ·  view source on GitHub ↗
(lst)

Source from the content-addressed store, hash-verified

1244
1245
1246def _batcher(lst):
1247 if F.is_tensor(lst[0]):
1248 return F.cat([F.unsqueeze(x, 0) for x in lst], dim=0)
1249
1250 if isinstance(lst[0], np.ndarray):
1251 return F.tensor(np.array(lst))
1252
1253 return F.tensor(lst)
1254
1255
1256def from_networkx(

Callers 2

from_networkxFunction · 0.85
bipartite_from_networkxFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected