Skip to content

v1.0.1 tanh backward bug fixed

Choose a tag to compare

@AkashPrajapathi AkashPrajapathi released this 25 Oct 14:08
· 15 commits to main since this release

Bug Fix: Tanh Backward Pass

  • Fixed a bug in TanhBackward where onesLike() received the output tensor's shape instead of the tensor itself.
  • Corrected the call to onesLike(this.output) to ensure proper tensor initialization during backpropagation.
  • Resolves the TypeError: e.shape is not iterable error when computing gradients through Tanh.

This fix restores the expected gradient calculation for the tanh activation function.