Skip to content

Commit f97e988

Browse files
author
Sanggyu Lee
committed
remove layer_idx
1 parent 22910c2 commit f97e988

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

tico/serialize/operators/onert/op_attention.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@
4141
Tensor attention_mask,
4242
Tensor past_key,
4343
Tensor past_value,
44-
Tensor cache_position,
45-
int layer_idx
44+
Tensor cache_position
4645
) -> Tensor
4746
"""
4847
)
@@ -63,8 +62,7 @@ def attention_llama(*args, **kwargs):
6362
attention_mask,
6463
past_key,
6564
past_value,
66-
cache_position,
67-
layer_idx,
65+
cache_position
6866
) = args
6967
return hidden_states
7068

@@ -104,8 +102,7 @@ def llama_attention_forward_adapter(
104102
# k_cache[0] | k_cache[1] | ... | k_cache[n]
105103
key_cache[self.layer_idx],
106104
value_cache[self.layer_idx], # Same to value_cache
107-
cache_position,
108-
self.layer_idx,
105+
cache_position
109106
),
110107
None,
111108
)
@@ -136,7 +133,6 @@ def define_node(
136133
past_key,
137134
past_value,
138135
cache_position,
139-
layer_idx,
140136
) = node.args
141137

142138
op_index = get_op_index(
@@ -153,9 +149,6 @@ def define_node(
153149
operator.builtinOptionsType = (
154150
circle.BuiltinOptions.BuiltinOptions.AttentionOptions
155151
)
156-
option = circle.AttentionOptions.AttentionOptionsT()
157-
option.layer_idx = layer_idx
158-
159-
operator.builtinOptions = option
152+
operator.builtinOptions = circle.AttentionOptions.AttentionOptionsT()
160153

161154
return operator

0 commit comments

Comments
 (0)