31
31
from tensorflow_datasets .core import naming
32
32
from tensorflow_datasets .core import writer as writer_lib
33
33
from tensorflow_datasets .core .utils import shard_utils
34
- from tensorflow_datasets .core .writer import _ShardSpec
35
34
36
35
37
36
class GetShardSpecsTest (testing .TestCase ):
@@ -55,7 +54,7 @@ def test_1bucket_6shards(self):
55
54
specs ,
56
55
[
57
56
# Shard#, path, from_bucket, examples_number, reading instructions.
58
- _ShardSpec (
57
+ writer_lib . _ShardSpec (
59
58
0 ,
60
59
'/bar-train.tfrecord-00000-of-00006' ,
61
60
'/bar-train.tfrecord-00000-of-00006_index.json' ,
@@ -66,7 +65,7 @@ def test_1bucket_6shards(self):
66
65
),
67
66
],
68
67
),
69
- _ShardSpec (
68
+ writer_lib . _ShardSpec (
70
69
1 ,
71
70
'/bar-train.tfrecord-00001-of-00006' ,
72
71
'/bar-train.tfrecord-00001-of-00006_index.json' ,
@@ -77,7 +76,7 @@ def test_1bucket_6shards(self):
77
76
),
78
77
],
79
78
),
80
- _ShardSpec (
79
+ writer_lib . _ShardSpec (
81
80
2 ,
82
81
'/bar-train.tfrecord-00002-of-00006' ,
83
82
'/bar-train.tfrecord-00002-of-00006_index.json' ,
@@ -88,7 +87,7 @@ def test_1bucket_6shards(self):
88
87
),
89
88
],
90
89
),
91
- _ShardSpec (
90
+ writer_lib . _ShardSpec (
92
91
3 ,
93
92
'/bar-train.tfrecord-00003-of-00006' ,
94
93
'/bar-train.tfrecord-00003-of-00006_index.json' ,
@@ -99,7 +98,7 @@ def test_1bucket_6shards(self):
99
98
),
100
99
],
101
100
),
102
- _ShardSpec (
101
+ writer_lib . _ShardSpec (
103
102
4 ,
104
103
'/bar-train.tfrecord-00004-of-00006' ,
105
104
'/bar-train.tfrecord-00004-of-00006_index.json' ,
@@ -110,7 +109,7 @@ def test_1bucket_6shards(self):
110
109
),
111
110
],
112
111
),
113
- _ShardSpec (
112
+ writer_lib . _ShardSpec (
114
113
5 ,
115
114
'/bar-train.tfrecord-00005-of-00006' ,
116
115
'/bar-train.tfrecord-00005-of-00006_index.json' ,
@@ -141,7 +140,7 @@ def test_4buckets_2shards(self):
141
140
specs ,
142
141
[
143
142
# Shard#, path, examples_number, reading instructions.
144
- _ShardSpec (
143
+ writer_lib . _ShardSpec (
145
144
0 ,
146
145
'/bar-train.tfrecord-00000-of-00002' ,
147
146
'/bar-train.tfrecord-00000-of-00002_index.json' ,
@@ -155,7 +154,7 @@ def test_4buckets_2shards(self):
155
154
),
156
155
],
157
156
),
158
- _ShardSpec (
157
+ writer_lib . _ShardSpec (
159
158
1 ,
160
159
'/bar-train.tfrecord-00001-of-00002' ,
161
160
'/bar-train.tfrecord-00001-of-00002_index.json' ,
@@ -520,7 +519,8 @@ def test_write_tfrecord_with_ignored_duplicates(self):
520
519
def test_empty_split (self ):
521
520
with self .assertRaisesWithPredicateMatch (
522
521
ValueError ,
523
- 'The total number of generated examples is 0. This should be >0!' ,
522
+ 'The total number of generated examples is 0 for split train. This'
523
+ ' should be >0!' ,
524
524
):
525
525
self ._write (to_write = [])
526
526
0 commit comments