TensorFlow ist eine Open-Source-Python-Bibliothek, die von Google entwickelt wurde, um Modelle für machine learning und neuronale Netzwerke für deep learning zu entwickeln. 

dens_shape gibt einen 1-D-Tensor zurück, der die Form des entsprechenden dichten Tensors enthält. 

Syntax: tensorflow.IndexedSlices.dense_shape

Rückgabe : Es wird ein 1-D-Tensor zurückgegeben.

Beispiel 1:



import tensorflow as tf 
  
data = tf.constant([1, 2, 3]) 
  
print('data: ', data) 
  
res = tf.IndexedSlices(data, [0], 2) 
  
dense = res.dense_shape 
  
print('dense shape: ', dense)

Ausgabe:

Daten: tf.Tensor ([1 2 3], Form = (3,), dtype = int32)
dichte Form: 2

Beispiel 2:

import tensorflow as tf 
  
data = tf.constant([1, 2, 3]) 
  
print('data: ', data) 
  
res = tf.IndexedSlices(data, [0]) 
  
dense = res.dense_shape 
  
print('dense shape: ', dense)

Ausgabe:

Daten: tf.Tensor ([1 2 3], Form = (3,), dtype = int32)
dichte Form: Keine