tvm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-tvm] mbaret commented on pull request #5689: [PatternLang] Add ConstantPattern
Date Thu, 28 May 2020 22:23:58 GMT

mbaret commented on pull request #5689:
URL: https://github.com/apache/incubator-tvm/pull/5689#issuecomment-635640183


   ```
   %2 = fn (%input: Tensor[(1, 224, 224, 3), uint8], Composite="qnn_conv2d") -> Tensor[(1,
224, 224, 64), uint8] {
       %0 = qnn.conv2d(%input, meta[relay.Constant][0] /* ty=Tensor[(3, 3, 3, 64), uint8]
*/ /* ty=Tensor[(3, 3, 3, 64), uint8] */, 115 /* ty=int32 */, 134 /* ty=int32 */, 1f /* ty=float32
*/, 0.00503911f /* ty=float32 */, padding=[1, 1, 1, 1], channels=64, kernel_size=[3, 3], data_layout="NHWC",
kernel_layout="HWIO", out_dtype="int32") /* ty=Tensor[(1, 224, 224, 64), int32] */;
       %1 = nn.bias_add(%0, meta[relay.Constant][1] /* ty=Tensor[(64), int32] */ /* ty=Tensor[(64),
int32] */, axis=3) /* ty=Tensor[(1, 224, 224, 64), int32] */;
       qnn.requantize(%1, 0.00503911f /* ty=float32 */, 0 /* ty=int32 */, 3.26957f /* ty=float32
*/, 0 /* ty=int32 */, out_dtype="uint8") /* ty=Tensor[(1, 224, 224, 64), uint8] */
     };
   ```
   Would be an example of the composite function I'd expect if I matched the weight of the
conv as a constant (this is the old merge composite behaviour for that case).
   
   I think the most logical behaviour is for constants to remain embedded where they are explicitly
part of the pattern and to lift them where they are not.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message