未验证 提交 abb07f35 编写于 作者: Z zyfncg 提交者: GitHub

Rename full infer_meta (#38332)

* rename full infer_meta

* fix merge problem
上级 90e9a486
...@@ -30,7 +30,7 @@ DenseTensor FullLike( ...@@ -30,7 +30,7 @@ DenseTensor FullLike(
DataType dtype = DataType::UNDEFINED, DataType dtype = DataType::UNDEFINED,
Backend backend = Backend::UNDEFINED, // Is backend needed here? Backend backend = Backend::UNDEFINED, // Is backend needed here?
DataLayout layout = DataLayout::UNDEFINED) { DataLayout layout = DataLayout::UNDEFINED) {
auto out_meta = FullLikeInferMeta(x.meta(), dtype, layout); auto out_meta = CreateLikeInferMeta(x.meta(), dtype, layout);
pten::DenseTensor dense_out( pten::DenseTensor dense_out(
pten::make_intrusive<paddle::experimental::SharedStorage>( pten::make_intrusive<paddle::experimental::SharedStorage>(
dev_ctx.GetPlace()), dev_ctx.GetPlace()),
......
...@@ -17,16 +17,16 @@ limitations under the License. */ ...@@ -17,16 +17,16 @@ limitations under the License. */
namespace pten { namespace pten {
DenseTensorMeta FullInferMeta(const std::vector<int64_t>& shape, DenseTensorMeta CreateInferMeta(const std::vector<int64_t>& shape,
DataType dtype, DataType dtype,
DataLayout layout) { DataLayout layout) {
const auto& out_dims = paddle::framework::make_ddim(shape); const auto& out_dims = paddle::framework::make_ddim(shape);
return {dtype, out_dims, layout}; return {dtype, out_dims, layout};
} }
DenseTensorMeta FullInferMeta(const ScalarArray& shape, DenseTensorMeta CreateInferMeta(const ScalarArray& shape,
DataType dtype, DataType dtype,
DataLayout layout) { DataLayout layout) {
const auto& out_dims = paddle::framework::make_ddim(shape.GetData()); const auto& out_dims = paddle::framework::make_ddim(shape.GetData());
return {dtype, out_dims, layout}; return {dtype, out_dims, layout};
} }
......
...@@ -27,12 +27,12 @@ namespace pten { ...@@ -27,12 +27,12 @@ namespace pten {
// Because functions in this file // Because functions in this file
// not only can infer shape, but alse need infer lod or other useful data. // not only can infer shape, but alse need infer lod or other useful data.
DenseTensorMeta FullInferMeta(const std::vector<int64_t>& shape, DenseTensorMeta CreateInferMeta(const std::vector<int64_t>& shape,
DataType dtype, DataType dtype,
DataLayout layout); DataLayout layout);
DenseTensorMeta FullInferMeta(const ScalarArray& shape, DenseTensorMeta CreateInferMeta(const ScalarArray& shape,
DataType dtype, DataType dtype,
DataLayout layout); DataLayout layout);
} // namespace pten } // namespace pten
...@@ -81,9 +81,9 @@ DenseTensorMeta CastInferMeta(const DenseTensorMeta& x_meta, ...@@ -81,9 +81,9 @@ DenseTensorMeta CastInferMeta(const DenseTensorMeta& x_meta,
return out_meta; return out_meta;
} }
DenseTensorMeta FullLikeInferMeta(const DenseTensorMeta& x_meta, DenseTensorMeta CreateLikeInferMeta(const DenseTensorMeta& x_meta,
DataType dtype, DataType dtype,
DataLayout layout) { DataLayout layout) {
return {dtype == DataType::UNDEFINED ? x_meta.dtype : dtype, return {dtype == DataType::UNDEFINED ? x_meta.dtype : dtype,
x_meta.dims, x_meta.dims,
layout == DataLayout::UNDEFINED ? x_meta.layout : layout}; layout == DataLayout::UNDEFINED ? x_meta.layout : layout};
......
...@@ -44,9 +44,9 @@ DenseTensorMeta FlattenInferMeta(const DenseTensorMeta& x_meta, ...@@ -44,9 +44,9 @@ DenseTensorMeta FlattenInferMeta(const DenseTensorMeta& x_meta,
DenseTensorMeta CastInferMeta(const DenseTensorMeta& x_meta, DenseTensorMeta CastInferMeta(const DenseTensorMeta& x_meta,
const DataType out_dtype); const DataType out_dtype);
DenseTensorMeta FullLikeInferMeta(const DenseTensorMeta& x_meta, DenseTensorMeta CreateLikeInferMeta(const DenseTensorMeta& x_meta,
DataType dtype, DataType dtype,
DataLayout layout); DataLayout layout);
DenseTensorMeta InferMetaFromVecValue(const DenseTensorMeta& x_meta, DenseTensorMeta InferMetaFromVecValue(const DenseTensorMeta& x_meta,
const std::vector<int64_t>& shape); const std::vector<int64_t>& shape);
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
args : (const ScalarArray& shape, const Scalar& value, DataType dtype=DataType::FLOAT32, Backend place=Backend::CPU, DataLayout layout=DataLayout::NCHW) args : (const ScalarArray& shape, const Scalar& value, DataType dtype=DataType::FLOAT32, Backend place=Backend::CPU, DataLayout layout=DataLayout::NCHW)
output: Tensor output: Tensor
infer_meta : infer_meta :
func : FullInferMeta func : CreateInferMeta
param : [shape, dtype, layout] param : [shape, dtype, layout]
kernel : kernel :
func : full func : full
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
args : (const Tensor& x, const Scalar& value, DataType dtype = DataType::UNDEFINED, Backend place = Backend::UNDEFINED, DataLayout layout = DataLayout::UNDEFINED) args : (const Tensor& x, const Scalar& value, DataType dtype = DataType::UNDEFINED, Backend place = Backend::UNDEFINED, DataLayout layout = DataLayout::UNDEFINED)
output: Tensor output: Tensor
infer_meta : infer_meta :
func : FullLikeInferMeta func : CreateLikeInferMeta
param : [x, dtype, layout] param : [x, dtype, layout]
kernel : kernel :
func : full_like func : full_like
...@@ -146,15 +146,6 @@ ...@@ -146,15 +146,6 @@
output : Tensor output : Tensor
invoke : full_like(x, 0, dtype, place, layout) invoke : full_like(x, 0, dtype, place, layout)
# - api : full_like
# args : (const Tensor& x, const Scalar& value, DataType dtype, Backend place)->Tensor
# output: {Tensor : dtype}
# kernel : fill_any_like
# T : [dtype, x]
# backend : [place, x]
# layout : []
# InferMeta : UnchangedInferMeta(x)
- api : conj - api : conj
args : (const Tensor& x) args : (const Tensor& x)
output : Tensor output : Tensor
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册