Skip to content

Commit 7f5ddb3

Browse files
authored
[DATA] Supports hb.data.Iterator
This patch introduces `hb.data.Iterator`, which optimizes cross-device transfers of inputs. Example: ``` iterator = tf.data.make_one_shot_iterator(ds) iterator = hb.data.Iterator(iterator) features = iterator.get_next() hooks.append(hb.data.Iterator.Hook()) ```
1 parent 911f8ca commit 7f5ddb3

8 files changed

Lines changed: 781 additions & 183 deletions

File tree

examples/ranking/train_criteo_terabyte_v1.py renamed to examples/ranking/train_criteo_terabyte.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def main(args):
194194
while not sess.should_stop():
195195
sess.run(train_op)
196196

197-
hb.saved_model.export(
197+
hb.train.export(
198198
args.savedmodel_dir,
199199
tf.train.latest_checkpoint(args.output_dir),
200200
model.predict)

examples/ranking/tutorial.ipynb

Lines changed: 0 additions & 110 deletions
This file was deleted.

hybridbackend/tensorflow/data/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from hybridbackend.tensorflow.data.dataframe import unbatch_and_to_sparse
2727
from hybridbackend.tensorflow.data.parquet.dataset import ParquetDataset
2828
from hybridbackend.tensorflow.data.parquet.dataset import read_parquet
29+
from hybridbackend.tensorflow.data.prefetch.ops import Iterator
2930
from hybridbackend.tensorflow.data.rebatch.dataset import RebatchDataset
3031
from hybridbackend.tensorflow.data.rebatch.dataset import rebatch
3132

hybridbackend/tensorflow/layers/__init__.py renamed to hybridbackend/tensorflow/data/prefetch/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,9 @@
1313
# limitations under the License.
1414
# =============================================================================
1515

16-
r'''HybridBackend Layers.
16+
r'''Prefetching related classes and functions.
1717
'''
1818

1919
from __future__ import absolute_import
2020
from __future__ import division
2121
from __future__ import print_function
22-
23-
from hybridbackend.tensorflow.feature_column.dense_features import \
24-
DenseFeatures

0 commit comments

Comments
 (0)