Skip to content

Commit

Permalink
(#4) Refactor: Dataset abstraction
Browse files Browse the repository at this point in the history
  • Loading branch information
betarixm committed Mar 23, 2022
1 parent 71fc88d commit e5d8de2
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/typings/dataset.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from abc import ABC, abstractmethod
from typing import NewType

import tensorflow as tf

TestSet = NewType("TestSet", tf.data.Dataset)
TrainSet = NewType("TrainSet", tf.data.Dataset)


class Dataset(ABC):
@staticmethod
@abstractmethod
def dataset() -> (TestSet, TrainSet):
pass

def __new__(cls, *args, **kwargs):
return cls.dataset()

0 comments on commit e5d8de2

Please sign in to comment.