Skip to content

Commit e3d63c1

Browse files
committed
chore: make creating input shapes prettier
1 parent 3776252 commit e3d63c1

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

  • packages/react-native-executorch/common/rnexecutorch/models

packages/react-native-executorch/common/rnexecutorch/models/BaseModel.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,8 @@ std::vector<int32_t> BaseModel::getInputShape(std::string method_name,
4949
std::to_string(static_cast<int>(input_meta.error())));
5050
}
5151

52-
std::vector<int32_t> input_shape;
5352
auto sizes = input_meta->sizes();
54-
input_shape.reserve(sizes.size());
55-
for (auto size : sizes) {
56-
input_shape.push_back(size);
57-
}
53+
std::vector<int32_t> input_shape(sizes.begin(), sizes.end());
5854
return input_shape;
5955
}
6056

0 commit comments

Comments
 (0)