Python - tensorflow.IndexedSlices.graph Attribute Last Updated : 20 Jul, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report 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. Example 1: Python3 # Importing the library import tensorflow as tf # Initializing the input data = tf.constant([[1, 2, 3], [4, 5, 6]], dtype = tf.float32) # Printing the input print('data: ', data) # Calculating result res = tf.IndexedSlices(data, [0]) # Finding Graph @tf.function def gfg(): tf.compat.v1.disable_eager_execution() graph = res.graph # Printing the result print('graph: ', graph) gfg() Output: data: Tensor("Const_1:0", shape=(2, 3), dtype=float32) graph: <tensorflow.python.framework.ops.Graph object at 0x7f2eeda9e630> <tf.Operation 'PartitionedCall_1' type=PartitionedCall> Example 2: Python3 # Importing the library import tensorflow as tf # Initializing the input data = tf.constant([1, 2, 3]) # Printing the input print('data: ', data) # Calculating result res = tf.IndexedSlices(data, [0]) # Finding Graph graph = res.graph # Printing the result print('graph: ', graph) Output: data: Tensor("Const_6:0", shape=(3, ), dtype=int32) graph: <tensorflow.python.framework.ops.Graph object at 0x7f2eeda9e630> Comment More infoAdvertise with us Next Article Python - tensorflow.IndexedSlices.device Attribute A aman neekhara Follow Improve Article Tags : Python Python-Tensorflow Practice Tags : python Similar Reads 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.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.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.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.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.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 Like