Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions tests/python/frontend/onnx/test_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -2253,7 +2253,7 @@ def verify_where(condition, x, y, dtype, outdata, dynamic=False):

@tvm.testing.uses_gpu
def test_where():
condition = np.array([[1, 0], [1, 1]], dtype=np.bool)
condition = np.array([[1, 0], [1, 1]], dtype=bool)
x = np.array([[1, 2], [3, 4]], dtype=np.int64)
y = np.array([[9, 8], [7, 6]], dtype=np.int64)
outdata = np.where(condition, x, y)
Expand All @@ -2274,7 +2274,7 @@ def test_where():
outdata = np.where(condition, x, y)
verify_where(condition, x, y, TensorProto.FLOAT, outdata)

condition = np.array(1, dtype=np.bool)
condition = np.array(1, dtype=bool)
x = np.array([[1, 2], [3, 4]], dtype=np.float32)
y = np.array([[5, 6], [7, 8]], dtype=np.float32)
outdata = np.where(condition, x, y)
Expand Down Expand Up @@ -3922,7 +3922,7 @@ def verify_cond_loop():

trip_count = np.array(5).astype(np.int64)
res_y = np.array([13]).astype(np.float32)
cond = np.array(1).astype(np.bool)
cond = np.array(1).astype(bool)
loop_graph = onnx.helper.make_graph(
[loop_node],
"loop_outer",
Expand All @@ -3940,7 +3940,7 @@ def verify_cond_loop():

# Set a high trip count so that condition trips first.
trip_count = np.array(40).astype(np.int64)
cond = np.array(1).astype(np.bool)
cond = np.array(1).astype(bool)
input_vals = [trip_count, cond, y]
verify_with_ort_with_inputs(loop_model, input_vals, use_vm=True, freeze_params=True)

Expand Down Expand Up @@ -3978,7 +3978,7 @@ def verify_count_loop():

trip_count = np.array(5).astype(np.int64)
res_y = np.array([13]).astype(np.float32)
cond = np.array(1).astype(np.bool)
cond = np.array(1).astype(bool)
loop_graph = onnx.helper.make_graph(
[loop_node],
"loop_outer",
Expand All @@ -3995,7 +3995,7 @@ def verify_count_loop():
loop_model = onnx.helper.make_model(loop_graph)

trip_count = np.array(5).astype(np.int64)
cond = np.array(1).astype(np.bool)
cond = np.array(1).astype(bool)
input_vals = [trip_count, cond, y]
verify_with_ort_with_inputs(loop_model, input_vals, use_vm=True, freeze_params=True)

Expand Down Expand Up @@ -4032,7 +4032,7 @@ def verify_tensor_loop():
)

trip_count = np.array(5).astype(np.int64)
cond = np.array(1).astype(np.bool)
cond = np.array(1).astype(bool)
loop_graph = onnx.helper.make_graph(
[loop_node],
"loop_outer",
Expand All @@ -4049,7 +4049,7 @@ def verify_tensor_loop():
loop_model = onnx.helper.make_model(loop_graph)

trip_count = np.array(5).astype(np.int64)
cond = np.array(1).astype(np.bool)
cond = np.array(1).astype(bool)
input_vals = [trip_count, cond, y]
verify_with_ort_with_inputs(
loop_model, input_vals, use_vm=True, freeze_params=True, convert_to_static=True
Expand Down
6 changes: 3 additions & 3 deletions tests/python/relay/test_op_level4.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def verify(x_np, y_np, cond_np):

x_np = np.array(1.0, dtype)
y_np = np.array(-1.0, dtype)
cond_np = np.array([1, 0, 1], dtype=np.bool)
cond_np = np.array([1, 0, 1], dtype=bool)

verify(x_np, y_np, cond_np)

Expand All @@ -201,7 +201,7 @@ def verify(x_np, y_np, cond_np):

x_np = np.array([[1, 2], [3, 4]], dtype)
y_np = np.array([[5, 6], [7, 8]], dtype)
cond_np = np.array([[1], [0]], dtype=np.bool)
cond_np = np.array([[1], [0]], dtype=bool)

verify(x_np, y_np, cond_np)
verify(x_np, y_np, cond_np.T)
Expand All @@ -213,7 +213,7 @@ def verify(x_np, y_np, cond_np):
verify(x_np, y_np, cond_np)

x_np, y_np = np.ogrid[:3, :4]
cond_np = np.where(x_np < y_np, x_np, 10 + y_np).astype(np.bool)
cond_np = np.where(x_np < y_np, x_np, 10 + y_np).astype(bool)

verify(x_np.astype(dtype), y_np.astype(dtype), cond_np)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def verify_depthwise_conv2d_back_weight(
stride_w = stride_h
padding_w = padding_h

out_h = np.int((in_h + 2 * padding_h - filter_h) / stride_h + 1)
out_w = np.int((in_w + 2 * padding_w - filter_w) / stride_w + 1)
out_h = int((in_h + 2 * padding_h - filter_h) / stride_h + 1)
out_w = int((in_w + 2 * padding_w - filter_w) / stride_w + 1)
out_channel = in_channel * channel_multiplier

oshape = [batch, out_h, out_w, out_channel]
Expand Down
4 changes: 2 additions & 2 deletions tests/python/unittest/test_tir_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_const():
def test_scalar_dtype_inference():
for data in [
True,
np.bool(1),
bool(1),
np.uint8(1),
np.uint16(1),
np.uint32(1),
Expand All @@ -48,7 +48,7 @@ def test_scalar_dtype_inference():

for data in [
True,
np.bool(1),
bool(1),
np.uint8(1),
np.uint16(1),
np.uint32(1),
Expand Down