Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

tf.reduce_sum()

Computes the sum of elements across dimensions of a tensor. 

x = tf.constant([[1, 1, 1], [1, 1, 1]])
tf.reduce_sum(x)  # 6
tf.reduce_sum(x, 0)  # [2, 2, 2]
tf.reduce_sum(x, 1)  # [3, 3]
tf.reduce_sum(x, 1, keepdims=True)  # [[3], [3]]
tf.reduce_sum(x, [0, 1])  # 6
Comment

PREVIOUS NEXT
Code Example
Python :: jointplot title 
Python :: pandas dataframe add two columns int and string 
Python :: windows 10 python path 
Python :: map function in python 
Python :: python sum lists element wise 
Python :: convex hull python 
Python :: flask bootstrap 
Python :: pysimplegui themes 
Python :: make venv 
Python :: replace string between two regex python 
Python :: best python gui for desktop application 
Python :: python chat 
Python :: python json to dict 
Python :: restrict ticks to integers matplotlib 
Python :: how to get mac address in python 
Python :: how to declare global variable in python 
Python :: numpy multiply element wise 
Python :: python access each group 
Python :: confusion matrix with labels sklearn 
Python :: dataframe of one row 
Python :: save image to file from URL 
Python :: python threading return value 
Python :: find greatest number in list python 
Python :: NumPy unique Example Get unique values from a 1D Numpy array 
Python :: for loop example python 3 
Python :: python tkinter messagebox 
Python :: np.exp in python numpy 
Python :: pytorch cuda tensor in module 
Python :: Genisim python 
Python :: 231a codeforces solution in python 
ADD CONTENT
Topic
Content
Source link
Name
8+3 =