Skip to content

Commit f300c70

Browse files
committed
Actually add new file
1 parent 65c4ad7 commit f300c70

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
6+
7+
from dataclasses import dataclass
8+
from abc import ABC, abstractmethod
9+
from typing import Sequence
10+
11+
12+
@dataclass
13+
class DecoderNativeTransform(ABC):
14+
"""TODO: docstring"""
15+
@abstractmethod
16+
def make_params(self) -> str:
17+
pass
18+
19+
20+
@dataclass
21+
class Resize(DecoderNativeTransform):
22+
"""
23+
TODO. One benefit of having parallel definitions is that it gives us a place
24+
to put documentation about what behavior we do and do not support. For
25+
example, we don't yet have fields for `interpolation` and `antialias`
26+
because we don't allow users to control those yet in decoder-native
27+
transforms.
28+
"""
29+
30+
# Also note that this type is more restrictive than what TorchVision
31+
# accepts, but it accurately reflects current decoder-native transform
32+
# limitations.
33+
size: Sequence[int]
34+
35+
def make_params(self) -> str:
36+
return f"resize, {self.size[0]}, {self.size[1]}"

0 commit comments

Comments
 (0)