gradient operations and cachong