Skip to content

How could I get the pool_size and pool_stride information from built graph_json? #7941

@WeberChen

Description

@WeberChen

Hi all,
I have run the test example in test_pass_partition_graph.py.
It's OK to export the graph_jason, lib.so and the parameters.
However, when I try to insert the nn.maxpool2d operator, the information of pool_size and pool_stride is missing in graph_json file.
Could someone tell me how to get the above information in graph_json file?
What files should I modify?
Thank you.


The following code is the inserted nn.maxpool2d in test_dnnl_fuse() in test_pass_partition_graph.py.
def get_net(include_bn=True, include_sigmoid=False):
data = relay.var("data", relay.TensorType((1, 3, 224, 224), "float32"))
block1 = get_blocks("block1_", data, 3, 8, include_bn, include_sigmoid)
block2 = get_blocks("block2_", block1, 8, 8, False, include_sigmoid)
block3 = relay.nn.avg_pool2d(block2, pool_size=(2, 2), strides=(2, 2), padding=(0, 0), layout='NCHW', ceil_mode=False, count_include_pad=False)
return relay.Function(relay.analysis.free_vars(block3), block3)

The following code is the part of graph_json about the maxpool2d:
{
"op": "tvm_op",
"name": "fused_nn_avg_pool2d_1",
"attrs": {
"num_outputs": "1",
"num_inputs": "1",
"func_name": "fused_nn_avg_pool2d_1",
"flatten_data": "0"
},
"inputs": [
[
2,
0,
0
]
]
}

AND the picture is the graph_json and it can get the correct result.
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions