This is now possible with Rc usage in #62. Something like: ```rust pub fn map_dff<T: Tensor<Dtype = f32>, F, Df>(mut t: T, mut f: F, mut df: Df) -> T where F: 'static + FnMut(&f32) -> f32, Df: 'static + FnMut(&f32) -> f32, { T::Device::foreach_m(t.mut_data(), &mut |x| *x = f(x)); let (t, mut tape) = t.split_tape(); let result = t.clone(); // should add a new reference, not start a new one let phantom_result = result.phantom(); tape.add_backward_op(move |grads| { let (t_grad, result_grad) = grads.mut_and_ref(&t, &phantom_result); T::Device::foreach_mrr(t_grad, t.data(), result_grad, &mut |g, t, r| { *g += df(t) * r; }); }); result.put_tape(tape) ```