TensorFlow 2.10上线:Windows上扩展GPU支持,TF-DF 1.0发布
机器之心报道
TensorFlow 2.10 已发布,还没有更新的小伙伴现在可以更新了。



import tensorflow as tfembedding = tf.keras.layers.Embedding(input_dim=10,output_dim=3,mask_zero=True) # Infer a correct padding mask.# Instantiate a Keras multi-head attention (MHA) layer,# a layer normalization layer, and an `Add` layer object.mha = tf.keras.layers.MultiHeadAttention(key_dim=4, num_heads=1)layernorm = tf.keras.layers.LayerNormalization()add = tf.keras.layers.Add()# Test input.x = tf.constant([[1, 2, 3, 4, 5, 0, 0, 0, 0],[1, 2, 1, 0, 0, 0, 0, 0, 0]])# The embedding layer sets the mask.x = embedding(x)# The MHA layer uses and propagates the mask.a = mha(query=x, key=x, value=x, use_causal_mask=True)x = add([x, a]) # The `Add` layer propagates the mask.x = layernorm(x)# The mask made it through all layers.print(x._keras_mask)
> tf.Tensor(> [[ True True True True True False False False False]> [ True True True False False False False False False]], shape=(2, > 9), dtype=bool)
掌握「声纹识别技术」:前20小时交给我,后9980小时……

??THE END?
转载请联系本公众号获得授权
投稿或寻求报道:content@jiqizhixin.com
关注公众号:拾黑(shiheibook)了解更多
[广告]赞助链接:
四季很好,只要有你,文娱排行榜:https://www.yaopaiming.com/
让资讯触达的更精准有趣:https://www.0xu.cn/
关注网络尖刀微信公众号随时掌握互联网精彩
赞助链接
排名
热点
搜索指数
- 1 打好关键核心技术攻坚战 7904488
- 2 在南海坠毁的2架美国军机已被捞出 7809339
- 3 立陶宛进入紧急状态 卢卡申科发声 7712702
- 4 持续巩固增强经济回升向好态势 7616939
- 5 多家店铺水银体温计售空 7522321
- 6 奶奶自爷爷去世9个月后变化 7425083
- 7 仅退款225个快递女子已归案 7330101
- 8 日舰曾收到中方提示 7233055
- 9 中国中冶跌10.03% 7140450
- 10 我国成功发射遥感四十七号卫星 7041829

![Chlaibo假装辣妹出现一下哈哈哈[並不簡單] ](https://imgs.knowsafe.com:8087/img/aideep/2021/11/14/aafce22398236933624b61ec4fa365ea.jpg?w=250)





机器之心
