@@ -159,9 +159,11 @@ class TransposeConvStridedConverter
159159 outputChannels, weightHeight / stride[0 ],
160160 stride[0 ], weightWidth / stride[1 ],
161161 stride[1 ], inputChannels};
162+
163+ ImplicitLocOpBuilder builder (op->getLoc (), rewriter);
162164 weight = CreateOpAndInferShape<tosa::ReshapeOp>(
163- rewriter, loc , UnrankedTensorType::get (weightETy), weight,
164- rewriter. getDenseI64ArrayAttr ( weightReshapeDims0));
165+ builder , UnrankedTensorType::get (weightETy), weight,
166+ getTosaConstShape (rewriter, loc, weightReshapeDims0));
165167
166168 // Transpose the factored-out stride to the output channels.
167169 Value transposeWeightVal = rewriter.create <tosa::ConstOp>(
@@ -173,12 +175,13 @@ class TransposeConvStridedConverter
173175 transposeWeightVal);
174176
175177 // Collapse the strides and output channels into a single dimension.
176- llvm::SmallVector<int64_t , 6 > weightReshapeDims1 = {
178+ llvm::SmallVector<int64_t , 4 > weightReshapeDims1 = {
177179 outputChannels * stride[0 ] * stride[1 ], weightHeight / stride[0 ],
178180 weightWidth / stride[1 ], inputChannels};
181+
179182 weight = CreateOpAndInferShape<tosa::ReshapeOp>(
180183 rewriter, loc, UnrankedTensorType::get (weightETy), weight,
181- rewriter. getDenseI64ArrayAttr ( weightReshapeDims1));
184+ getTosaConstShape (rewriter, loc, weightReshapeDims1));
182185 ShapedType restridedWeightTy = cast<ShapedType>(weight.getType ());
183186
184187 weight = CreateOpAndInferShape<tosa::ReverseOp>(
@@ -257,9 +260,13 @@ class TransposeConvStridedConverter
257260 // Factor striding out of the convolution result.
258261 llvm::SmallVector<int64_t , 6 > convReshapeDims0 = {
259262 batch, convHeight, convWidth, stride[0 ], stride[1 ], outputChannels};
263+
264+ auto convReshapeDims0Value =
265+ getTosaConstShape (rewriter, loc, convReshapeDims0);
266+
260267 conv2d = CreateOpAndInferShape<tosa::ReshapeOp>(
261268 rewriter, loc, UnrankedTensorType::get (resultETy), conv2d,
262- rewriter. getDenseI64ArrayAttr (convReshapeDims0) );
269+ convReshapeDims0Value );
263270
264271 // Transpose the factored-out stride to the output channels.
265272 Value transposeConvVal = rewriter.create <tosa::ConstOp>(
@@ -273,9 +280,13 @@ class TransposeConvStridedConverter
273280 // Fuse striding behavior back into width / height.
274281 llvm::SmallVector<int64_t , 6 > convReshapeDims1 = {
275282 batch, convHeight * stride[0 ], convWidth * stride[1 ], outputChannels};
283+
284+ auto convReshapeDims1Value =
285+ getTosaConstShape (rewriter, loc, convReshapeDims1);
286+
276287 conv2d = CreateOpAndInferShape<tosa::ReshapeOp>(
277288 rewriter, loc, UnrankedTensorType::get (resultETy), conv2d,
278- rewriter. getDenseI64ArrayAttr (convReshapeDims1) );
289+ convReshapeDims1Value );
279290
280291 // Determine the amount to slice / pad from the result start.
281292 int64_t resultSliceTop = std::max<int64_t >(0 , -pad[0 ]);
0 commit comments