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
b625f436
Commit
b625f436
authored
Oct 28, 2020
by
Abdullah Rashwan
Committed by
A. Unique TensorFlower
Oct 28, 2020
Browse files
Internal change
PiperOrigin-RevId: 339558965
parent
57a2de4d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
official/modeling/hyperparams/params_dict.py
official/modeling/hyperparams/params_dict.py
+0
-1
official/modeling/hyperparams/params_dict_test.py
official/modeling/hyperparams/params_dict_test.py
+3
-0
No files found.
official/modeling/hyperparams/params_dict.py
View file @
b625f436
...
@@ -69,7 +69,6 @@ class ParamsDict(object):
...
@@ -69,7 +69,6 @@ class ParamsDict(object):
if
default_params
is
None
:
if
default_params
is
None
:
default_params
=
{}
default_params
=
{}
self
.
override
(
default_params
,
is_strict
=
False
)
self
.
override
(
default_params
,
is_strict
=
False
)
self
.
validate
()
def
_set
(
self
,
k
,
v
):
def
_set
(
self
,
k
,
v
):
if
isinstance
(
v
,
dict
):
if
isinstance
(
v
,
dict
):
...
...
official/modeling/hyperparams/params_dict_test.py
View file @
b625f436
...
@@ -155,6 +155,7 @@ class ParamsDictTest(tf.test.TestCase):
...
@@ -155,6 +155,7 @@ class ParamsDictTest(tf.test.TestCase):
# Raise error due to the unknown parameter.
# Raise error due to the unknown parameter.
with
self
.
assertRaises
(
KeyError
):
with
self
.
assertRaises
(
KeyError
):
params
=
params_dict
.
ParamsDict
({
'a'
:
1
,
'b'
:
{
'a'
:
11
}},
[
'a == c'
])
params
=
params_dict
.
ParamsDict
({
'a'
:
1
,
'b'
:
{
'a'
:
11
}},
[
'a == c'
])
params
.
validate
()
# OK to check equality of two nested dicts.
# OK to check equality of two nested dicts.
params
=
params_dict
.
ParamsDict
({
params
=
params_dict
.
ParamsDict
({
...
@@ -170,6 +171,7 @@ class ParamsDictTest(tf.test.TestCase):
...
@@ -170,6 +171,7 @@ class ParamsDictTest(tf.test.TestCase):
# Raise error due to inconsistency
# Raise error due to inconsistency
with
self
.
assertRaises
(
KeyError
):
with
self
.
assertRaises
(
KeyError
):
params
=
params_dict
.
ParamsDict
({
'a'
:
1
,
'c'
:
{
'a'
:
10
}},
[
'a == c.a'
])
params
=
params_dict
.
ParamsDict
({
'a'
:
1
,
'c'
:
{
'a'
:
10
}},
[
'a == c.a'
])
params
.
validate
()
# Valid rule.
# Valid rule.
params
=
params_dict
.
ParamsDict
({
'a'
:
1
,
'c'
:
{
'a'
:
1
}},
[
'a == c.a'
])
params
=
params_dict
.
ParamsDict
({
'a'
:
1
,
'c'
:
{
'a'
:
1
}},
[
'a == c.a'
])
...
@@ -194,6 +196,7 @@ class ParamsDictTest(tf.test.TestCase):
...
@@ -194,6 +196,7 @@ class ParamsDictTest(tf.test.TestCase):
'a'
:
1
'a'
:
1
}
}
},
[
'a == None'
,
'c.a == 1'
])
},
[
'a == None'
,
'c.a == 1'
])
params
.
validate
()
class
ParamsDictIOTest
(
tf
.
test
.
TestCase
):
class
ParamsDictIOTest
(
tf
.
test
.
TestCase
):
...
...
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