Hi, community,
I am seeing segfault while running this code snippet
In this code snippet, I am running a small model as below:
def @main(%data: Tensor[(1, 3, 16, 16), float32]) -> Tensor[(1, 6, 8, 8), float32] {
%0 = nn.conv2d(%data, meta[relay.Constant][0] /* ty=Tensor[(6, 3, 4, 4), float32] */, strides=[2, 2], padding=[1, 1, 1, 1], channels=6, kernel_size=[4, 4]) /* ty=Tensor[(1, 6, 8, 8), float32] */;
%1 = add(%0, meta[relay.Constant][1] /* ty=Tensor[(6, 1, 1), float32] */) /* ty=Tensor[(1, 6, 8, 8), float32] */;
%2 = nn.global_avg_pool2d(%1) /* ty=Tensor[(1, 6, 1, 1), float32] */;
%3 = broadcast_to(%2, meta[relay.attrs.InitOpAttrs][0]) /* ty=Tensor[(1, 6, 8, 8), float32] */;
multiply(%1, %3) /* ty=Tensor[(1, 6, 8, 8), float32] */
}
When I try to apply a MergeComposite pass to merge weight
+ nn.conv2d
+ bias
+ add
. I got a segfault due to an incomplete type in src/relay/op/tensor/transform.cc::BroadCastToRel
. The types[0]
in below’s code has incomplete type.
Has anyone encountered a similar issue? Is there any suggestion about how to fix it?
Thanks, Joey