Subset๏ƒ

class dgl.data.utils.Subset(dataset, indices)[source]๏ƒ

Bases: object

Subset of a dataset at specified indices

Code adapted from PyTorch.

Parameters:
  • dataset โ€“ dataset[i] should return the ith datapoint

  • indices (list) โ€“ List of datapoint indices to construct the subset

__getitem__(item)[source]๏ƒ

Get the datapoint indexed by item

Returns:

datapoint

Return type:

tuple

__len__()[source]๏ƒ

Get subset size

Returns:

Number of datapoints in the subset

Return type:

int