You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sharktank/tests/types/dataset_test.py::DatasetTest::testDatasetRoundtrip
D:\dev\projects\sharktank\deps\shark-turbine\shark_turbine\aot\params.py:163: UserWarning: The given NumPy array is not writable, and PyTorch does not support non-writable tensors. This means writing to this tensor will result in undefined behavior. You may want to copy the array to protect its data or make it writable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at ..\torch\csrc\utils\tensor_numpy.cpp:212.)
return torch.from_numpy(wrapper)
The warning goes away if I flip copy=False to copy=True here:
Observed while running the downstream https://github.com/nod-ai/sharktank/blob/main/sharktank/tests/types/dataset_test.py
The warning goes away if I flip
copy=False
tocopy=True
here:iree-turbine/shark_turbine/aot/params.py
Lines 156 to 159 in 3520958
I imagine we want to avoid copies of large files though, and behavior seems to be correct even with the undefined behavior. Is that warning relevant for our usage? https://github.com/pytorch/pytorch/blob/f1d1e3246f3203a4c9641fcda28b0ed66eb8f4d4/torch/csrc/utils/tensor_numpy.cpp#L205C6-L232
The text was updated successfully, but these errors were encountered: