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
ca2db9bd
Commit
ca2db9bd
authored
Sep 28, 2018
by
Chris Shallue
Committed by
Christopher Shallue
Oct 16, 2018
Browse files
Fix failing test in dataset_ops_test caused by TensorFlow changing an exception type.
PiperOrigin-RevId: 215014489
parent
ab6e3fa2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
12 deletions
+19
-12
research/astronet/astronet/ops/dataset_ops_test.py
research/astronet/astronet/ops/dataset_ops_test.py
+0
-10
research/astronet/astrowavenet/data/BUILD
research/astronet/astrowavenet/data/BUILD
+17
-0
research/astronet/astrowavenet/data/synthetic_transit_maker_test.py
...stronet/astrowavenet/data/synthetic_transit_maker_test.py
+2
-2
No files found.
research/astronet/astronet/ops/dataset_ops_test.py
View file @
ca2db9bd
...
...
@@ -48,11 +48,6 @@ class DatasetOpsTest(tf.test.TestCase):
self
.
assertEqual
([
5
],
tensor_1d
.
shape
)
self
.
assertAllEqual
([
0
,
1
,
2
,
3
,
4
],
tensor_1d
.
eval
())
# Invalid to pad Tensor with batch size 5 to batch size 3.
tensor_1d_pad3
=
dataset_ops
.
pad_tensor_to_batch_size
(
tensor_1d
,
3
)
with
self
.
assertRaises
(
tf
.
errors
.
InvalidArgumentError
):
tensor_1d_pad3
.
eval
()
tensor_1d_pad5
=
dataset_ops
.
pad_tensor_to_batch_size
(
tensor_1d
,
5
)
self
.
assertEqual
([
5
],
tensor_1d_pad5
.
shape
)
self
.
assertAllEqual
([
0
,
1
,
2
,
3
,
4
],
tensor_1d_pad5
.
eval
())
...
...
@@ -66,11 +61,6 @@ class DatasetOpsTest(tf.test.TestCase):
self
.
assertEqual
([
3
,
3
],
tensor_2d
.
shape
)
self
.
assertAllEqual
([[
0
,
1
,
2
],
[
3
,
4
,
5
],
[
6
,
7
,
8
]],
tensor_2d
.
eval
())
tensor_2d_pad2
=
dataset_ops
.
pad_tensor_to_batch_size
(
tensor_2d
,
2
)
# Invalid to pad Tensor with batch size 2 to batch size 2.
with
self
.
assertRaises
(
tf
.
errors
.
InvalidArgumentError
):
tensor_2d_pad2
.
eval
()
tensor_2d_pad3
=
dataset_ops
.
pad_tensor_to_batch_size
(
tensor_2d
,
3
)
self
.
assertEqual
([
3
,
3
],
tensor_2d_pad3
.
shape
)
self
.
assertAllEqual
([[
0
,
1
,
2
],
[
3
,
4
,
5
],
[
6
,
7
,
8
]],
...
...
research/astronet/astrowavenet/data/BUILD
0 → 100644
View file @
ca2db9bd
package
(
default_visibility
=
[
"//visibility:public"
])
licenses
([
"notice"
])
# Apache 2.0
py_library
(
name
=
"synthetic_transit_maker"
,
srcs
=
[
"synthetic_transit_maker.py"
,
],
)
py_test
(
name
=
"synthetic_transit_maker_test"
,
srcs
=
[
"synthetic_transit_maker_test.py"
],
srcs_version
=
"PY2AND3"
,
deps
=
[
":synthetic_transit_maker"
],
)
research/astronet/astrowavenet/data/synthetic_transit_maker_test.py
View file @
ca2db9bd
...
...
@@ -92,8 +92,8 @@ class SyntheticTransitMakerTest(absltest.TestCase):
time
=
np
.
linspace
(
0
,
100
,
100
)
flux
,
mask
=
transit_maker
.
random_light_curve
(
time
)
self
.
assertAllClose
(
flux
,
gold_flux
)
self
.
assertAllClose
(
mask
,
np
.
ones
(
100
))
np
.
testing
.
assert_array_almost_equal
(
flux
,
gold_flux
)
np
.
testing
.
assert_array_almost_equal
(
mask
,
np
.
ones
(
100
))
def
testRandomLightCurveGenerator
(
self
):
transit_maker
=
synthetic_transit_maker
.
SyntheticTransitMaker
()
...
...
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