Skip to content

[Bug] Value None in attribute "mode" of operator Upsample is not valid #16621

@jikechao

Description

@jikechao

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

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)

Triage

  • frontend:onnx
  • needs-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".

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triagePRs or issues that need to be investigated by maintainers to find the right assignees to address ittype: bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions