|
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
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2025-1-10 12:00
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社