Skip to content

Commit 9c6b262

Browse files
committed
Improved code
1 parent f293d3a commit 9c6b262

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/xgboost/dmatrix.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ def weight=(weight)
7676
end
7777

7878
def group=(group)
79-
c_data = ::FFI::MemoryPointer.new(:uint, group.size)
80-
c_data.write_array_of_uint(group)
79+
c_data = ::FFI::MemoryPointer.new(:uint32, group.size)
80+
c_data.write_array_of_uint32(group)
8181
interface = {
8282
shape: [group.length],
8383
typestr: "|u4",
@@ -250,9 +250,9 @@ def float_info(field)
250250
def uint_info(field)
251251
num_row ||= num_row()
252252
out_len = ::FFI::MemoryPointer.new(:uint64)
253-
out_dptr = ::FFI::MemoryPointer.new(:uint, num_row)
253+
out_dptr = ::FFI::MemoryPointer.new(:uint32, num_row)
254254
check_call FFI.XGDMatrixGetUIntInfo(handle, field, out_len, out_dptr)
255-
out_dptr.read_pointer.null? ? nil : out_dptr.read_pointer.read_array_of_uint(num_row)
255+
out_dptr.read_pointer.null? ? nil : out_dptr.read_pointer.read_array_of_uint32(num_row)
256256
end
257257

258258
def validate_feature_info(feature_info, n_features, is_column_split, name)

0 commit comments

Comments
 (0)