2019年11月20日
摘要: 1、基本索引 索引查找方式单一 1 a = tf.ones([1,5,5,3]) 2 print(a[0][0]) 3 print(a[0][0][0]) 4 print(a[0][0][0][2]) 输出: tf.Tensor( [[1. 1. 1.] [1. 1. 1.] [1. 1. 1.] 阅读全文
posted @ 2019-11-20 09:40 Luaser 阅读(779) 评论(0) 推荐(0) 编辑
摘要: 1、从numpy 和list 创建 创建一个np矩阵,再通过转换,变成tensor a = np.ones([2,3]) print(a) b = tf.convert_to_tensor(a) print(b) #直接将列表转换为tensor a = tf.convert_to_tensor([1 阅读全文
posted @ 2019-11-20 09:31 Luaser 阅读(918) 评论(0) 推荐(0) 编辑
摘要: 1、数据载体 ① list : list中可以添加多种数据,[1,1.2,‘hello’,(1,2)] ② np.array:np数组主要用于解决同种数据的运算,不支持自动求导,不支持GPU运算 ③ tf.Tensor: ▪ scalar: 1.1 ▪ vector: [1.1],[1.1,2.2, 阅读全文
posted @ 2019-11-20 09:18 Luaser 阅读(2354) 评论(0) 推荐(0) 编辑