TensorFlow: tf.reshape

使用TensorFlow的过程中,我们经常用到reshape函数,今天我看到一个新东西;

reshape函数里面,若是维度的数值为-1,则表示这个维度由程序根据数据自己运算出来。

若是2维,固定一个参数,另一个就可以设置成-1,,例如:

reshape = tf.reshape(norm1, shape=[1, -1])

参考:https://blog.csdn.net/xiaopihaierletian/article/details/64128424

猜你喜欢

转载自blog.csdn.net/weixin_41765699/article/details/82884813
今日推荐