官术网_书友最值得收藏!

Transposing TensorFlow and matrix multiplication

To transpose a matrix and matrix multiplication eagerly, use the following:

u = tf.constant([[3,4,3]]) 
v = tf.constant([[1,2,1]])
tf.matmul(u, tf.transpose(a=v))

The output will be as follows:

<tf.Tensor: id=555345, shape=(1, 1), dtype=int32, numpy=array([[14]], dtype=int32)>

Note, again, that the default integer type is tf.int32 and the default float type is tf.float32.

All of the operations that are available for tensors that form part of a computational graph are also available for eager execution variables.

There is a complete list of these operations at https://www.tensorflow.org/api_guides/python/math_ops.

主站蜘蛛池模板: 马关县| 文水县| 南充市| 枣阳市| 德惠市| 托克逊县| 泽库县| 高陵县| 芜湖县| 巫溪县| 阜康市| 象山县| 凤翔县| 武功县| 东源县| 绥德县| 海城市| 汝阳县| 怀宁县| 延津县| 开封县| 桦南县| 手机| 渭源县| 景宁| 河东区| 丰都县| 永兴县| 福安市| 苏尼特左旗| 桑植县| 福建省| 循化| 行唐县| 岗巴县| 曲麻莱县| 观塘区| 长沙市| 汽车| 集安市| 绵阳市|