Answers for "how to make a tensor in python"

2

tensorflow math python

c = tf.constant([[1,2,3,4], [-1,-2,-3,-4], [5,6,7,8]])
tf.math.segment_sum(c, tf.constant([0, 0, 1]))
#  ==>  [[0 0 0 0]
#        [5 6 7 8]]
Posted by: Guest on August-12-2021
0

how to create tensor with tensorflow

a = tf.constant([[1.0, 2.0], [3.0, 4.0]])
b = tf.Variable([[1.0, 2.0], [3.0, 4.0]])
Posted by: Guest on October-08-2021

Code answers related to "how to make a tensor in python"

Python Answers by Framework

Browse Popular Code Answers by Language