-
Notifications
You must be signed in to change notification settings - Fork 0
/
test2.py
31 lines (25 loc) · 827 Bytes
/
test2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from collections import OrderedDict
import pandas as pd
from evadb.functions.abstract.pytorch_abstract_function import (
PytorchAbstractClassifierFunction,
)
from evadb.utils.generic_utils import try_to_import_torch, try_to_import_torchvision
import pandas as pd
class ReturnOneFunction(PytorchAbstractClassifierFunction):
# Setup function
@setup(cacheable=True, function_type="custom", batchable=True)
def setup(self):
pass
# Forward function
@forward(
input_signatures=[], # No input
output_signatures=[
PandasDataframe(
columns=["result"],
column_types=[NdArrayType.INT32],
column_shapes=[(1,)]
)
]
)
def forward(self) -> pd.DataFrame:
return pd.DataFrame({"result": [1]})