(vars)
| 48 | |
| 49 | @make_iterative_func |
| 50 | def tensor2numpy(vars): |
| 51 | if isinstance(vars, np.ndarray): |
| 52 | return vars |
| 53 | elif isinstance(vars, torch.Tensor): |
| 54 | return vars.data.cpu().numpy() |
| 55 | else: |
| 56 | raise NotImplementedError("invalid input type for tensor2numpy") |
| 57 | |
| 58 | |
| 59 | @make_iterative_func |
no outgoing calls
no test coverage detected