Back
Like pandas_df.shape is there any way for tensorflow.data.Dataset? Thanks.
If you want to retrieve shapes you can use Dataset._tensors attribute for it as depicted in the below code:
import tensorflow as tfdef dataset_shapes(dataset): try: return [x.get_shape().as_list() for x in dataset._tensors] except TypeError: return dataset._tensors.get_shape().as_list()
import tensorflow as tf
def dataset_shapes(dataset):
try:
return [x.get_shape().as_list() for x in dataset._tensors]
except TypeError:
return dataset._tensors.get_shape().as_list()
If you wish to know TensorFlow visit this TensorFlow Tutorial.
31k questions
32.8k answers
501 comments
693 users