mirror of
https://github.com/IBM/ai-privacy-toolkit.git
synced 2026-07-23 17:01:03 +02:00
Bug fix for PytorchData dataset
This commit is contained in:
parent
1c4b963add
commit
bb224cd3dd
1 changed files with 3 additions and 3 deletions
|
|
@ -292,7 +292,7 @@ class PytorchData(Dataset):
|
||||||
:type idx: int
|
:type idx: int
|
||||||
:return: the sample as a pytorch Tensor
|
:return: the sample as a pytorch Tensor
|
||||||
"""
|
"""
|
||||||
return self.x[idx]
|
return self._x[idx]
|
||||||
|
|
||||||
def get_item(self, idx: int) -> Tensor:
|
def get_item(self, idx: int) -> Tensor:
|
||||||
"""
|
"""
|
||||||
|
|
@ -302,11 +302,11 @@ class PytorchData(Dataset):
|
||||||
:type idx: int
|
:type idx: int
|
||||||
:return: the sample and label as pytorch Tensors. Returned as a tuple (sample, label)
|
:return: the sample and label as pytorch Tensors. Returned as a tuple (sample, label)
|
||||||
"""
|
"""
|
||||||
sample, label = self.x[idx], self.y[idx]
|
sample, label = self._x[idx], self._y[idx]
|
||||||
return sample, label
|
return sample, label
|
||||||
|
|
||||||
def __len__(self):
|
def __len__(self):
|
||||||
return len(self.x)
|
return len(self._x)
|
||||||
|
|
||||||
|
|
||||||
class DatasetFactory:
|
class DatasetFactory:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue