Skip to content
Snippets Groups Projects
Commit 552a1ae3 authored by Tamino Huxohl's avatar Tamino Huxohl
Browse files

add abstract transform module

parent 2ae5e9e3
No related branches found
No related tags found
No related merge requests found
from typing import List, Tuple
from torch import Tensor
class Transform:
def __call__(
self, inputs: Tensor, outputs_expected: Tensor
) -> Tuple[Tensor, Tensor]:
return inputs, outputs_expected
class SequenceTransform(Transform):
def __init__(self, transforms: List[Transform]):
self.transforms = transforms
def __call__(
self, inputs: Tensor, outputs_expected: Tensor
) -> Tuple[Tensor, Tensor]:
for transforms in self.transforms:
inputs, outputs_expected = transforms(inputs, outputs_expected)
return inputs, outputs_expected
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment