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

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.

主站蜘蛛池模板: 桂东县| 和静县| 门头沟区| 习水县| 武义县| 南郑县| 江油市| 怀宁县| 建宁县| 曲松县| 厦门市| 宜都市| 姚安县| 江永县| 舟山市| 鄯善县| 武山县| 大安市| 桃园县| 九寨沟县| 高淳县| 洪泽县| 安达市| 信阳市| 柘荣县| 连云港市| 武汉市| 武隆县| 农安县| 茌平县| 漾濞| 保亭| 平罗县| 邯郸市| 锡林郭勒盟| 黄山市| 镇安县| 昌都县| 日喀则市| 黑水县| 隆回县|