added is_differentiable method