09 2020 档案

摘要:1 tf.pad() tf.pad()函数主要是用来对tensor的大小进行扩展,包括水平、垂直、深度(通道)等,方法定义如下: pad(tensor,paddings,mode="CONSTANT",name=None,constant_values=0) 输入参数: tensor:输入的tens 阅读全文
posted @ 2020-09-30 21:55 Chenjin2018 阅读(427) 评论(0) 推荐(0)
摘要:1 排序 1.1 sort:返回排序后的Tensor import tensorflow as tf a = tf.random.shuffle(tf.range(6)) a <tf.Tensor: id=4, shape=(6,), dtype=int32, numpy=array([3, 2, 阅读全文
posted @ 2020-09-30 21:00 Chenjin2018 阅读(2132) 评论(0) 推荐(0)
摘要:1 基本运算:(+、-、*、/、//、%) 基本运算中所有实例都以下面的张量a、b为例进行: import tensorflow as tf a = tf.random.uniform([2,3],minval=1,maxval=6,dtype=tf.int32) b = tf.random.uni 阅读全文
posted @ 2020-09-28 22:07 Chenjin2018 阅读(575) 评论(0) 推荐(0)
摘要:1 创建 1.1 constant()方法 import tensorflow as tf tf.constant(1) #创建一个整型张量 <tf.Tensor: id=4, shape=(), dtype=int32, numpy=1> tf.constant(1.) #创建一个浮点型张量 <t 阅读全文
posted @ 2020-09-21 20:23 Chenjin2018 阅读(549) 评论(0) 推荐(0)