Skip to content
This repository has been archived by the owner on Nov 25, 2022. It is now read-only.

Commit

Permalink
[Frontend][Paddle] Fix op in paddle did't transmit layout information (
Browse files Browse the repository at this point in the history
…apache#12658)

[Frontend][Paddle] Fix adaptive_avg_pool2d in paddle did't transmit layout information
  • Loading branch information
blackkker authored and xinetzone committed Nov 25, 2022
1 parent 074367c commit 133c08e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/tvm/relay/frontend/paddlepaddle.py
Original file line number Diff line number Diff line change
Expand Up @@ -1193,6 +1193,7 @@ def convert_pool2d(g, op, block):
paddings = op.attr("paddings")
padding_algorithm = op.attr("padding_algorithm")
pooling_type = op.attr("pooling_type")
data_format = op.attr("data_format")

if global_pooling:
adaptive = True
Expand Down Expand Up @@ -1260,7 +1261,9 @@ def convert_pool2d(g, op, block):
input_x, pool_size=ksize, strides=strides, padding=paddings, ceil_mode=ceil_mode
)
else:
out = getattr(_op.nn, "adaptive_" + op_map[pooling_type])(input_x, output_size=ksize)
out = getattr(_op.nn, "adaptive_" + op_map[pooling_type])(
input_x, output_size=ksize, layout=data_format
)
g.add_node(op.output("Out")[0], out)


Expand Down

0 comments on commit 133c08e

Please sign in to comment.