Skip to content

Commit b609d63

Browse files
andrewzhaoluo (generated by with_the_same_user script)AndrewZhaoLuo
authored andcommitted
move thing in range
1 parent 3b3c685 commit b609d63

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/python/relay/test_pass_fake_quantization_to_integer.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -305,14 +305,14 @@ def test_fake_quantize_global_avg_pool():
305305

306306

307307
def test_fake_quantize_rsqrt():
308-
x = relay.var("x", shape=[1, 3, 224, 224], dtype="int8")
309-
zero = relay.const(0)
308+
x = relay.var("x", shape=[1, 3, 3, 3], dtype="int8")
309+
mid_point = relay.const(-128)
310310

311-
x = relay.qnn.op.dequantize(x, relay.const(2.0), zero)
311+
x = relay.qnn.op.dequantize(x, relay.const(0.125), mid_point)
312312
op = relay.rsqrt(x)
313-
op = relay.qnn.op.quantize(op, relay.const(2.0), zero)
313+
op = relay.qnn.op.quantize(op, relay.const(0.125), mid_point)
314314

315-
x_np = np.random.randint(-128, 127, size=[1, 3, 224, 224], dtype="int8")
315+
x_np = np.random.randint(-128, 127, size=[1, 3, 3, 3], dtype="int8")
316316

317317
compare_fq_to_int(op, [x_np], True)
318318

0 commit comments

Comments
 (0)