mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-22 19:23:30 +00:00
Bugfix: Add initializer to model in AttentionMask directly (#17719)
This commit is contained in:
parent
8621bdcd44
commit
1f4a3529dd
1 changed files with 9 additions and 1 deletions
|
|
@ -78,7 +78,15 @@ class AttentionMask:
|
|||
# ReduceSum-13: axes is moved from attribute to input
|
||||
axes_name = "ort_const_1_reduce_sum_axes"
|
||||
if self.model.get_initializer(axes_name) is None:
|
||||
self.add_initializer(name=axes_name, data_type=TensorProto.INT64, dims=[1], vals=[1], raw=False)
|
||||
self.model.add_initializer(
|
||||
helper.make_tensor(
|
||||
name=axes_name,
|
||||
data_type=TensorProto.INT64,
|
||||
dims=[1],
|
||||
vals=[1],
|
||||
raw=False,
|
||||
)
|
||||
)
|
||||
mask_index_node = helper.make_node(
|
||||
"ReduceSum",
|
||||
inputs=[input_name, axes_name],
|
||||
|
|
|
|||
Loading…
Reference in a new issue