Python - tensorflow.IndexedSlicesSpec() Last Updated : 14 Mar, 2023 Comments Improve Suggest changes Like Article Like Report TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning neural networks. IndexedSlicesSpec inherits from TypeSpec and provides Type specification for IndexedSlices. Syntax: tensorflow.IndexedSlicesSpec( shape, dtype, indices_dtype, dense_shape_dtype, indices_shape ) Parameters: shape(optional): It defines the dense shape of IndexedSlices. Default value is None which allows any dense shape.dtype(optional): It defines the dtype of IndexedSlices values. Default value is float32.indices_dtype(optional): It defines the dtype of indices in the IndexedSlices. It can either be int32 or int64 with default value int64.dense_shape_dtype(optional): It defines the dtype of dense shape in the IndexedSlices. It can either be int32, int64 or None with default value None.indices_shape(optional): It defines the shape of the indices component, which indicates how many slices are in the IndexedSlices. Example 1: This example uses all the default values. Python3 # Importing the library import tensorflow as tf # Calculating result res = tf.IndexedSlicesSpec() # Printing the result print('IndexedSlicesSpec: ', res) Output: IndexedSlicesSpec: IndexedSlicesSpec(TensorShape(None), tf.float32, tf.int64, None, TensorShape([None])) Example 2: Python3 # Importing the library import tensorflow as tf # Calculating result res = tf.IndexedSlicesSpec((2, 3)) # Printing the result print('IndexedSlicesSpec: ', res) Output: IndexedSlicesSpec: IndexedSlicesSpec(TensorShape([2, 3]), tf.float32, tf.int64, None, TensorShape([None])) Comment More infoAdvertise with us Next Article Python - tensorflow.IndexedSlicesSpec() aman neekhara Follow Improve Article Tags : Python Python-Tensorflow Python Tensorflow-math-functions Practice Tags : python Similar Reads Python - tensorflow.IndexedSlices() TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning  neural networks. IndexedSlices() is used to find the sparse representation of a set of tensor slices at given indices. Syntax: tensorflow.IndexedSlices(values, indices, dense_shape = No 1 min read Python - tensorflow.IndexedSlices.op Attribute TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning  neural networks. op is used to find the operation used to that produces value as an output. It only works when eager execution is disabled. Syntax: tensorflow.IndexedSlices.op Returns: I 2 min read Python - tensorflow.IndexedSlices.indices Attribute TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning  neural networks. indices is used to find the indices of the slice. Syntax: tensorflow.IndexedSlices.indices Returns: It returns a 1-D Tensor containing the indices of slice. Example 1: P 1 min read Python - tensorflow.IndexedSlices.shape Attribute TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning  neural networks. shape is used to get the tensorflow.TensorShape representing the shape of the dense tensor. Syntax:  tensorflow.IndexedSlices.shape Returns:  It returns tensorflow.Tenso 1 min read Python - tensorflow.IndexedSlices.graph Attribute TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning  neural networks. graph is used to find the  Graph that contains the values, indices, and shape tensors. Syntax: tensorflow.IndexedSlices.graph Return: It returns a Graph instance. Examp 1 min read Python - tensorflow.IndexedSlices.dtype Attribute TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning  neural networks. dtype is used to find the type of values in Tensor. Syntax: tensorflow.IndexedSlices.dtype Returns: It returns the dtype of elements in the tensor. Example 1: Python3 # 1 min read Python - tensorflow.IndexedSlices.values Attribute TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning  neural networks. values is used to get the values of the slice. Syntax: tensorflow.IndexedSlices.values Returns: It returns a Tensor containing the values of the slice. Example 1: Python 1 min read Python - tensorflow.IndexedSlices.device Attribute TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning  neural networks. device is used to find the name of the device on which values will be generated. Syntax: tensorflow.IndexedSlices.device Returns: It returns the name of the device. Exam 1 min read Python - tensorflow.DeviceSpec.task Attribute TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning  neural networks. task is used to get the task index of DeviceSpec. Syntax: tensorflow.DeviceSpec.task Returns: It returns the task index of DeviceSpec Example 1: Python3 # Importing the 1 min read Python - tensorflow.identity() TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning  neural networks. identity() returns a Tensor with the same shape and contents as input. Syntax: tensorflow.identity(input, name) Parameters: input: It is a Tensor.name(optional): It def 2 min read Like