未验证 提交 b5d8bd2f 编写于 作者: L limingshu 提交者: GitHub

first commit (#45253)

上级 dd2f4a1c
...@@ -23,12 +23,9 @@ template <typename T, typename Context> ...@@ -23,12 +23,9 @@ template <typename T, typename Context>
void ShapeKernel(const Context& ctx, void ShapeKernel(const Context& ctx,
const DenseTensor& input, const DenseTensor& input,
DenseTensor* out) { DenseTensor* out) {
auto in_var = &input; auto& in_dims = input.dims();
phi::DDim in_dims; out->Resize({in_dims.size()});
in_dims = in_var->dims(); auto out_data = ctx.template HostAlloc<int32_t>(out);
auto out_t = out;
out_t->Resize({in_dims.size()});
auto out_data = ctx.template HostAlloc<int32_t>(out_t);
for (int i = 0; i < in_dims.size(); ++i) { for (int i = 0; i < in_dims.size(); ++i) {
out_data[i] = in_dims[i]; out_data[i] = in_dims[i];
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册