MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / from_tensors

Method from_tensors

tensorflow/python/data/ops/dataset_ops.py:450–467  ·  view source on GitHub ↗

Creates a `Dataset` with a single element, comprising the given tensors. Note that if `tensors` contains a NumPy array, and eager execution is not enabled, the values will be embedded in the graph as one or more `tf.constant` operations. For large datasets (> 1 GB), this can waste m

(tensors)

Source from the content-addressed store, hash-verified

448
449 @staticmethod
450 def from_tensors(tensors):
451 """Creates a `Dataset` with a single element, comprising the given tensors.
452
453 Note that if `tensors` contains a NumPy array, and eager execution is not
454 enabled, the values will be embedded in the graph as one or more
455 `tf.constant` operations. For large datasets (> 1 GB), this can waste
456 memory and run into byte limits of graph serialization. If `tensors`
457 contains one or more large NumPy arrays, consider the alternative described
458 in [this
459 guide](https://tensorflow.org/guide/datasets#consuming_numpy_arrays).
460
461 Args:
462 tensors: A dataset element.
463
464 Returns:
465 Dataset: A `Dataset`.
466 """
467 return TensorDataset(tensors)
468
469 @staticmethod
470 def from_tensor_slices(tensors):

Callers 15

testGpuTensorMethod · 0.45
make_iteratorMethod · 0.45
_create_graphMethod · 0.45
random_datasetFunction · 0.45
_benchmark_applyMethod · 0.45
_benchmark_trainMethod · 0.45
benchmark_graph_trainMethod · 0.45
make_iteratorMethod · 0.45
benchmark_graph_trainMethod · 0.45
make_iteratorMethod · 0.45

Calls 1

TensorDatasetClass · 0.70

Tested by 15

testGpuTensorMethod · 0.36
make_iteratorMethod · 0.36
_create_graphMethod · 0.36
random_datasetFunction · 0.36
_benchmark_applyMethod · 0.36
_benchmark_trainMethod · 0.36
benchmark_graph_trainMethod · 0.36
make_iteratorMethod · 0.36
benchmark_graph_trainMethod · 0.36
make_iteratorMethod · 0.36