This repository was archived by the owner on Nov 17, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
scala-package/core/src/main/scala/org/apache/mxnet Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -152,31 +152,26 @@ class SparseNDArray private[mxnet] (override private[mxnet] val handle: NDArrayH
152
152
}
153
153
154
154
override def slice (start : Int , end : Int ): NDArray = {
155
- printf(s " \n\n Slice being called!! \n\n start: $start end: $end" )
156
155
NDArray .api.slice(this , Shape (start), Shape (end))
157
156
}
158
157
159
158
/**
160
- * Get the Data portion from the row Sparse NDArray
159
+ * Get the Data portion from a Row Sparse NDArray
161
160
* @return NDArray
162
161
*/
163
162
def getData : NDArray = {
163
+ require(this .sparseFormat == SparseFormat .ROW_SPARSE , " Not Supported for CSR" )
164
164
val handle = new NDArrayHandleRef
165
- if (this .sparseFormat == SparseFormat .CSR ) {
166
- throw new UnsupportedOperationException (" Not Supported for CSR" )
167
- }
168
165
_LIB.mxNDArrayGetDataNDArray(this .handle, handle)
169
166
new NDArray (handle.value, false )
170
167
}
171
168
172
169
/**
173
- * Get the indptr Array
170
+ * Get the indptr Array from a CSR NDArray
174
171
* @return NDArray
175
172
*/
176
173
def getIndptr : NDArray = {
177
- if (this .sparseFormat == SparseFormat .ROW_SPARSE ) {
178
- throw new UnsupportedOperationException (" Not Supported for row sparse" )
179
- }
174
+ require(this .sparseFormat == SparseFormat .CSR , " Not Supported for row sparse" )
180
175
getAuxNDArray(0 )
181
176
}
182
177
You can’t perform that action at this time.
0 commit comments