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

Method extend

python/dgl/frame.py:392–413  ·  view source on GitHub ↗

Extend the feature data. The operation triggers index selection. Parameters ---------- feats : Tensor The new features. feat_scheme : Scheme, optional The scheme

(self, feats, feat_scheme=None)

Source from the content-addressed store, hash-verified

390 self.data = F.scatter_row(self.data, rowids, feats)
391
392 def extend(self, feats, feat_scheme=None):
393 """Extend the feature data.
394
395 The operation triggers index selection.
396
397 Parameters
398 ----------
399 feats : Tensor
400 The new features.
401 feat_scheme : Scheme, optional
402 The scheme
403 """
404 if feat_scheme is None:
405 feat_scheme = infer_scheme(feats)
406
407 if feat_scheme != self.scheme:
408 raise DGLError(
409 "Cannot update column of scheme %s using feature of scheme %s."
410 % (feat_scheme, self.scheme)
411 )
412
413 self.data = F.cat([self.data, feats], dim=0)
414
415 def clone(self):
416 """Return a shallow copy of this column."""

Callers 15

_appendMethod · 0.80
pad_packed_tensorFunction · 0.80
pack_padded_tensorFunction · 0.80
_distributed_accessFunction · 0.80
processMethod · 0.80
processMethod · 0.80
processMethod · 0.80
processMethod · 0.80
process_raw_tuplesMethod · 0.80
shortest_distFunction · 0.80
find_lib_pathFunction · 0.80
create_test_heterograph1Function · 0.80

Calls 2

infer_schemeFunction · 0.85
DGLErrorClass · 0.85

Tested by 2

create_test_heterograph1Function · 0.64