Commit 194dee2
authored
Fixes setting of writable flag for views and writing to read-only arrays with
* Fixes bugs with `writable` flag setting
`writable` flag was not being set correctly for indexing, real views, imaginary views, tranposes, and where shape is set directly
Also fixes cases where flag could be overridden by functions with `out` kwarg
* Adds a test for writable flag view behavior
* Removes assumption that new array is writable
Now flags are set based on input regardless of whether a new array is writable
per review feedback
* Adds _copy_writable for copying the writable flag between arrays
* Correct typos in _copy_writable
* Fixes clip writing to read-only out arrays when min and max are noneout keyword (#1527)1 parent e25a32a commit 194dee2
File tree
5 files changed
+54
-11
lines changed- dpctl
- tensor
- tests
5 files changed
+54
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
265 | 268 | | |
266 | 269 | | |
267 | 270 | | |
| |||
437 | 440 | | |
438 | 441 | | |
439 | 442 | | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
440 | 446 | | |
441 | 447 | | |
442 | 448 | | |
| |||
600 | 606 | | |
601 | 607 | | |
602 | 608 | | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
603 | 612 | | |
604 | 613 | | |
605 | 614 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
205 | 208 | | |
206 | 209 | | |
207 | 210 | | |
| |||
601 | 604 | | |
602 | 605 | | |
603 | 606 | | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
604 | 610 | | |
605 | 611 | | |
606 | 612 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
738 | 738 | | |
739 | 739 | | |
740 | 740 | | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
741 | 744 | | |
742 | 745 | | |
743 | 746 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
63 | 66 | | |
64 | 67 | | |
65 | 68 | | |
| |||
546 | 549 | | |
547 | 550 | | |
548 | 551 | | |
549 | | - | |
| 552 | + | |
550 | 553 | | |
551 | 554 | | |
552 | 555 | | |
| |||
725 | 728 | | |
726 | 729 | | |
727 | 730 | | |
728 | | - | |
729 | 731 | | |
730 | 732 | | |
731 | 733 | | |
732 | 734 | | |
733 | 735 | | |
734 | 736 | | |
| 737 | + | |
735 | 738 | | |
736 | 739 | | |
737 | 740 | | |
| |||
749 | 752 | | |
750 | 753 | | |
751 | 754 | | |
| 755 | + | |
752 | 756 | | |
753 | 757 | | |
754 | 758 | | |
| |||
758 | 762 | | |
759 | 763 | | |
760 | 764 | | |
761 | | - | |
762 | | - | |
763 | | - | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
764 | 768 | | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
765 | 772 | | |
766 | 773 | | |
767 | 774 | | |
| |||
1040 | 1047 | | |
1041 | 1048 | | |
1042 | 1049 | | |
1043 | | - | |
1044 | | - | |
| 1050 | + | |
1045 | 1051 | | |
1046 | 1052 | | |
1047 | 1053 | | |
| |||
1225 | 1231 | | |
1226 | 1232 | | |
1227 | 1233 | | |
1228 | | - | |
| 1234 | + | |
1229 | 1235 | | |
1230 | 1236 | | |
1231 | 1237 | | |
| |||
1257 | 1263 | | |
1258 | 1264 | | |
1259 | 1265 | | |
1260 | | - | |
| 1266 | + | |
1261 | 1267 | | |
1262 | 1268 | | |
1263 | 1269 | | |
| |||
1277 | 1283 | | |
1278 | 1284 | | |
1279 | 1285 | | |
1280 | | - | |
| 1286 | + | |
1281 | 1287 | | |
1282 | 1288 | | |
1283 | 1289 | | |
| |||
1294 | 1300 | | |
1295 | 1301 | | |
1296 | 1302 | | |
1297 | | - | |
| 1303 | + | |
1298 | 1304 | | |
1299 | 1305 | | |
1300 | 1306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
132 | 151 | | |
133 | 152 | | |
134 | 153 | | |
| |||
0 commit comments