@@ -160,9 +160,11 @@ class TransposeConvStridedConverter
160160 outputChannels, weightHeight / stride[0 ],
161161 stride[0 ], weightWidth / stride[1 ],
162162 stride[1 ], inputChannels};
163+
164+ ImplicitLocOpBuilder builder (op->getLoc (), rewriter);
163165 weight = CreateOpAndInferShape<tosa::ReshapeOp>(
164- rewriter, loc , UnrankedTensorType::get (weightETy), weight,
165- rewriter. getDenseI64ArrayAttr ( weightReshapeDims0));
166+ builder , UnrankedTensorType::get (weightETy), weight,
167+ getTosaConstShape (rewriter, loc, weightReshapeDims0));
166168
167169 // Transpose the factored-out stride to the output channels.
168170 Value transposeWeightVal = rewriter.create <tosa::ConstOp>(
@@ -174,12 +176,13 @@ class TransposeConvStridedConverter
174176 transposeWeightVal);
175177
176178 // Collapse the strides and output channels into a single dimension.
177- llvm::SmallVector<int64_t , 6 > weightReshapeDims1 = {
179+ llvm::SmallVector<int64_t , 4 > weightReshapeDims1 = {
178180 outputChannels * stride[0 ] * stride[1 ], weightHeight / stride[0 ],
179181 weightWidth / stride[1 ], inputChannels};
182+
180183 weight = CreateOpAndInferShape<tosa::ReshapeOp>(
181184 rewriter, loc, UnrankedTensorType::get (weightETy), weight,
182- rewriter. getDenseI64ArrayAttr ( weightReshapeDims1));
185+ getTosaConstShape (rewriter, loc, weightReshapeDims1));
183186 ShapedType restridedWeightTy = cast<ShapedType>(weight.getType ());
184187
185188 weight = CreateOpAndInferShape<tosa::ReverseOp>(
@@ -258,9 +261,13 @@ class TransposeConvStridedConverter
258261 // Factor striding out of the convolution result.
259262 llvm::SmallVector<int64_t , 6 > convReshapeDims0 = {
260263 batch, convHeight, convWidth, stride[0 ], stride[1 ], outputChannels};
264+
265+ auto convReshapeDims0Value =
266+ getTosaConstShape (rewriter, loc, convReshapeDims0);
267+
261268 conv2d = CreateOpAndInferShape<tosa::ReshapeOp>(
262269 rewriter, loc, UnrankedTensorType::get (resultETy), conv2d,
263- rewriter. getDenseI64ArrayAttr (convReshapeDims0) );
270+ convReshapeDims0Value );
264271
265272 // Transpose the factored-out stride to the output channels.
266273 Value transposeConvVal = rewriter.create <tosa::ConstOp>(
@@ -274,9 +281,13 @@ class TransposeConvStridedConverter
274281 // Fuse striding behavior back into width / height.
275282 llvm::SmallVector<int64_t , 6 > convReshapeDims1 = {
276283 batch, convHeight * stride[0 ], convWidth * stride[1 ], outputChannels};
284+
285+ auto convReshapeDims1Value =
286+ getTosaConstShape (rewriter, loc, convReshapeDims1);
287+
277288 conv2d = CreateOpAndInferShape<tosa::ReshapeOp>(
278289 rewriter, loc, UnrankedTensorType::get (resultETy), conv2d,
279- rewriter. getDenseI64ArrayAttr (convReshapeDims1) );
290+ convReshapeDims1Value );
280291
281292 // Determine the amount to slice / pad from the result start.
282293 int64_t resultSliceTop = std::max<int64_t >(0 , -pad[0 ]);
0 commit comments