From 0fb1b1e9b83651c0ccd91e8b20257c73290c7f58 Mon Sep 17 00:00:00 2001 From: xiaying Date: Tue, 7 Nov 2023 11:32:39 +0800 Subject: [PATCH] [Geometry:Bugfix] Fix bug for recompute for reshape geometry --- source/geometry/GeometryReshape.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/geometry/GeometryReshape.cpp b/source/geometry/GeometryReshape.cpp index 6be7bee16..a8d466437 100644 --- a/source/geometry/GeometryReshape.cpp +++ b/source/geometry/GeometryReshape.cpp @@ -59,7 +59,10 @@ class SingleGeometryComputer : public GeometryComputer { des->regions[0].origin = inputs[0]; des->regions[0].size[0] = 1; des->regions[0].size[1] = 1; - des->regions[0].size[2] = inputs[0]->elementSize(); + des->regions[0].size[2] = 1; + for (int i = 0; i < inputs[0]->dimensions(); ++i) { + des->regions[0].size[2] *= inputs[0]->length(i); + } des->regions[0].src.stride[2] = 1; des->regions[0].dst.stride[2] = 1; des->regions[0].src.offset = 0;