Returns the shape of the data set X
(X: modALinput)
| 170 | |
| 171 | |
| 172 | def data_shape(X: modALinput): |
| 173 | """ |
| 174 | Returns the shape of the data set X |
| 175 | """ |
| 176 | try: |
| 177 | # scipy.sparse, torch, pandas and numpy all support .shape |
| 178 | return X.shape |
| 179 | except: |
| 180 | if isinstance(X, list): |
| 181 | return np.array(X).shape |
| 182 | |
| 183 | raise TypeError("%s datatype is not supported" % type(X)) |
no outgoing calls
no test coverage detected
searching dependent graphs…