-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR exposes TIFF and LMDB in R bindings. Note: The plan is to relase 0.3.0 with TIFF and LMDB with TensorFlow 1.12.0 support. Then release 0.4.0 with TensorFlow 1.13.0 support. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
- Loading branch information
Showing
6 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#' Create a `LMDBDataset`. | ||
#' | ||
#' This function allows a user to read data from a LMDB | ||
#' file. A lmdb file consists of (key value) pairs sequentially. | ||
#' | ||
#' @param filenames A `tf.string` tensor containing one or more filenames. | ||
#' | ||
#' @examples \dontrun{ | ||
#' dataset <- sequence_file_dataset("testdata/data.mdb") %>% | ||
#' dataset_repeat(1) | ||
#' | ||
#' sess <- tf$Session() | ||
#' iterator <- make_iterator_one_shot(dataset) | ||
#' next_batch <- iterator_get_next(iterator) | ||
#' | ||
#' until_out_of_range({ | ||
#' batch <- sess$run(next_batch) | ||
#' print(batch) | ||
#' }) | ||
#' } | ||
#' | ||
#' @export | ||
lmdb_dataset <- function(filenames) { | ||
dataset <- tfio_lib$lmdb$LMDBDataset(filenames = filenames) | ||
as_tf_dataset(dataset) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters