-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restructure Abstract UDF classes to allow for the future addition of EVA transforms #296
Conversation
Protocol is not available in python 3.7
Not every UDF will accept or output np arrays so ArrayLike is a better type.
do we need |
@LordDarkula @gaurav274 Is it possible to use some kind of |
I assume you mean allow the user to just use a torchvision transform directly in EVA instead of having to explicitly subclass PytorchAbstractUDF. Assuming we want EVA to be type-safe, we could use a Protocol (https://peps.python.org/pep-0544/). However, this feature was introduced in Python 3.8 and EVA supports earlier versions of Python. |
This looks more like the approach I suggested: |
Create
AbstractUDF
base class and updateAbstractClassifierUDF
base class to inherit from itCreate
AbstractTransformationUDF
base classCreate
PytorchAbstractTransformationUDF
to combine torchvision transforms andAbstractTransformationUDF
Rename
PytorchAbstractUDF
toPytorchClassifierAbstractUDF