Skip to content

Commit 8ac74b7

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

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

tico/serialize/operators/onert/op_attention.py

Lines changed: 2 additions & 9 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
)
@@ -64,7 +63,6 @@ def attention_llama(*args, **kwargs):
6463
past_key,
6564
past_value,
6665
cache_position,
67-
layer_idx,
6866
) = args
6967
return hidden_states
7068

@@ -105,7 +103,6 @@ def llama_attention_forward_adapter(
105103
key_cache[self.layer_idx],
106104
value_cache[self.layer_idx], # Same to value_cache
107105
cache_position,
108-
self.layer_idx,
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)