tensorflow2(二)
1.tensorflow.io
csv转tensor,会将每一列转一个tensor,最终构成一个tensor的list

读写文件

向量操作
tf.roll([1,1,2,3,4], shift=3, axis=0)
沿指定坐标移动shift个位置
tf.reverse

沿着指定坐标轴反转
reshape,重新调整shape,第二个参数传shape的数组

shape返回tensor的shape

slice tensor的切分

sort 排序

case 三目运算符
f1 = lambda: tf.constant(17)
f2 = lambda: tf.constant(23)
r = tf.case([(tf.less(x, y), f1)], default=f2)
clip_by_value

应用py函数

不规则张量

浙公网安备 33010602011771号