add code: compute derivatives with respect to input values

Signed-off-by: mengwenliu <mengwenliu09@gmail.com>