09 2020 档案
摘要:1 tf.pad() tf.pad()函数主要是用来对tensor的大小进行扩展,包括水平、垂直、深度(通道)等,方法定义如下: pad(tensor,paddings,mode="CONSTANT",name=None,constant_values=0) 输入参数: tensor:输入的tens
阅读全文
摘要: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,
阅读全文
摘要:1 基本运算:(+、-、*、/、//、%) 基本运算中所有实例都以下面的张量a、b为例进行: import tensorflow as tf a = tf.random.uniform([2,3],minval=1,maxval=6,dtype=tf.int32) b = tf.random.uni
阅读全文
摘要:1 创建 1.1 constant()方法 import tensorflow as tf tf.constant(1) #创建一个整型张量 <tf.Tensor: id=4, shape=(), dtype=int32, numpy=1> tf.constant(1.) #创建一个浮点型张量 <t
阅读全文

浙公网安备 33010602011771号