Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

tf.squeeze()

Removes dimensions of size 1 from the shape of a tensor.

tf.squeeze(
    input, axis=None, name=None
)

Given a tensor input, this operation returns a tensor of the same 
type with all dimensions of size 1 removed. If you don't want to 
remove all size 1 dimensions, you can remove specific size 1 
dimensions by specifying axis.

Example:
# 't' is a tensor of shape [1, 2, 1, 3, 1, 1]
tf.shape(tf.squeeze(t))  # [2, 3]
# 't' is a tensor of shape [1, 2, 1, 3, 1, 1]
tf.shape(tf.squeeze(t, [2, 4]))  # [1, 2, 3, 1]
Comment

PREVIOUS NEXT
Code Example
Python :: upgrade python to 3.8 
Python :: csrf token exempt django 
Python :: how to get the angle of mouse from the center 
Python :: find elements by class name selenium python 
Python :: pandas read_csv random rows 
Python :: how to change font sizetkniter 
Python :: reduced fraction python 
Python :: python input separated by 
Python :: python random from normal distribution 
Python :: selenium current url 
Python :: python WhatsApp messaging spammer 
Python :: remove unicode from string python 
Python :: python image to pdf 
Python :: python first two numbers 
Python :: normalize data python pandas 
Python :: how to split channels wav python 
Python :: how to check suffix in python 
Python :: to int in pandas 
Python :: no limit row pandas 
Python :: how to accept input as list pyhton 
Python :: get ip from request django 
Python :: python - remove repeted columns in a df 
Python :: crear matriz python for 
Python :: random matrix python 
Python :: mean of a list python 
Python :: difference between two dates in days python 
Python :: bail bond cowboys 
Python :: den pfad der python datei rausfinden 
Python :: python list contains substring 
Python :: how to put iput python 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =