tf.layers.dense

tf.layers.dense:

import tensorflow as tf
batch_size = 5
ones = tf.ones([batch_size,20])
logits = tf.layers.dense(ones,10)
print(logits.get_shape())

import tensorflow as tf
batch_size = 5
ones = tf.ones([batch_size,8,20])
logits = tf.layers.dense(ones,10)
print(logits.get_shape())

import tensorflow as tf
batch_size = 5
ones = tf.ones([batch_size,6,8,20])
logits = tf.layers.dense(ones,10)
print(logits.get_shape())

  结果如下:

'''
(5, 10)
(5, 8, 10)
(5, 6, 8, 10)
'''

 

posted @ 2020-03-27 23:08  1直在路上1  阅读(706)  评论(0编辑  收藏  举报