jingweimo的个人博客分享 http://blog.sciencenet.cn/u/jingweimo

博文

TensorFlow tensor shape dimensions

已有 2399 次阅读 2018-8-16 23:37 |系统分类:科研笔记

Q: How to get the dimensions (shape) of a tensor as integer values?

import tensorflow as tf

shape = [3,4,5]

tensor = tf.ones(shape=shape)

tensor.get_shape().as_list()


Sources:

https://www.tensorflow.org/guide/tensors

https://stackoverflow.com/questions/40666316/how-to-get-tensorflow-tensor-dimensions-shape-as-int-values/40666375



https://wap.sciencenet.cn/blog-578676-1129603.html

上一篇:cudnn Exception error with GpuDnnConv
下一篇:随笔一记
收藏 IP: 35.10.57.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...
扫一扫,分享此博文

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-5-15 17:14

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部