Skip to content

Commit c569064

Browse files
committed
Remove faulty Fortran-style assumption for ndarray.flags
1 parent c1a3c65 commit c569064

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

torch_np/_ndarray.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,7 @@ def base(self):
110110
@property
111111
def flags(self):
112112
# Note contiguous in torch is assumed C-style
113-
flag_to_value = {"C_CONTIGUOUS": self._tensor.is_contiguous()}
114-
if flag_to_value["C_CONTIGUOUS"]:
115-
# There's no proper way to determine if a tensor is Fortran-style
116-
# contiguous in torch, but at least we know it isn't when it is
117-
# C-style.
118-
flag_to_value["F_CONTIGUOUS"] = False
119-
return Flags(flag_to_value)
113+
return Flags({"C_CONTIGUOUS": self._tensor.is_contiguous()})
120114

121115
@property
122116
def T(self):

0 commit comments

Comments
 (0)