Skip to content

Commit

Permalink
Set dtype for Infermeta
Browse files Browse the repository at this point in the history
  • Loading branch information
From00 committed Feb 25, 2022
1 parent a11094a commit b7acb5d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions paddle/phi/infermeta/backward.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,19 @@ void BilinearTensorProductGradInferMeta(const MetaTensor& x,

if (dx) {
dx->set_dims(x_dims);
dx->set_dtype(x.dtype());
}
if (dy) {
dy->set_dims(y_dims);
dy->set_dtype(y.dtype());
}
if (dweight) {
dweight->set_dims(weight_dims);
dweight->set_dtype(weight.dtype());
}
if (dbias) {
dbias->set_dims({1, out_dims[1]});
dbias->set_dtype(dout.dtype());
}
}

Expand Down
1 change: 1 addition & 0 deletions paddle/phi/infermeta/multiary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ void BilinearTensorProductInferMeta(const MetaTensor& x,

out->set_dims({x_dims[0], weight_dims[0]});
out->share_lod(x);
out->set_dtype(x.dtype());
}

void ConcatInferMeta(const std::vector<MetaTensor>& x,
Expand Down
1 change: 0 additions & 1 deletion paddle/phi/kernels/bilinear_tensor_product_grad_kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#pragma once

#include "paddle/phi/core/dense_tensor.h"
#include "paddle/utils/optional.h"

namespace phi {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "paddle/phi/core/dense_tensor.h"
#include "paddle/phi/kernels/funcs/blas/blas.h"
#include "paddle/phi/kernels/funcs/eigen/common.h"
#include "paddle/utils/optional.h"

namespace phi {

Expand Down

1 comment on commit b7acb5d

@paddle-bot-old
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulation! Your pull request passed all required CI. You could ask reviewer(s) to approve and merge. 🎉

Please sign in to comment.