Skip to content

Module bastionlab.torch.data

Classes

RemoteDataset()

RemoteDataset(inputs: List[bastionlab.torch.data.RemoteTensor], labels: bastionlab.torch.data.RemoteTensor, name: Optional[str] = 'RemoteDataset', description: Optional[str] = 'RemoteDataset', privacy_limit: Optional[float] = -1.0, identifier: Optional[str] = '')

Class variables

description: Optional[str] :

identifier: Optional[str] :

inputs: List[bastionlab.torch.data.RemoteTensor] :

labels: bastionlab.torch.data.RemoteTensor :

name: Optional[str] :

privacy_limit: Optional[float] :

Instance variables

input_dtype: torch.dtype
The input dtype of the tensors stored
nb_samples: int
The number of samples in the RemoteDataset
RemoteTensor()

BastionLab reference to a PyTorch (tch) Tensor on the server.

It also stores a few basic information about the tensor (dtype, shape).

You can also change the dtype of the tensor through an API call

Instance variables

dtype: torch.dtype
Returns the torch dtype of the corresponding tensor

identifier: str :

shape
Returns the torch Size of the corresponding tensor

Methods

to(self, dtype:Β torch.dtype)

Performs Tensor dtype conversion.

Args: dtype: torch.dtype The resulting torch.dtype