@@ -159,11 +159,9 @@ class TransposeConvStridedConverter
159159 outputChannels, weightHeight / stride[0 ],
160160 stride[0 ], weightWidth / stride[1 ],
161161 stride[1 ], inputChannels};
162-
163- ImplicitLocOpBuilder builder (op->getLoc (), rewriter);
164162 weight = CreateOpAndInferShape<tosa::ReshapeOp>(
165- builder , UnrankedTensorType::get (weightETy), weight,
166- getTosaConstShape ( rewriter, loc, weightReshapeDims0));
163+ rewriter, loc , UnrankedTensorType::get (weightETy), weight,
164+ rewriter. getDenseI64ArrayAttr ( weightReshapeDims0));
167165
168166 // Transpose the factored-out stride to the output channels.
169167 Value transposeWeightVal = rewriter.create <tosa::ConstOp>(
@@ -175,13 +173,12 @@ class TransposeConvStridedConverter
175173 transposeWeightVal);
176174
177175 // Collapse the strides and output channels into a single dimension.
178- llvm::SmallVector<int64_t , 4 > weightReshapeDims1 = {
176+ llvm::SmallVector<int64_t , 6 > weightReshapeDims1 = {
179177 outputChannels * stride[0 ] * stride[1 ], weightHeight / stride[0 ],
180178 weightWidth / stride[1 ], inputChannels};
181-
182179 weight = CreateOpAndInferShape<tosa::ReshapeOp>(
183180 rewriter, loc, UnrankedTensorType::get (weightETy), weight,
184- getTosaConstShape ( rewriter, loc, weightReshapeDims1));
181+ rewriter. getDenseI64ArrayAttr ( weightReshapeDims1));
185182 ShapedType restridedWeightTy = cast<ShapedType>(weight.getType ());
186183
187184 weight = CreateOpAndInferShape<tosa::ReverseOp>(
@@ -260,13 +257,9 @@ class TransposeConvStridedConverter
260257 // Factor striding out of the convolution result.
261258 llvm::SmallVector<int64_t , 6 > convReshapeDims0 = {
262259 batch, convHeight, convWidth, stride[0 ], stride[1 ], outputChannels};
263-
264- auto convReshapeDims0Value =
265- getTosaConstShape (rewriter, loc, convReshapeDims0);
266-
267260 conv2d = CreateOpAndInferShape<tosa::ReshapeOp>(
268261 rewriter, loc, UnrankedTensorType::get (resultETy), conv2d,
269- convReshapeDims0Value );
262+ rewriter. getDenseI64ArrayAttr (convReshapeDims0) );
270263
271264 // Transpose the factored-out stride to the output channels.
272265 Value transposeConvVal = rewriter.create <tosa::ConstOp>(
@@ -280,13 +273,9 @@ class TransposeConvStridedConverter
280273 // Fuse striding behavior back into width / height.
281274 llvm::SmallVector<int64_t , 6 > convReshapeDims1 = {
282275 batch, convHeight * stride[0 ], convWidth * stride[1 ], outputChannels};
283-
284- auto convReshapeDims1Value =
285- getTosaConstShape (rewriter, loc, convReshapeDims1);
286-
287276 conv2d = CreateOpAndInferShape<tosa::ReshapeOp>(
288277 rewriter, loc, UnrankedTensorType::get (resultETy), conv2d,
289- convReshapeDims1Value );
278+ rewriter. getDenseI64ArrayAttr (convReshapeDims1) );
290279
291280 // Determine the amount to slice / pad from the result start.
292281 int64_t resultSliceTop = std::max<int64_t >(0 , -pad[0 ]);
0 commit comments