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

Method testRaggedChain

tensorflow/python/data/kernel_tests/map_test.py:776–792  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

774 expected_output=[ragged_factory_ops.constant([[i]]) for i in range(5)])
775
776 def testRaggedChain(self):
777
778 def _ragged(i):
779 return ragged_tensor.RaggedTensor.from_tensor(i * [[1]])
780
781 def _concat(i):
782 self.assertTrue(ragged_tensor.is_ragged(i))
783 return ragged_concat_ops.concat([i, i], 0)
784
785 dataset = dataset_ops.Dataset.range(10).map(_ragged).map(_concat)
786
787 self.assertDatasetProduces(
788 dataset,
789 expected_output=[
790 self.evaluate(_concat(ragged_factory_ops.constant([[i]])))
791 for i in range(10)
792 ])
793
794 @test_util.run_v1_only("b/123904513")
795 def testParallelMapOutOfRangeError(self):

Callers

nothing calls this directly

Calls 7

_concatFunction · 0.85
assertDatasetProducesMethod · 0.80
rangeFunction · 0.50
mapMethod · 0.45
rangeMethod · 0.45
evaluateMethod · 0.45
constantMethod · 0.45

Tested by

no test coverage detected