Skip to content

Conversation

@jasam-sheja
Copy link

@jasam-sheja jasam-sheja commented Dec 10, 2021

Reuse the grad and input tensors in the backward pass instead of creating new ones.
Mainly reuse y_act for xhat and dy_act for dy.
Ensure every function support in-place operation. (Elu is modified accordingly)
Ensure the tensors allow in-place operation (dy_act has to be contiguous)

Needs more testing. However, there are no unit tests.

- reuse y_act_ and dy_act_
- use inplace calculations in `forward_cpu` and `backward_cpu`
- make sure dy_act doesn't have memory overlaping
- reflect the inplace operations in the doc and comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants