| 111 | return self.simplify().lower_completely() |
| 112 | |
| 113 | def rechunk( |
| 114 | self, |
| 115 | chunks="auto", |
| 116 | threshold=None, |
| 117 | block_size_limit=None, |
| 118 | balance=False, |
| 119 | method=None, |
| 120 | ): |
| 121 | if self.ndim > 0 and all(s == 0 for s in self.shape): |
| 122 | return self |
| 123 | |
| 124 | from dask.array._array_expr._rechunk import Rechunk |
| 125 | |
| 126 | result = Rechunk(self, chunks, threshold, block_size_limit, balance, method) |
| 127 | # Ensure that chunks are compatible |
| 128 | result.chunks |
| 129 | return result |
| 130 | |
| 131 | def finalize_compute(self): |
| 132 | return FinalizeComputeArray(self) |