of_batch
- class OFBatch(*args: Any, **kwargs: Any)[source]
A batch object for OFData.
Copied from torch_geometric.data.Batch with the addition of the list_keys attribute, which just appends attributes to a list instead of collating them, which is needed for square matrices of varying size.
- classmethod from_data_list(data_list: List[BaseData], follow_batch: List[str] | None = None, exclude_keys: List[str] | None = None, list_keys: Sequence[str] | None = None) Self[source]
Constructs a
Batchobject from a list ofDataorHeteroDataobjects.The assignment vector
batchis created on the fly. In addition, creates assignment vectors for each key infollow_batch. Will exclude any keys given inexclude_keys. Keys inlist_keyswill be appended to a list instead of collated (useful for square matrices of varying size).
- class OFCollater(dataset: Dataset | Sequence[BaseData] | DatasetAdapter, follow_batch: List[str] | None = None, exclude_keys: List[str] | None = None, list_keys: Sequence[str] | None = None)[source]
Collater for OF-DFT data.
Copy paste from torch_geometric.data.collate.Collater except for using our custom OFBatch and the list_keys attribute.
- collate(cls: Type[T], data_list: List[BaseData], increment: bool = True, add_batch: bool = True, follow_batch: Iterable[str] | None = None, exclude_keys: Iterable[str] | None = None, list_keys: Sequence[str] | None = None) Tuple[T, Dict[str, Tensor | Dict[str, Tensor]], Dict[str, Tensor | Dict[str, Tensor]]][source]
Collates a list of data objects into a single object of type cls.
collate can handle both homogeneous and heterogeneous data objects by individually collating all their stores. In addition, collate can handle nested data structures such as dictionaries and lists.