[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-03-17 UTC."],[],[],null,["# tf.data.DatasetSpec\n\n\u003cbr /\u003e\n\n|-------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.9.3/tensorflow/python/data/ops/dataset_ops.py#L4299-L4454) |\n\nType specification for [`tf.data.Dataset`](../../tf/data/Dataset).\n\nInherits From: [`TypeSpec`](../../tf/TypeSpec), [`TraceType`](../../tf/types/experimental/TraceType)\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.data.DatasetSpec`](https://www.tensorflow.org/api_docs/python/tf/data/DatasetSpec), [`tf.compat.v1.data.experimental.DatasetStructure`](https://www.tensorflow.org/api_docs/python/tf/data/DatasetSpec)\n\n\u003cbr /\u003e\n\n tf.data.DatasetSpec(\n element_spec, dataset_shape=()\n )\n\nSee [`tf.TypeSpec`](../../tf/TypeSpec) for more information about TensorFlow type specifications. \n\n dataset = tf.data.Dataset.range(3)\n tf.data.DatasetSpec.from_value(dataset)\n DatasetSpec(TensorSpec(shape=(), dtype=tf.int64, name=None), TensorShape([]))\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Attributes ---------- ||\n|----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `element_spec` | The inner element spec. |\n| `value_type` | The Python type for values that are compatible with this TypeSpec. \u003cbr /\u003e In particular, all values that are compatible with this TypeSpec must be an instance of this type. |\n\n\u003cbr /\u003e\n\nMethods\n-------\n\n### `from_value`\n\n[View source](https://github.com/tensorflow/tensorflow/blob/v2.9.3/tensorflow/python/data/ops/dataset_ops.py#L4418-L4421) \n\n @staticmethod\n from_value(\n value\n )\n\nCreates a `DatasetSpec` for the given [`tf.data.Dataset`](../../tf/data/Dataset) value.\n\n### `is_compatible_with`\n\n[View source](https://github.com/tensorflow/tensorflow/blob/v2.9.3/tensorflow/python/framework/type_spec.py#L193-L214) \n\n is_compatible_with(\n spec_or_value\n )\n\nReturns true if `spec_or_value` is compatible with this TypeSpec.\n\nPrefer using \"is_subtype_of\" and \"most_specific_common_supertype\" wherever\npossible.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|-----------------|-------------------------------------------------------------|\n| `spec_or_value` | A TypeSpec or TypeSpec associated value to compare against. |\n\n\u003cbr /\u003e\n\n### `is_subtype_of`\n\n[View source](https://github.com/tensorflow/tensorflow/blob/v2.9.3/tensorflow/python/data/ops/dataset_ops.py#L4327-L4351) \n\n is_subtype_of(\n other\n )\n\nSee base class.\n\n### `most_specific_common_supertype`\n\n[View source](https://github.com/tensorflow/tensorflow/blob/v2.9.3/tensorflow/python/data/ops/dataset_ops.py#L4353-L4390) \n\n most_specific_common_supertype(\n others\n )\n\nSee base class.\n\n### `most_specific_compatible_type`\n\n[View source](https://github.com/tensorflow/tensorflow/blob/v2.9.3/tensorflow/python/framework/type_spec.py#L216-L234) \n\n most_specific_compatible_type(\n other: 'TypeSpec'\n ) -\u003e 'TypeSpec'\n\nReturns the most specific TypeSpec compatible with `self` and `other`. (deprecated)\n| **Deprecated:** THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Use most_specific_common_supertype instead.\n\nDeprecated. Please use `most_specific_common_supertype` instead.\nDo not override this function.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|---------|---------------|\n| `other` | A `TypeSpec`. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ||\n|--------------|--------------------------------------------------------------------------|\n| `ValueError` | If there is no TypeSpec that is compatible with both `self` and `other`. |\n\n\u003cbr /\u003e\n\n### `__eq__`\n\n[View source](https://github.com/tensorflow/tensorflow/blob/v2.9.3/tensorflow/python/data/ops/dataset_ops.py#L4451-L4454) \n\n __eq__(\n other\n )\n\nReturn self==value.\n\n### `__ne__`\n\n[View source](https://github.com/tensorflow/tensorflow/blob/v2.9.3/tensorflow/python/framework/type_spec.py#L443-L444) \n\n __ne__(\n other\n ) -\u003e bool\n\nReturn self!=value."]]