@@ -18,7 +18,7 @@ namespace NumSharp.Core.Interfaces
1818 /// - CloneData<T> clone storage and cast this clone
1919 ///
2020 /// </summary>
21- public interface IStorage
21+ public interface IStorage : ICloneable
2222 {
2323 /// <summary>
2424 /// Data Type of stored elements
@@ -34,14 +34,14 @@ public interface IStorage
3434 /// column wise or row wise order
3535 /// </summary>
3636 /// <value>0 row wise, 1 column wise</value>
37- int TensorOrder { get ; }
37+ int TensorLayout { get ; }
3838 /// <summary>
3939 /// Allocate memory by dtype, shape, tensororder (default column wise)
4040 /// </summary>
4141 /// <param name="dtype">storage data type</param>
4242 /// <param name="shape">storage data shape</param>
4343 /// <param name="tensorOrder">row or column wise</param>
44- void Allocate ( Type dtype , Shape shape , int tensorOrder = 1 ) ;
44+ void Allocate ( Type dtype , IShape shape , int tensorOrder = 1 ) ;
4545 /// <summary>
4646 /// Allocate memory by Array and tensororder and deduce shape and dtype (default column wise)
4747 /// </summary>
@@ -119,19 +119,6 @@ public interface IStorage
119119 /// <param name="indexes"></param>
120120 void SetData ( object value , params int [ ] indexes ) ;
121121 /// <summary>
122- /// Set a 1D Array of type T to internal storage and cast dtype
123- /// </summary>
124- /// <param name="values"></param>
125- /// <typeparam name="T"></typeparam>
126- void SetData < T > ( T [ ] values ) ;
127- /// <summary>
128- /// Set a single value of type dtype to internal storage and cast storage
129- /// </summary>
130- /// <param name="value"></param>
131- /// <param name="indexes"></param>
132- /// <typeparam name="T"></typeparam>
133- void SetData < T > ( T value , params int [ ] indexes ) ;
134- /// <summary>
135122 /// Set an Array to internal storage, cast it to new dtype and change dtype
136123 /// </summary>
137124 /// <param name="values"></param>
@@ -142,12 +129,13 @@ public interface IStorage
142129 /// </summary>
143130 /// <param name="dtype">new storage data type</param>
144131 /// <returns>sucess or not</returns>
145- bool ChangeDataType ( Type dtype ) ;
132+ void ChangeDataType ( Type dtype ) ;
146133 /// <summary>
147134 /// Cange layout to 0 row wise or 1 colum wise
148135 /// </summary>
149136 /// <param name="order">0 or 1</param>
150137 /// <returns>success or not</returns>
151- bool SwitchTensorOrder ( int order ) ;
138+ void ChangeTensorLayout ( int order ) ;
139+ void Reshape ( params int [ ] dimensions ) ;
152140 }
153141}
0 commit comments