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

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.

主站蜘蛛池模板: 始兴县| 云南省| 鄂尔多斯市| 萨迦县| 呼伦贝尔市| 德保县| 车致| 临朐县| 乐至县| 青岛市| 东兰县| 贵定县| 和静县| 奈曼旗| 电白县| 江都市| 大石桥市| 洞头县| 连江县| 常州市| 香港 | 密山市| 涟源市| 尼木县| 安平县| 泾源县| 政和县| 绥江县| 滨海县| 望江县| 星座| 同德县| 赤峰市| 马山县| 绵阳市| 桃江县| 江山市| 肥乡县| 凤庆县| 漠河县| 绵阳市|