[Tensorflow] tensor张量基础(dtype,shape,variable,slice and join)

本文介绍了TensorFlow中张量的基础知识,包括tf.DType和tf.TensorShape属性,详细讲解了张量的类型和形状,如全知、部分知和未知形状。此外,还阐述了如何创建随机张量、零张量、常量和变量,并讨论了张量的切割(tf.slice)和合并(tf.concat, tf.stack)操作。" 85009960,7362387,CentOS7中详述的Python3.7安装步骤,"['Python', 'CentOS', '系统管理', '软件安装']
摘要由CSDN通过智能技术生成

一、tensor属性:tf.DType和tf.TensorShape

(1)tensor类型:tf.DType

#部分类型
tf.float16: 16-bit half-precision floating-point.
tf.float32: 32-bit single-precision floating-point.
tf.float64: 64-bit double-precision floating-point.
tf.int8: 8-bit signed integer.
tf.uint8: 8-bit unsigned integer.
tf.uint16: 16-bit unsigned integer.
tf.int16: 16-bit signed integer.
tf.int32: 32-bit signed integer.
tf.int64: 64-bit signed integer.
tf.bool: Boolean.
tf.string: String.
tf.resource: Handle to a mutable resource.

(2)tensor形状:shape

    三种类型:
  • Fully-known shape: 维度确定,每一维长度确定。  如:[768,100]
  • Partially-known shape: 维度确定ÿ
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值