2.1tf.constant()函数用法解析

tf.constant()用来定义tensor常量

直接上代码

在这里插入图片描述

  • 定义之后自动为tf.Tensor类型
  • shape=( ),表示0维,只是个单一的值;shape=(3,),表示1维向量,有3个值
  • 数据类型可以是int32,float32,float64,bool,string
发布了43 篇原创文章 · 获赞 3 · 访问量 3343

猜你喜欢

转载自blog.csdn.net/a1920993165/article/details/105024873