[tf.data] Move cardinality op out of experimental
PiperOrigin-RevId: 314574956 Change-Id: I9f724070c3c348b048ebb29e6619eaf88da4f5f4
This commit is contained in:
parent
a4799e5246
commit
2686074524
@ -415,6 +415,11 @@ REGISTER_OP("AnonymousSeedGenerator")
|
||||
return Status::OK();
|
||||
});
|
||||
|
||||
REGISTER_OP("DatasetCardinality")
|
||||
.Input("input_dataset: variant")
|
||||
.Output("cardinality: int64")
|
||||
.SetShapeFn(shape_inference::ScalarShape);
|
||||
|
||||
REGISTER_OP("DeleteSeedGenerator")
|
||||
.Input("handle: resource")
|
||||
.Input("deleter: variant")
|
||||
|
@ -229,11 +229,6 @@ REGISTER_OP("ExperimentalCSVDataset")
|
||||
return shape_inference::ScalarShape(c);
|
||||
});
|
||||
|
||||
REGISTER_OP("DatasetCardinality")
|
||||
.Input("input_dataset: variant")
|
||||
.Output("cardinality: int64")
|
||||
.SetShapeFn(shape_inference::ScalarShape);
|
||||
|
||||
REGISTER_OP("ExperimentalDatasetCardinality")
|
||||
.Input("input_dataset: variant")
|
||||
.Output("cardinality: int64")
|
||||
|
@ -20,6 +20,7 @@ from __future__ import print_function
|
||||
from tensorflow.python.data.ops import dataset_ops
|
||||
from tensorflow.python.framework import dtypes
|
||||
from tensorflow.python.framework import ops
|
||||
from tensorflow.python.ops import gen_dataset_ops
|
||||
from tensorflow.python.ops import gen_experimental_dataset_ops as ged_ops
|
||||
from tensorflow.python.util.tf_export import tf_export
|
||||
|
||||
@ -64,7 +65,7 @@ def cardinality(dataset):
|
||||
constant `INFINITE_CARDINALITY` and `UNKNOWN_CARDINALITY` respectively.
|
||||
"""
|
||||
|
||||
return ged_ops.dataset_cardinality(dataset._variant_tensor) # pylint: disable=protected-access
|
||||
return gen_dataset_ops.dataset_cardinality(dataset._variant_tensor) # pylint: disable=protected-access
|
||||
|
||||
|
||||
@tf_export("data.experimental.assert_cardinality")
|
||||
|
@ -2157,7 +2157,7 @@ name=None))
|
||||
named constants `tf.data.INFINITE_CARDINALITY` and
|
||||
`tf.data.UNKNOWN_CARDINALITY` respectively.
|
||||
"""
|
||||
return ged_ops.dataset_cardinality(self._variant_tensor)
|
||||
return gen_dataset_ops.dataset_cardinality(self._variant_tensor)
|
||||
|
||||
|
||||
@tf_export(v1=["data.Dataset"])
|
||||
|
Loading…
Reference in New Issue
Block a user