Files
termux-packages/packages/python-torch/0008-fix-for-narrowing.patch
termux-pacman-bot b74eb46126 bump(main/python-torch): 2.9.1
- Fixes https://github.com/termux/termux-packages/issues/27525

- Fixes https://github.com/termux/termux-packages/issues/25792

- Enable `USE_DISTRIBUTED` and apply patches necessary for it to compile and run properly
2025-12-07 06:43:53 +00:00

29 lines
835 B
Diff

--- a/torch/csrc/jit/python/python_list.cpp.orig
+++ b/torch/csrc/jit/python/python_list.cpp
@@ -28,7 +28,11 @@
namespace {
py::list scriptListToPyList(const ScriptList& src) {
+#ifndef __LP64__
+ py::list out(static_cast<ptrdiff_t>(src.len()));
+#else
py::list out(src.len());
+#endif
auto iter = src.iter();
size_t i = 0;
--- a/torch/csrc/distributed/c10d/TCPStore.cpp
+++ b/torch/csrc/distributed/c10d/TCPStore.cpp
@@ -177,7 +177,11 @@ void TCPClient::setTimeout(std::chrono::milliseconds value) {
static_cast<long>((value.count() % 1000) * 1000)};
#else
struct timeval timeoutTV = {
+#ifndef __LP64__
+ .tv_sec = static_cast<time_t>(value.count() / 1000),
+#else
.tv_sec = value.count() / 1000,
+#endif
.tv_usec = static_cast<suseconds_t>((value.count() % 1000) * 1000),
};
#endif