message: Minor fix in dr.accum_grad for variables with grad not enabled
diff: @@ -4004,6 +4004,7 @@ def set_grad(dst, src):
  :ref:`custom data structure <custom-struct>`, sequences, or mapping.
  '''
  if _dr.is_diff_v(dst) and dst.IsFloat:
  + if _dr.grad_enabled(dst):
  if _dr.is_diff_v(src):
  src = _dr.detach(src, preserve_type=False)
  @@ -4046,6 +4047,7 @@ def accum_grad(dst, src):
  :ref:`custom data structure <custom-struct>`, sequences, or mapping.
  '''
  if _dr.is_diff_v(dst) and dst.IsFloat:
  + if _dr.grad_enabled(dst):
  if _dr.is_diff_v(src):
  src = _dr.detach(src, preserve_type=False)
  @@ -5864,7 +5866,8 @@ def wrap_ad(source: str, target: str):
  grad_out_torch = drjit_to_torch(self.grad_out())
  grad_out_torch = torch_ensure_shape(grad_out_torch, self.res_torch)
  _torch.autograd.backward(self.res_torch, grad_out_torch)
  - args_grad = torch_to_drjit([getattr(a, 'grad', None) for a in self.args_torch])
  + args_grad_torch = [getattr(a, 'grad', None) for a in self.args_torch]
  + args_grad = torch_to_drjit(args_grad_torch)
  self.set_grad_in('args', args_grad)
  return _dr.custom(ToTorch, args)
  