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

Method range

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

Creates a `Dataset` of a step-separated range of values. For example: ```python Dataset.range(5) == [0, 1, 2, 3, 4] Dataset.range(2, 5) == [2, 3, 4] Dataset.range(1, 5, 2) == [1, 3] Dataset.range(1, 5, -2) == [] Dataset.range(5, 1) == [] Dataset.range(5, 1, -2) == [

(*args)

Source from the content-addressed store, hash-verified

730
731 @staticmethod
732 def range(*args):
733 """Creates a `Dataset` of a step-separated range of values.
734
735 For example:
736
737 ```python
738 Dataset.range(5) == [0, 1, 2, 3, 4]
739 Dataset.range(2, 5) == [2, 3, 4]
740 Dataset.range(1, 5, 2) == [1, 3]
741 Dataset.range(1, 5, -2) == []
742 Dataset.range(5, 1) == []
743 Dataset.range(5, 1, -2) == [5, 3]
744 ```
745
746 Args:
747 *args: follows the same semantics as python's xrange.
748 len(args) == 1 -> start = 0, stop = args[0], step = 1
749 len(args) == 2 -> start = args[0], stop = args[1], step = 1
750 len(args) == 3 -> start = args[0], stop = args[1, stop = args[2]
751
752 Returns:
753 Dataset: A `RangeDataset`.
754
755 Raises:
756 ValueError: if len(args) == 0.
757 """
758 return RangeDataset(*args)
759
760 @staticmethod
761 def zip(datasets):

Callers 15

_transpose_batch_timeFunction · 0.45
_transpose_batch_timeFunction · 0.45
_transpose_batch_timeFunction · 0.45
_transpose_batch_timeFunction · 0.45
StreamingFilesDatasetFunction · 0.45
testGradientMethod · 0.45
testInt64IndicesMethod · 0.45
testHostVsDeviceMethod · 0.45
testInt64ShapeMethod · 0.45
testMixedIndexTypesMethod · 0.45

Calls 1

RangeDatasetClass · 0.70

Tested by 15

testGradientMethod · 0.36
testInt64IndicesMethod · 0.36
testHostVsDeviceMethod · 0.36
testInt64ShapeMethod · 0.36
testMixedIndexTypesMethod · 0.36
fMethod · 0.36
testInsideFunctionMethod · 0.36
_logSumExpMapMethod · 0.36
_RangeMethod · 0.36