xref: /aosp_15_r20/external/pytorch/test/jit/myfunction_b.py (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1*da0073e9SAndroid Build Coastguard Workerr"""
2*da0073e9SAndroid Build Coastguard WorkerHelper function used in test_decorator.py. We define it in a
3*da0073e9SAndroid Build Coastguard Workerseparate file on purpose to test that the names in different modules
4*da0073e9SAndroid Build Coastguard Workerare resolved correctly.
5*da0073e9SAndroid Build Coastguard Worker"""
6*da0073e9SAndroid Build Coastguard Worker
7*da0073e9SAndroid Build Coastguard Workerfrom jit.mydecorator import my_decorator
8*da0073e9SAndroid Build Coastguard Worker
9*da0073e9SAndroid Build Coastguard Worker
10*da0073e9SAndroid Build Coastguard Worker@my_decorator
11*da0073e9SAndroid Build Coastguard Workerdef my_function_b(x: float) -> float:
12*da0073e9SAndroid Build Coastguard Worker    return my_function_c(x) + 2
13*da0073e9SAndroid Build Coastguard Worker
14*da0073e9SAndroid Build Coastguard Worker
15*da0073e9SAndroid Build Coastguard Workerdef my_function_c(x: float) -> float:
16*da0073e9SAndroid Build Coastguard Worker    return x + 3
17