tensorflow2 api目录 作者:马育民 • 2019-11-16 14:35 • 阅读:10210 ### tf - [tf.Tensor](https://www.malaoshi.top/show_1EF4ZcVklrdc.html "tf.Tensor") - [tf.constant](https://www.malaoshi.top/show_1EF4ZcVklrdc.html "tf.constant") - [tf.Variable](https://www.malaoshi.top/show_1EF4ZcqPG0Aq.html "tf.Variable") - [tf.identity()](https://www.malaoshi.top/show_1EF4gksfKWdr.html "tf.identity()") - [tf.boolean_mask](https://www.malaoshi.top/show_1EF5DBlceZ8l.html "tf.boolean_mask") - [tf.one_hot](https://www.malaoshi.top/show_1EF5E6kX4Tmc.html "tf.one_hot") - [tf.meshgrid() 构建n维网格](https://www.malaoshi.top/show_1EF5FOM7EMvN.html "tf.meshgrid() 构建n维网格") - [@tf.function](https://www.malaoshi.top/show_1EF5HFCDp8fP.html "@tf.function") - [@tf.function-跟踪(tracing)-传递python参数](https://www.malaoshi.top/show_1EF5Hngv4moE.html "@tf.function-跟踪(tracing)-传递python参数") - [@tf.function-跟踪(tracing)-传递tensor张量](https://www.malaoshi.top/show_1EF5Hngzo3yF.html "@tf.function-跟踪(tracing)-传递tensor张量") - [tf.print()](https://www.malaoshi.top/show_1EF5Hd5V0eaG.html "tf.print()") - [tf.while_loop循环语句](https://www.malaoshi.top/show_1EF5Hb64AgRF.html "tf.while_loop循环语句") - [tf.TensorArray(tensor动态数组)](https://www.malaoshi.top/show_1EF5HCYsMAdE.html "tf.TensorArray(tensor动态数组)") - [tf.cond判断tensor的值](https://www.malaoshi.top/show_1EF5HE8ESMfb.html "tf.cond判断tensor的值") - [tf.convert_to_tensor](https://www.malaoshi.top/show_1EF5HEq65St5.html "tf.convert_to_tensor") - [tf.py_function](https://www.malaoshi.top/show_1EF5Hns9WpxP.html "tf.py_function") - [tf.GradientTape()自动微分求导](https://www.malaoshi.top/show_1EF4gqBjRRIF.html "tf.GradientTape()自动微分求导") - [tf.einsum()爱因斯坦求和约定](https://www.malaoshi.top/show_1EF4iknVnZK4.html "tf.einsum()爱因斯坦求和约定") - [tf.clip_by_value()](https://www.malaoshi.top/show_1EF4iwoMSgIE.html "tf.clip_by_value()") 矩阵操作 - [tf.concat](https://www.malaoshi.top/show_1EF5CzQ0aHQ8.html "tf.concat") - [tf.tile](https://www.malaoshi.top/show_1EF5DBbNP8rP.html "tf.tile") - [tf.stack(堆叠tensor)](https://www.malaoshi.top/show_1EF5IipGjmzo.html "tf.stack") - tf.split - [tf.reshape](https://www.malaoshi.top/show_1EF5a6BOETEz.html "tf.reshape") 矩阵索引操作 - [tf.gather](https://www.malaoshi.top/show_1EF5all8g9O0.html "tf.gather") - [tf.gather_nd](https://www.malaoshi.top/show_1EF5an310i1q.html "tf.gather_nd") - [tf.where](https://www.malaoshi.top/show_1EF5amHQar0r.html "tf.where") - [tf.boolean_mask 布尔掩码(布尔索引)](https://www.malaoshi.top/show_1EF5dAquWY0V.html "tf.boolean_mask 布尔掩码(布尔索引)") 切片 - tf.slice - tf.strided_slice - tf.gather 维度操作: - [tf.newaxis的作用](https://www.malaoshi.top/show_1EF4hUvlJoiS.html "tf.newaxis的作用") - [ tf.expand_dims()](https://www.malaoshi.top/show_1EF4hVIIflen.html " tf.expand_dims()") - [tf.transpose(转置)](https://www.malaoshi.top/show_1EF5Iiv4x54x.html "tf.transpose(转置)") - [tf.squeeze删除维度](https://www.malaoshi.top/show_1EF5LMbQ5BGe.html "tf.squeeze删除维度") - [tf.shape 返回tensor的形状](https://www.malaoshi.top/show_1EF5bVfx2iZW.html "tf.shape 返回tensor的形状") - [tf.rank 返回tensor的维度](https://www.malaoshi.top/show_1EF5bVVRcWII.html "tf.rank 返回tensor的维度") 张量操作: https://www.cnblogs.com/fwl8888/p/9791879.html ### tf.data 数据处理 tensorflow新增加了 tf.data 模块,提供更加强大的 读取数据 功能 tf.data模块可以 方便 且 快速 的的 读取数据、处理数据 - [tf.data.Dateset](https://www.malaoshi.top/show_1EF47ZxC4RYZ.html "tf.data") - [tf.data.TFRecordDataset](https://www.malaoshi.top/show_1EF57c9xJZe8.html "tf.data.TFRecordDataset") ### tf.io - [tf.io.read_file()](https://www.malaoshi.top/show_1EF4VxYA51W2.html "tf.io.read_file()") - [tf.io.decode_jpeg()](https://www.malaoshi.top/show_1EF4VxkN2o8B.html "tf.io.decode_jpeg()") - [tf.io.encode_jpeg()](https://www.malaoshi.top/show_1EF54XrwrTkx.html "tf.io.encode_jpeg()") - [tf.io.write_file()](https://www.malaoshi.top/show_1EF54XsoXoKy.html "tf.io.write_file()") - [tf.io.FixedLenFeature](https://www.malaoshi.top/show_1EF57c9xJZe8.html "tf.io.FixedLenFeature") - [tf.io.VarLenFeature](https://www.malaoshi.top/show_1EF57c9xJZe8.html "tf.io.VarLenFeature") - [tf.io.parse_single_example](https://www.malaoshi.top/show_1EF57c9xJZe8.html "tf.io.parse_single_example") - [tf.io.TFRecordWriter](https://www.malaoshi.top/show_1EF57aDz46fN.html "tf.io.TFRecordWriter") ##### tf.io.gfile - [tf.io.gfile.GFile()](https://www.malaoshi.top/show_1EF57YStMwem.html "tf.io.gfile.GFile()") ### tf.image - [tf.image.convert_image_dtype()](https://www.malaoshi.top/show_1EF4hblZFx81.html "tf.image.convert_image_dtype()") - [tf.image.rgb_to_grayscale()](https://www.malaoshi.top/show_1EF4XaQuX6lx.html "tf.image.rgb_to_grayscale()") - [tf.image.resize()改变图像大小](https://www.malaoshi.top/show_1EF4XayTFLyw.html "tf.image.resize()改变图像大小") - [tf.image.extract_patches提取图片区域](https://www.malaoshi.top/show_1EF5FaeT6qdW.html "tf.image.extract_patches提取图片区域") - [tf.image.non_max_suppression()非极大值抑制](https://www.malaoshi.top/show_1EF5allkhAA1.html "tf.image.non_max_suppression()非极大值抑制") 更多图像处理参见: https://www.cnblogs.com/kuaizifeng/archive/2018/08/17/9490669.html ### tf.math 跟数学计算相关的操作,其很多别名都省略math,如:tf.add - [tf.math.add(tf.add)](https://www.malaoshi.top/show_1EF5CyQ9gEWb.html "tf.math.add(tf.add)") - [tf.math.add_n()](https://www.malaoshi.top/show_1EF4jL2wPDjG.html "tf.math.add_n()") - [tf.math.argmax()](https://www.malaoshi.top/show_1EF4LCNXBuQr.html "tf.math.argmax()") - [tf.math.reduce_mean()](https://www.malaoshi.top/show_1EF4jKTQeHH2.html "tf.math.reduce_mean()") - [tf.math.reduce_sum(tf.reduce_sum)](https://www.malaoshi.top/show_1EF5D4EtYRxt.html "tf.math.reduce_sum(tf.reduce_sum)") - [tf.math.exp(tf.exp)](https://www.malaoshi.top/show_1EF5DBAlU7fZ.html "tf.math.exp(tf.exp)") - [tf.math.sigmoid(tf.sigmoid)](https://www.malaoshi.top/show_1EF5DLAuBptO.html "tf.math.sigmoid(tf.sigmoid)") - [tf.math.less_equal 小于等于运算](https://www.malaoshi.top/show_1EF5dAMj1uv3.html "tf.math.less_equal 小于等于运算") - [tf.math.less 小于运算](https://www.malaoshi.top/show_1EF5dAyBVGle.html "tf.math.less 小于运算") - [tf.math.greater_equal 大于等于运算](https://www.malaoshi.top/show_1EF5dB233Uyi.html "tf.math.greater_equal 大于等于运算") - [tf.math.greater 大于运算](https://www.malaoshi.top/show_1EF5dB3frngj.html "tf.math.greater 大于运算") ### tf.train - [tf.train.Example](https://www.malaoshi.top/show_1EF57aDz46fN.html "tf.train.Example") - [tf.train.Features](https://www.malaoshi.top/show_1EF57aDz46fN.html "tf.train.Features") - [tf.train.Feature](https://www.malaoshi.top/show_1EF57aDz46fN.html "tf.train.Feature") - [tf.train.BytesList](https://www.malaoshi.top/show_1EF57aDz46fN.html "tf.train.BytesList") - [tf.train.FloatList](https://www.malaoshi.top/show_1EF57aDz46fN.html "tf.train.FloatList") - [tf.train.Int64List](https://www.malaoshi.top/show_1EF57aDz46fN.html "tf.train.Int64List") ### tf.nn 用于原始神经网络(Neural Net)操作的包装器 - [tf.nn.space_to_depth(tf.space_to_depth)](https://www.malaoshi.top/show_1EF5ECmtZF7F.html "tf.nn.space_to_depth(tf.space_to_depth)") - [tf.nn.softmax](https://www.malaoshi.top/show_1EF5FDvcm8hW.html "tf.nn.softmax") ### tf.linalg(线性代数相关操作) - [tf.linalg.matmul(tf.matmul)](https://www.malaoshi.top/show_1EF5HBEDFsNz.html "tf.linalg.matmul(tf.matmul)") ### 其他 - [tf.dtypes.cast类型转换](https://www.malaoshi.top/show_1EF54XSPqhyE.html "tf.dtypes.cast类型转换") 原文出处:https://malaoshi.top/show_1EF4RVSVAOiX.html