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

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.

主站蜘蛛池模板: 喀什市| 茂名市| 肥东县| 葫芦岛市| 德江县| 罗定市| 米脂县| 巩留县| 板桥市| 宜宾县| 长治市| 合水县| 赤水市| 新田县| 祁连县| 彭泽县| 中江县| 阿克苏市| 合江县| 广南县| 肇东市| 屏边| 饶平县| 昭觉县| 淮阳县| 建湖县| 玛多县| 兴和县| 仁化县| 青神县| 麻江县| 樟树市| 天镇县| 茂名市| 永寿县| 邻水| 沧源| 古交市| 正镶白旗| 崇仁县| 枣阳市|