tensorflow之神经网络层:Flatten,flatten
tensorflow
一个面向所有人的开源机器学习框架
项目地址:https://gitcode.com/gh_mirrors/te/tensorflow

·
1.tf.layers.Flatten
Class Flatten:在保留第0轴的情况下对输入的张量进行Flatten(扁平化)
代码示例:
x=tf.placeholder(shape=(None,4,4),dtype='float32') y=tf.layers.Flatten()(x) print(y) |
输出:
Tensor("flatten/Reshape:0", shape=(?, 16), dtype=float32)
tensorflow
一个面向所有人的开源机器学习框架
项目地址:https://gitcode.com/gh_mirrors/te/tensorflow
2.tf.layers.flatten
同Flatten类。
tf.layers.flatten( inputs, name=None ) |
参数:
- inputs:输入的张量
- name:层的名称
x=tf.placeholder(shape=(None,4,4),dtype='float32') y=tf.layers.flatten(x) print(y) |




一个面向所有人的开源机器学习框架
最近提交(Master分支:2 个月前 )
4f64a3d5
Instead, check for this case in `ResolveUsers` and `ResolveOperand`, by querying whether the `fused_expression_root` is part of the `HloFusionAdaptor`.
This prevents us from stepping into nested fusions.
PiperOrigin-RevId: 724311958
2 个月前
aa7e952e
Fix a bug in handling negative strides, and add a test case that exposes it.
We can have negative strides that are not just -1, e.g. with a combining
reshape.
PiperOrigin-RevId: 724293790
2 个月前
更多推荐
目录
所有评论(0)