Skip to content

Commit 1bcaade

Browse files
committed
[CI] Bump black version to 22.3.0
* Make all required adjusts in the code to comply with the new version * Upadte ci-lint to v0.71, based on tlcpackstaging/ci_lint:20220411-060305-45f3d4a52
1 parent 45f3d4a commit 1bcaade

36 files changed

+88
-92
lines changed

Jenkinsfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@
4545
// 'python3 jenkins/generate.py'
4646
// Note: This timestamp is here to ensure that updates to the Jenkinsfile are
4747
// always rebased on main before merging:
48-
// Generated at 2022-04-07T13:50:22.427152
48+
// Generated at 2022-04-11T10:45:26.226802
4949

5050
import org.jenkinsci.plugins.pipeline.modeldefinition.Utils
5151
// NOTE: these lines are scanned by docker/dev_common.sh. Please update the regex as needed. -->
52-
ci_lint = 'tlcpack/ci-lint:v0.69'
52+
ci_lint = 'tlcpack/ci-lint:v0.71'
5353
ci_gpu = 'tlcpack/ci-gpu:v0.84'
5454
ci_cpu = 'tlcpack/ci-cpu:v0.83'
5555
ci_wasm = 'tlcpack/ci-wasm:v0.73'

apps/topi_recipe/gemm/android_gemm_square.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535

3636
def ngflops(N):
37-
return 2.0 * float(N * N * N) / (10 ** 9)
37+
return 2.0 * float(N * N * N) / (10**9)
3838

3939

4040
dtype = "float32"

jenkins/Jenkinsfile.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ import org.jenkinsci.plugins.pipeline.modeldefinition.Utils
5151
{% import 'jenkins/macros.j2' as m with context -%}
5252

5353
// NOTE: these lines are scanned by docker/dev_common.sh. Please update the regex as needed. -->
54-
ci_lint = 'tlcpack/ci-lint:v0.69'
54+
ci_lint = 'tlcpack/ci-lint:v0.71'
5555
ci_gpu = 'tlcpack/ci-gpu:v0.84'
5656
ci_cpu = 'tlcpack/ci-cpu:v0.83'
5757
ci_wasm = 'tlcpack/ci-wasm:v0.73'

python/tvm/autotvm/task/space.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def get_pow2s(n):
187187
factors: list
188188
List of all power-of-two numbers
189189
"""
190-
return [2 ** x for x in range(math.floor(math.log2(n)) + 1)]
190+
return [2**x for x in range(math.floor(math.log2(n)) + 1)]
191191

192192

193193
class SplitSpace(TransformSpace):

python/tvm/contrib/debugger/debug_result.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def dump_chrome_trace(self):
154154
"""Dump the trace to the Chrome trace.json format."""
155155

156156
def s_to_us(t):
157-
return t * 10 ** 6
157+
return t * 10**6
158158

159159
starting_times = np.zeros(len(self._time_list) + 1)
160160
starting_times[1:] = np.cumsum([times[0] for times in self._time_list])

python/tvm/relay/frontend/paddlepaddle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ def convert_gelu(g, op, block):
658658
x = g.get_node(op.input("X")[0])
659659
out = x * (
660660
_expr.const(0.5, dtype="float32")
661-
+ _op.erf(x * _expr.const(0.5 ** 0.5, dtype="float32")) * _expr.const(0.5, dtype="float32")
661+
+ _op.erf(x * _expr.const(0.5**0.5, dtype="float32")) * _expr.const(0.5, dtype="float32")
662662
)
663663
g.add_node(op.output("Out")[0], out)
664664

python/tvm/relay/frontend/pytorch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@ def gelu(self, inputs, input_types):
827827
# with tanh and third order polynomials, but this is "true" gelu
828828
return data * (
829829
_expr.const(0.5, dtype=dtype)
830-
+ _op.erf(data * _expr.const(0.5 ** 0.5, dtype=dtype)) * _expr.const(0.5, dtype=dtype)
830+
+ _op.erf(data * _expr.const(0.5**0.5, dtype=dtype)) * _expr.const(0.5, dtype=dtype)
831831
)
832832

833833
def selu(self, inputs, input_types):

python/tvm/relay/qnn/op/canonicalizations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def create_integer_lookup_table(
7575
# inputs_quantized = np.array(range(dtype_info.min, dtype_info.max + 1)).astype(in_dtype)
7676

7777
# First generate a list of all num_bit integer patterns
78-
inputs_quantized = np.array(range(0, 2 ** num_bits), dtype=f"uint{num_bits}")
78+
inputs_quantized = np.array(range(0, 2**num_bits), dtype=f"uint{num_bits}")
7979

8080
# Reinterpret bits as the real datatype
8181
# Note what we are doing here is a bit tricky, the canonical view of our lookup table

python/tvm/relay/quantize/_calibrate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def visit_func(expr):
159159
def _make_const(val):
160160
return _expr.const(val, "float32")
161161

162-
valid_range = 2 ** valid_bit
162+
valid_range = 2**valid_bit
163163
const_params[ndom_scale] = _make_const(scale / valid_range)
164164
const_params[nclip_min] = _make_const(-(valid_range - 1))
165165
const_params[nclip_max] = _make_const((valid_range - 1))

python/tvm/relay/testing/tf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ def pick_from_weight(weight, pows=1.0):
321321
"""Identify token from Softmax output.
322322
This token will be mapped to word in the vocabulary.
323323
"""
324-
weight = weight ** pows
324+
weight = weight**pows
325325
t = np.cumsum(weight)
326326
s = np.sum(weight)
327327
return int(np.searchsorted(t, 0.5 * s))

0 commit comments

Comments
 (0)