tf.convert_to_tensor的用法
来源:互联网 发布:淘宝卖蚕丝被 编辑:程序博客网 时间:2024/05/16 15:38
tf.convert_to_tensor用于将不同数据变成张量:比如可以让数组变成张量、也可以让列表变成张量。
例如:
import tensorflow as tf;import numpy as np;A = list([1,2,3])B = np.array([1,2,3])C = tf.convert_to_tensor(A)D = tf.convert_to_tensor(B)with tf.Session() as sess:print type(A)print type(B)print type(C)print type(D)
输出:<type 'list'><type 'numpy.ndarray'><class 'tensorflow.python.framework.ops.Tensor'><class 'tensorflow.python.framework.ops.Tensor'>
阅读全文
0 0
- tf.convert_to_tensor的用法
- tf.convert_to_tensor()
- 使用tf.convert_to_tensor 时遇到value error 怎么解决
- tf.concat的用法
- tf.reduce_mean的用法
- tf.clip_by_value的用法
- tf.select的用法
- tf.assign的用法
- tf.truncated_normal的用法
- tf.concat的用法
- tf.cond()的用法
- tf.concat的用法
- tf.assign的用法
- tf.truncated_normal的用法
- tf.truncated_normal的用法
- tf.truncated_normal的用法
- tf.variable_scope和tf.name_scope的用法
- tf.global_variables或者tf.all_variables的用法
- 496. Next Greater Element I
- 学习淘淘商城第六十七课(freemarker入门)
- 搜索引擎:倒排索引
- LeetCode 309. Best Time to Buy and Sell Stock with Cooldown
- SAP HANA LEFT/RIGHT字符串截取
- tf.convert_to_tensor的用法
- Java面向对象 (接口)
- java 后台Jsonp处理方法
- class文件结构
- 二分图匹配——BZOJ1191/Luogu2319 [HNOI2006]超级英雄
- golang日記
- C 语言读书笔记集合(乱序版)
- 1.Java的I/O演进之路
- Visual Studio 连接SQL Server数据库