Skip to main content

PyTorchData

PyTorchData Objects

class PyTorchData(Subscriptable)

Class to wrap around a Dataset retrieved from PyTorch datasets

The dataset in this case can be iterated over. So the only thing that needs to be implemented is generate_query, which takes an index and returns a query.

note

This class should be subclassed with a specific (custom) implementation of generate_query().

Example subclass: CocoDataPyTorch

generate_query

def generate_query(idx: int) -> Tuple[List[dict], List[bytes]]

Takes information from one atomic record from the Data and converts it to Query for apertureDB

Arguments:

  • idx int - index of the record in collection.

Raises:

  • Exception - description

Returns:

Tuple[List[dict], List[bytes]]: A pair of list of commands and optional list of blobs to go with them.