Exemple #1
0
 def decorated(*args, **kwargs):
     tensors = convenience_wrappers.multigrad(f,
                                              parameter_positions)(*args,
                                                                   **kwargs)
     return [
         t.tensor() if isinstance(t, tensor.LazyZero) else t
         for t in tensors
     ]
Exemple #2
0
 def decorated(*args, **kwargs):
   tensors = convenience_wrappers.multigrad(f, parameter_positions)(*args,
                                                                    **kwargs)
   return [t.tensor() if isinstance(t, tensor.LazyZero)
           else t for t in tensors]