@@ -191,7 +191,7 @@ void UpdateTorchValueByOnnxValueInfo(
191
191
}
192
192
}
193
193
194
- static bool IsValidONNXControlflowNode (const Node* n) {
194
+ bool IsValidONNXControlflowNode (const Node* n) {
195
195
// Skip when block size is zero. This is when the node is being created,
196
196
// and doesn't have subblocks attached yet. Run shape inference for these
197
197
// nodes later, when the subgraph has already completed shape inferencing.
@@ -205,7 +205,7 @@ static bool IsValidONNXControlflowNode(const Node* n) {
205
205
return true ;
206
206
}
207
207
208
- static bool IsValidONNXNode (const Node* n) {
208
+ bool IsValidONNXNode (const Node* n) {
209
209
auto node_kind = n->kind ();
210
210
211
211
if (!node_kind.is_onnx ()) {
@@ -411,7 +411,9 @@ void ConvertGraphToONNXProto(
411
411
}
412
412
}
413
413
414
- std::optional<at::Tensor> ComputeConstantFolding (Node* n, int opset_version) {
414
+ std::optional<at::Tensor> ComputeConstantFolding (
415
+ const Node* n,
416
+ int opset_version) {
415
417
if (n->inputs ().empty ()) {
416
418
return std::nullopt;
417
419
}
@@ -463,7 +465,7 @@ std::optional<::c10::SymbolicShape> ComputeShapeFromReshape(
463
465
auto it_0 = std::find_if (shape_vector.begin (), shape_vector.end (), is_zero);
464
466
bool shape_has_zero = it_0 != shape_vector.end ();
465
467
466
- int minus_one_pos = -1 ;
468
+ int64_t minus_one_pos = -1 ;
467
469
for (auto i : c10::irange (shape_vector.size ())) {
468
470
if (shape_vector[i].value () == -1 ) {
469
471
minus_one_pos = i;
@@ -773,7 +775,7 @@ void ProcessBroadcastNode(Node* n) {
773
775
}
774
776
775
777
void ProcessShapeForConcatNode (Node* n) {
776
- int axis = n->i (attr::axis);
778
+ auto axis = n->i (attr::axis);
777
779
if (ConstantValueMap::HasRank (n->input (0 )->debugName ())) {
778
780
auto rank = ConstantValueMap::GetRank (n->input (0 )->debugName ()).value ();
779
781
size_t axis_adjust = 0 ;
@@ -1837,7 +1839,7 @@ void FetchBlockInputMetadataFromParent(Block* b) {
1837
1839
}
1838
1840
}
1839
1841
1840
- static void RemoveProcessedInputs (const Node* n) {
1842
+ void RemoveProcessedInputs (const Node* n) {
1841
1843
// After processing a node for shape inference, remove intermediate tensors
1842
1844
// that are stored in ConstantValueMap to reduce memory usage.
1843
1845
// This will only remove tensors that are no longer needed by any other node.
@@ -2213,10 +2215,9 @@ void ONNXSetDynamicInputShape(
2213
2215
GRAPH_UPDATE (" dynamic axes tensor names:" , [&]() {
2214
2216
std::vector<std::string> res (dynamic_axes.size ());
2215
2217
std::transform (
2216
- dynamic_axes.begin (),
2217
- dynamic_axes.end (),
2218
- res.begin (),
2219
- [](const auto & pair) { return pair.first ; });
2218
+ dynamic_axes.begin (), dynamic_axes.end (), res.begin (), [](auto pair) {
2219
+ return pair.first ;
2220
+ });
2220
2221
return res;
2221
2222
}());
2222
2223
@@ -2256,7 +2257,7 @@ void ONNXSetDynamicInputShape(
2256
2257
}
2257
2258
}
2258
2259
2259
- static bool HasSequenceTypeOutput (Node* node) {
2260
+ static bool HasSequenceTypeOutput (const Node* node) {
2260
2261
if (node->kind () == ::c10::onnx::SplitToSequence ||
2261
2262
node->kind () == ::c10::onnx::SequenceInsert ||
2262
2263
node->kind () == ::c10::onnx::SequenceEmpty ||
0 commit comments