@@ -203,7 +203,7 @@ shape: {0.shape}""".format(self)
203203 coords = np.require(coords, dtype = ' i8' , requirements = ' F' )
204204
205205 check_status(NdarraysToSparseCOOTensor(c_default_memory_pool(),
206- obj.data.view() , coords, c_shape, c_dim_names,
206+ obj.data, coords, c_shape, c_dim_names,
207207 & csparse_tensor))
208208 return pyarrow_wrap_sparse_coo_tensor(csparse_tensor)
209209
@@ -227,10 +227,10 @@ shape: {0.shape}""".format(self)
227227 for x in dim_names:
228228 c_dim_names.push_back(tobytes(x))
229229
230- coords = np.require(obj.coords.T.view() , dtype = ' i8' , requirements = ' F' )
230+ coords = np.require(obj.coords.T, dtype = ' i8' , requirements = ' F' )
231231
232232 check_status(NdarraysToSparseCOOTensor(c_default_memory_pool(),
233- obj.data.view() , coords, c_shape, c_dim_names,
233+ obj.data, coords, c_shape, c_dim_names,
234234 & csparse_tensor))
235235 return pyarrow_wrap_sparse_coo_tensor(csparse_tensor)
236236
@@ -286,7 +286,7 @@ shape: {0.shape}""".format(self)
286286 & out_data, & out_coords))
287287 data = PyObject_to_object(out_data)
288288 coords = PyObject_to_object(out_coords)
289- result = COO(data = data, coords = coords.T, shape = self .shape)
289+ result = COO(data = data[:, 0 ] , coords = coords.T, shape = self .shape)
290290 return result
291291
292292 def to_tensor (self ):
0 commit comments