当前位置:网站首页>tf中tensor的大小输出
tf中tensor的大小输出
2022-08-02 08:17:00 【frostjsy】
import tensorflow as tf
logits=tf.constant([[1.0,2.0,3.0],[1.0,2.0,3.0],[1.0,2.0,3.0]])
labels = tf.constant([[0.0, 0.0, 1.0], [0.0, 0.0, 1.0], [0.0, 0.0, 1.0]])
logits_ = tf.reshape(logits, [-1, 1])
labels_ = tf.reshape(labels, [-1, 1])
print(logits.shape.as_list())
print(labels.shape.as_list())
print(logits_.shape.as_list())
print(labels_.shape.as_list())输出
[3, 3]
[3, 3]
[9, 1]
[9, 1]
【1】 [TensorFlow笔记] 获取Tensor的维度(tf.shape(x)、x.shape和x.get_shape()的区别)_手撕机的博客-CSDN博客_获取tensor的shape
边栏推荐
猜你喜欢
What is NoSQL?Databases for the cloud-scale future

houdini 求出曲线的法向 切线以及副法线

Application and case analysis of CASA model and CENTURY model

Biotin hydrazide HCl|CAS:66640-86-6|生物素-酰肼盐酸盐

Redisson的看门狗机制

Biotin-C6-amine|N-生物素基-1,6-己二胺|CAS:65953-56-2

prometheus monitoring mysql_galera cluster

location对象,navigator对象,history对象学习

PyCharm使用教程(详细版 - 图文结合)

OneNote 教程,如何在 OneNote 中创建更多空间?
随机推荐
王学岗-编译出运行的文件
Spark 系统性学习笔记系列
工程师如何对待开源 --- 一个老工程师的肺腑之言
(Note)阿克西斯ACASIS DT-3608双盘位硬盘阵列盒RAID设置
PyCharm usage tutorial (more detailed, picture + text)
图扑软件数字孪生油气管道站,搭建油气运输管控平台
etcd implements large-scale service governance application combat
轴流式水轮机隐私政策
CASA模型、CENTURY模型应用与案例分析
A young man with strong blood and energy actually became a housekeeper. How did he successfully turn around and change careers?
location对象,navigator对象,history对象学习
Stop mental exhaustion Daily sharing
Write a small game in C (three chess)
Figure robot software digital twin station oil and gas pipelines, oil and gas transportation control platform
ip地址那点事(二)
小康股份更名赛力斯,如何走出一条高端产品的“丝绸之路”?
Button to control the running water light (timer)
HCIP9_BGP增加实验
Detailed explanation of calculation commands in shell (expr, (()), $[], let, bc )
【C】关于柔性数组.简要的谈谈柔性数组