(vars)
| 148 | |
| 149 | @make_recursive_func |
| 150 | def tocuda(vars): |
| 151 | if isinstance(vars, torch.Tensor): |
| 152 | return vars.to(torch.device("cuda")) |
| 153 | elif isinstance(vars, str): |
| 154 | return vars |
| 155 | else: |
| 156 | raise NotImplementedError("invalid input type {} for tensor2numpy".format(type(vars))) |
| 157 | |
| 158 | |
| 159 | # a wrapper to compute metrics for each image individually |
no outgoing calls
no test coverage detected