A = np.random.randn(4,3)
B = np.sum(A, axis = 1, keepdims = True)

我们使用(keepdims = True)来确保 A.shape 是(4,1)而不是(4,),它使我们的代码更加严格。容易减少深度学习中代码bug

相关文章:

  • 2022-02-18
  • 2021-08-04
  • 2022-12-23
  • 2021-05-25
  • 2021-06-28
  • 2021-06-16
  • 2021-04-04
  • 2021-05-05
猜你喜欢
  • 2022-01-17
  • 2021-06-17
  • 2021-08-26
  • 2022-12-23
  • 2021-05-23
  • 2021-12-29
  • 2022-12-23
相关资源
相似解决方案