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

first commit (#45253)

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