tvm.error.OpAttributeInvalid: Value None in attribute "mode" of operator Upsample is not valid.
def test_upsample_nearest(target='llvm', dev=tvm.cpu(0)):
"""test_upsample_nearest"""
scale = 2
in_shape = (1, 1, 3, 3)
out_shape = (1, 1, 3 * scale, 3 * scale)
#y = helper.make_node("Upsample", ["in"], ["out"], mode="nearest", scales=[1.0, 1.0, 2.0, 2.0])
y = helper.make_node("Upsample", ["in"], ["out"], scales=[1.0, 1.0, 2.0, 2.0])
in_array = np.random.uniform(size=in_shape).astype(np.float32)
graph = helper.make_graph(
[y],
"upsample_nearest_test",
inputs=[helper.make_tensor_value_info("in", TensorProto.FLOAT, list(in_shape))],
outputs=[helper.make_tensor_value_info("out", TensorProto.FLOAT, list(out_shape))],
)
model = helper.make_model(graph, producer_name="upsample_nearest_test")
verify_with_ort_with_inputs(model, [in_array], [out_shape], opset=7, target=target, dev=dev)
The attribute "mode" in the operator Upsample is an optional attribute with the default value "nearest".
Thus, the value "None "should be considered as "nearest".
Actual behavior
tvm.error.OpAttributeInvalid: Value None in attribute "mode" of operator Upsample is not valid.
Environment
Any environment details, such as: Operating System, TVM version, etc
Steps to reproduce
Triage
Analysis
The attribute "mode" in the operator Upsample is an optional attribute with the default value "nearest".
Thus, the value "None "should be considered as "nearest".