(obj)
| 334 | requires_grad=True, training=training) |
| 335 | |
| 336 | def _make_non_contiguous(obj): |
| 337 | def inner_make_non_contiguous(obj): |
| 338 | # Scalar tensors can not be made non-contiguous |
| 339 | if not isinstance(obj, torch.Tensor) or obj.dim() == 0: |
| 340 | return obj |
| 341 | |
| 342 | out = torch.repeat_interleave(obj, 2, dim=-1) |
| 343 | out = out[..., ::2].detach() |
| 344 | out.requires_grad = obj.requires_grad |
| 345 | return out |
| 346 | return self._traverse_obj(obj, inner_make_non_contiguous) |
| 347 | |
| 348 | def _can_be_noncontiguous(obj): |
| 349 | if isinstance(obj, (tuple, list)): |
nothing calls this directly
no test coverage detected