Skip to content

Commit

Permalink
[WebNN EP] Remove useless variable unpacked_tensors_ (#21189)
Browse files Browse the repository at this point in the history
  • Loading branch information
Honry authored Jun 27, 2024
1 parent 9eb1c2a commit 78316c8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 1 addition & 2 deletions onnxruntime/core/providers/webnn/builders/model_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ Status ModelBuilder::RegisterInitializers() {
if (tensor.has_raw_data()) {
tensor_ptr = reinterpret_cast<std::byte*>(const_cast<char*>(tensor.raw_data().c_str()));
} else {
unpacked_tensors_.push_back({});
std::vector<uint8_t>& unpacked_tensor = unpacked_tensors_.back();
std::vector<uint8_t> unpacked_tensor;
ORT_RETURN_IF_ERROR(onnxruntime::utils::UnpackInitializerData(tensor, unpacked_tensor));
tensor_ptr = reinterpret_cast<std::byte*>(unpacked_tensor.data());
}
Expand Down
1 change: 0 additions & 1 deletion onnxruntime/core/providers/webnn/builders/model_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ class ModelBuilder {
emscripten::val wnn_builder_ = emscripten::val::object();
DataLayout preferred_layout_;
WebnnDeviceType wnn_device_type_;
std::vector<std::vector<uint8_t>> unpacked_tensors_;
InlinedHashMap<std::string, emscripten::val> wnn_operands_;
std::vector<std::string> input_names_;
std::vector<std::string> output_names_;
Expand Down

0 comments on commit 78316c8

Please sign in to comment.