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
44848e08
Commit
44848e08
authored
Jun 09, 2022
by
Scott Zhu
Committed by
A. Unique TensorFlower
Jun 09, 2022
Browse files
Fix unit test failure caused by the keras initializer change.
PiperOrigin-RevId: 453982185
parent
a506d3a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
official/nlp/modeling/layers/tn_expand_condense_test.py
official/nlp/modeling/layers/tn_expand_condense_test.py
+2
-2
No files found.
official/nlp/modeling/layers/tn_expand_condense_test.py
View file @
44848e08
...
@@ -66,7 +66,7 @@ class TNLayerTest(tf.test.TestCase, parameterized.TestCase):
...
@@ -66,7 +66,7 @@ class TNLayerTest(tf.test.TestCase, parameterized.TestCase):
def
test_train
(
self
,
input_dim
,
proj_multiple
):
def
test_train
(
self
,
input_dim
,
proj_multiple
):
data
=
np
.
random
.
randint
(
10
,
size
=
(
100
,
input_dim
))
data
=
np
.
random
.
randint
(
10
,
size
=
(
100
,
input_dim
))
model
=
self
.
_build_model
(
data
,
proj_multiple
)
model
=
self
.
_build_model
(
data
,
proj_multiple
)
tf
.
random
.
set
_seed
(
0
)
tf
.
keras
.
utils
.
set_
random_seed
(
0
)
model
.
compile
(
model
.
compile
(
optimizer
=
'adam'
,
loss
=
'binary_crossentropy'
,
metrics
=
[
'accuracy'
])
optimizer
=
'adam'
,
loss
=
'binary_crossentropy'
,
metrics
=
[
'accuracy'
])
...
@@ -81,7 +81,7 @@ class TNLayerTest(tf.test.TestCase, parameterized.TestCase):
...
@@ -81,7 +81,7 @@ class TNLayerTest(tf.test.TestCase, parameterized.TestCase):
@
parameterized
.
parameters
((
768
,
6
),
(
1024
,
2
))
@
parameterized
.
parameters
((
768
,
6
),
(
1024
,
2
))
def
test_weights_change
(
self
,
input_dim
,
proj_multiple
):
def
test_weights_change
(
self
,
input_dim
,
proj_multiple
):
tf
.
random
.
set
_seed
(
0
)
tf
.
keras
.
utils
.
set_
random_seed
(
0
)
data
=
np
.
random
.
randint
(
10
,
size
=
(
100
,
input_dim
))
data
=
np
.
random
.
randint
(
10
,
size
=
(
100
,
input_dim
))
model
=
self
.
_build_model
(
data
,
proj_multiple
)
model
=
self
.
_build_model
(
data
,
proj_multiple
)
model
.
compile
(
model
.
compile
(
...
...
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