This is an automated email from the ASF dual-hosted git repository.

andrewzhaoluo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new 21eb583  [dyn.nn.pad] cast pad value to input dtype (#10818)
21eb583 is described below

commit 21eb583664824ce8e2c3c3b0e250c6f81ff83b9f
Author: Sevin F. Varoglu <[email protected]>
AuthorDate: Tue Mar 29 15:25:12 2022 -0700

    [dyn.nn.pad] cast pad value to input dtype (#10818)
---
 src/relay/op/dyn/nn/pad.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/relay/op/dyn/nn/pad.cc b/src/relay/op/dyn/nn/pad.cc
index 42ec784..101ad5d 100644
--- a/src/relay/op/dyn/nn/pad.cc
+++ b/src/relay/op/dyn/nn/pad.cc
@@ -77,7 +77,8 @@ Array<te::Tensor> PadCompute(const Attrs& attrs, const 
Array<te::Tensor>& inputs
   auto data = inputs[0];
   auto pad_width = inputs[1];
 
-  const PrimExpr& pad_value = inputs[2](Array<PrimExpr>());
+  te::Tensor cast_pad_value = topi::cast(inputs[2], inputs[0]->dtype);
+  const PrimExpr& pad_value = cast_pad_value(Array<PrimExpr>());
 
   Array<IndexExpr> pad_before;
   Array<IndexExpr> pad_after;

Reply via email to