weixin_49826617
weixin_49826617
2021-01-25 13:37

代码中的for循环太慢了

  • python

我的代码中这一段循环太慢了,怎么可以提速啊

for uuid in range (batch_size):


   user_id = user[uuid]

   pos_id = pos_items[uuid]

   posass_id = posass_items[uuid]

   s_1 = s_tensor[user_id][pos_id]

   s_2 = s_tesor[user_id][posass_id]

   i_loss_1 = tf.where(s_1>s_2,a,b)

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答