Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
25baa631
Commit
25baa631
authored
Oct 12, 2022
by
Frederick Liu
Committed by
A. Unique TensorFlower
Oct 12, 2022
Browse files
[kernel] Update test to make usage clear
PiperOrigin-RevId: 480718252
parent
be205db2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
official/nlp/modeling/layers/kernel_attention_test.py
official/nlp/modeling/layers/kernel_attention_test.py
+3
-3
No files found.
official/nlp/modeling/layers/kernel_attention_test.py
View file @
25baa631
...
@@ -68,10 +68,10 @@ class KernelAttentionTest(tf.test.TestCase, parameterized.TestCase):
...
@@ -68,10 +68,10 @@ class KernelAttentionTest(tf.test.TestCase, parameterized.TestCase):
value
=
value
,
value
=
value
,
attention_mask
=
masks
,
attention_mask
=
masks
,
training
=
training
)
training
=
training
)
dim
=
num_random_features
if
num_random_features
>
0
else
key_dim
kv_cache
=
tf
.
zeros
(
kv_cache
=
tf
.
zeros
(
(
batch_size
,
num_heads
,
key_dim
,
(
batch_size
,
num_heads
,
dim
,
dim
))
num_random_features
if
num_random_features
>
0
else
key_dim
))
k_sum_cache
=
tf
.
zeros
((
batch_size
,
num_heads
,
dim
))
k_sum_cache
=
tf
.
zeros
((
batch_size
,
num_heads
,
key_dim
))
stream_output
=
[]
stream_output
=
[]
cache
=
{
"kv"
:
kv_cache
,
"k_sum"
:
k_sum_cache
}
cache
=
{
"kv"
:
kv_cache
,
"k_sum"
:
k_sum_cache
}
for
i
in
range
(
num_chunks
):
for
i
in
range
(
num_chunks
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment