Skip to content

Commit d13f655

Browse files
Port vision to AIX (#8914)
Co-authored-by: Nicolas Hug <[email protected]>
1 parent a200dac commit d13f655

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def make_C_extension():
194194

195195
def find_libpng():
196196
# Returns (found, include dir, library dir, library name)
197-
if sys.platform in ("linux", "darwin"):
197+
if sys.platform in ("linux", "darwin", "aix"):
198198
libpng_config = shutil.which("libpng-config")
199199
if libpng_config is None:
200200
warnings.warn("libpng-config not found")

torchvision/datasets/mnist.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ def read_sn3_pascalvincent_tensor(path: str, strict: bool = True) -> torch.Tenso
514514
data = f.read()
515515

516516
# parse
517-
if sys.byteorder == "little":
517+
if sys.byteorder == "little" or sys.platform == "aix":
518518
magic = get_int(data[0:4])
519519
nd = magic % 256
520520
ty = magic // 256
@@ -527,7 +527,7 @@ def read_sn3_pascalvincent_tensor(path: str, strict: bool = True) -> torch.Tenso
527527
torch_type = SN3_PASCALVINCENT_TYPEMAP[ty]
528528
s = [get_int(data[4 * (i + 1) : 4 * (i + 2)]) for i in range(nd)]
529529

530-
if sys.byteorder == "big":
530+
if sys.byteorder == "big" and not sys.platform == "aix":
531531
for i in range(len(s)):
532532
s[i] = int.from_bytes(s[i].to_bytes(4, byteorder="little"), byteorder="big", signed=False)
533533

0 commit comments

Comments
 (0)