cpp bptt forward implemented