Skip to content

Commit 2e2300b

Browse files
committed
refactor(ONNX): renames getValueList helper to createScalarSublist
- Before: - "get": implies retrieval of some private property - "Value": restatement of the return type `Value` - "List": assumed result of casting the returned instance - After: - "create": contextualizes the need to pass in `rewriter` - "Scalar": contextualizes the opaque return type - "Sublist": the relationship between the first parameter and the returned result
1 parent 445ad8f commit 2e2300b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/Conversion/TorchOnnxToTorch/DefaultDomainQtoZ.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ Value createScalarAs(
207207
}
208208

209209
template <typename SomeTorchScalarType>
210-
Value getValueList(
210+
Value createScalarSublist(
211211
/* at */ Location givenLoc,
212212
/* from */ Value given1DTensor,
213213
/* throughBackStartingWith */ int64_t givenIndex,
@@ -2825,13 +2825,13 @@ void mlir::torch::onnx_c::populateDefaultDomainQtoZ(
28252825

28262826
if (operands.size() < 4) {
28272827
Value scaleOperand = operands[2];
2828-
scalesValueList = getValueList<Torch::FloatType>(
2828+
scalesValueList = createScalarSublist<Torch::FloatType>(
28292829
binder.getLoc(), scaleOperand, foremostSupportedDim, rewriter);
28302830
sizesValueList = noneVal;
28312831
} else {
28322832
Value sizeOperand = operands[3];
28332833
scalesValueList = noneVal;
2834-
sizesValueList = getValueList<Torch::IntType>(
2834+
sizesValueList = createScalarSublist<Torch::IntType>(
28352835
binder.getLoc(), sizeOperand, foremostSupportedDim, rewriter);
28362836
}
28372837
if (isa<Torch::NoneType>(scalesValueList.getType()) &&
@@ -3356,7 +3356,7 @@ void mlir::torch::onnx_c::populateDefaultDomainQtoZ(
33563356
binder.op, "supports upto 3d upsampling only");
33573357

33583358
auto foremostSupportedDim = TorchImageTensor::heightDim;
3359-
Value scalesValueList = getValueList<Torch::FloatType>(
3359+
Value scalesValueList = createScalarSublist<Torch::FloatType>(
33603360
binder.getLoc(), scales, foremostSupportedDim, rewriter);
33613361
if (mode == "linear") {
33623362
if (resultRank == 4)

0 commit comments

Comments
 (0)