Commit Graph
2 Commits
Author SHA1 Message Date
Deep Patel c72270c076 Init tensor directly on device (#6068)
Slightly more efficient than .to(device)
2021-12-23 13:49:00 +01:00
Deep Patel 336437998f Suppress ONNX export trace warning (#5437)
Checking for `onnx_dynamic` first should suppress the warning:

```log
TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
  if self.grid[i].shape[2:4] != x[i].shape[2:4] or self.onnx_dynamic
```
2021-11-05 19:31:53 +01:00