Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions backends/xnnpack/operators/node_visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# LICENSE file in the root directory of this source tree.

import ctypes
import hashlib

from typing import cast, Dict, List, Optional, Tuple

Expand Down Expand Up @@ -582,9 +583,8 @@ def get_serialized_buffer_index(
ctypes.POINTER(array_type),
).contents

named_key = get_tensor_name(self.exported_program, get_attr_node)
if named_key == "":
raise ValueError(f"Tensor from node: {get_attr_node} has no name")
sha256_hash = hashlib.sha256(bytes(array))
named_key = sha256_hash.hexdigest()

size = const_val.untyped_storage().nbytes()
xnn_graph.constant_data.append(
Expand Down
Loading