Skip to content

Commit fb6f1f3

Browse files
committed
Hack to handle writingto C order and bringing back to F
1 parent d0254cd commit fb6f1f3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pyttb/import_data.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import numpy as np
1313

1414
import pyttb as ttb
15+
from pyttb.pyttb_utils import to_memory_order
1516

1617

1718
def import_data(
@@ -65,7 +66,7 @@ def import_data(
6566
fp.readline().strip() # Skip factor type
6667
fac_shape = import_shape(fp)
6768
fac = import_array(fp, np.prod(fac_shape))
68-
fac = np.reshape(fac, np.array(fac_shape))
69+
fac = to_memory_order(np.reshape(fac, np.array(fac_shape)), order="F")
6970
factor_matrices.append(fac)
7071
return ttb.ktensor(factor_matrices, weights, copy=False)
7172
raise ValueError("Failed to load tensor data") # pragma: no cover

0 commit comments

Comments
 (0)