Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Commit 3f92242

Browse files
committed
remove debug line
1 parent 8ae0c9f commit 3f92242

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

scala-package/core/src/main/scala/org/apache/mxnet/SparseNDArray.scala

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -152,31 +152,26 @@ class SparseNDArray private[mxnet] (override private[mxnet] val handle: NDArrayH
152152
}
153153

154154
override def slice(start: Int, end: Int): NDArray = {
155-
printf(s"\n\nSlice being called!!\n\nstart:$start end:$end")
156155
NDArray.api.slice(this, Shape(start), Shape(end))
157156
}
158157

159158
/**
160-
* Get the Data portion from the row Sparse NDArray
159+
* Get the Data portion from a Row Sparse NDArray
161160
* @return NDArray
162161
*/
163162
def getData: NDArray = {
163+
require(this.sparseFormat == SparseFormat.ROW_SPARSE, "Not Supported for CSR")
164164
val handle = new NDArrayHandleRef
165-
if (this.sparseFormat == SparseFormat.CSR) {
166-
throw new UnsupportedOperationException("Not Supported for CSR")
167-
}
168165
_LIB.mxNDArrayGetDataNDArray(this.handle, handle)
169166
new NDArray(handle.value, false)
170167
}
171168

172169
/**
173-
* Get the indptr Array
170+
* Get the indptr Array from a CSR NDArray
174171
* @return NDArray
175172
*/
176173
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")
180175
getAuxNDArray(0)
181176
}
182177

0 commit comments

Comments
 (0)