8
8
9
9
import logging
10
10
import time
11
- from typing import Callable , Tuple
11
+ from typing import Callable
12
12
13
13
import click
14
14
import torch
25
25
26
26
27
27
def benchmark_hbc_function (
28
- func : Callable [[Tensor ], Tuple [Tensor , Tensor ]],
28
+ func : Callable [[Tensor ], tuple [Tensor , Tensor ]],
29
29
input : Tensor ,
30
- ) -> Tuple [float , Tensor ]:
30
+ ) -> tuple [float , Tensor ]:
31
31
if input .is_cuda :
32
32
torch .cuda .synchronize ()
33
33
start_event = torch .cuda .Event (enable_timing = True )
@@ -118,7 +118,7 @@ def cli(
118
118
[num_bins * (num_segments + 1 )], dtype = torch .float64
119
119
).fill_ (0.0 )
120
120
121
- def fbgemm_hbc_cpu (input : Tensor ) -> Tuple [Tensor , Tensor ]:
121
+ def fbgemm_hbc_cpu (input : Tensor ) -> tuple [Tensor , Tensor ]:
122
122
return torch .ops .fbgemm .histogram_binning_calibration (
123
123
input ,
124
124
bin_num_examples ,
@@ -130,7 +130,7 @@ def fbgemm_hbc_cpu(input: Tensor) -> Tuple[Tensor, Tensor]:
130
130
0.9995 ,
131
131
)
132
132
133
- def fbgemm_hbc_by_feature_cpu (input : Tensor ) -> Tuple [Tensor , Tensor ]:
133
+ def fbgemm_hbc_by_feature_cpu (input : Tensor ) -> tuple [Tensor , Tensor ]:
134
134
return torch .ops .fbgemm .histogram_binning_calibration_by_feature (
135
135
input ,
136
136
segment_values ,
@@ -146,7 +146,7 @@ def fbgemm_hbc_by_feature_cpu(input: Tensor) -> Tuple[Tensor, Tensor]:
146
146
0.9995 ,
147
147
)
148
148
149
- def fbgemm_generic_hbc_by_feature_cpu (input : Tensor ) -> Tuple [Tensor , Tensor ]:
149
+ def fbgemm_generic_hbc_by_feature_cpu (input : Tensor ) -> tuple [Tensor , Tensor ]:
150
150
return torch .ops .fbgemm .generic_histogram_binning_calibration_by_feature (
151
151
input ,
152
152
segment_values ,
@@ -186,7 +186,7 @@ def fbgemm_generic_hbc_by_feature_cpu(input: Tensor) -> Tuple[Tensor, Tensor]:
186
186
bin_num_examples_gpu : Tensor = bin_num_examples .cuda ()
187
187
bin_num_positives_gpu : Tensor = bin_num_positives .cuda ()
188
188
189
- def fbgemm_hbc_gpu (input : Tensor ) -> Tuple [Tensor , Tensor ]:
189
+ def fbgemm_hbc_gpu (input : Tensor ) -> tuple [Tensor , Tensor ]:
190
190
return torch .ops .fbgemm .histogram_binning_calibration (
191
191
input ,
192
192
bin_num_examples_gpu ,
@@ -206,7 +206,7 @@ def fbgemm_hbc_gpu(input: Tensor) -> Tuple[Tensor, Tensor]:
206
206
by_feature_bin_num_positives .cuda ()
207
207
)
208
208
209
- def fbgemm_hbc_by_feature_gpu (input : Tensor ) -> Tuple [Tensor , Tensor ]:
209
+ def fbgemm_hbc_by_feature_gpu (input : Tensor ) -> tuple [Tensor , Tensor ]:
210
210
return torch .ops .fbgemm .histogram_binning_calibration_by_feature (
211
211
input ,
212
212
segment_values_gpu ,
@@ -226,7 +226,7 @@ def fbgemm_hbc_by_feature_gpu(input: Tensor) -> Tuple[Tensor, Tensor]:
226
226
227
227
def fbgemm_generic_hbc_by_feature_gpu (
228
228
input : Tensor ,
229
- ) -> Tuple [Tensor , Tensor ]:
229
+ ) -> tuple [Tensor , Tensor ]:
230
230
return (
231
231
torch .ops .fbgemm .generic_histogram_binning_calibration_by_feature (
232
232
input ,
0 commit comments