0
点赞
收藏
分享

微信扫一扫

tf.map_fn

无愠色 2023-01-16 阅读 139


import numpy as np
import tensorflow as tf
elems = np.array([1, 2, 3, 4, 5, 6])
tf.map_fn(lambda x: x * x, elems)

<tf.Tensor: shape=(6,), dtype=int64, numpy=array([ 1,  4,  9, 16, 25, 36])>


举报

相关推荐

0 条评论