@@ -113,13 +113,13 @@ public class KNeighborsClassifier {
113113
114114 // Find the top neighbor with minimum distance.
115115 ( minDistances, minDistanceIndex) =
116- Raw . topKV2 ( distances, k: Tensor < Int32 > ( Int32 ( data. shape [ 0 ] ) ) , sorted: true )
117- minDistances = Raw . reverse ( minDistances, dims: Tensor < Bool > ( [ true ] ) )
116+ _Raw . topKV2 ( distances, k: Tensor < Int32 > ( Int32 ( data. shape [ 0 ] ) ) , sorted: true )
117+ minDistances = _Raw . reverse ( minDistances, dims: Tensor < Bool > ( [ true ] ) )
118118 minDistances = minDistances
119119 . slice ( lowerBounds: Tensor < Int32 > ( [ 0 ] ) ,
120120 sizes: Tensor < Int32 > ( [ Int32 ( self . neighborCount) ] ) )
121121
122- minDistanceIndex = Raw . reverse ( minDistanceIndex, dims: Tensor < Bool > ( [ true ] ) )
122+ minDistanceIndex = _Raw . reverse ( minDistanceIndex, dims: Tensor < Bool > ( [ true ] ) )
123123 minDistanceIndex = minDistanceIndex
124124 . slice ( lowerBounds: Tensor < Int32 > ( [ 0 ] ) ,
125125 sizes: Tensor < Int32 > ( [ Int32 ( self . neighborCount) ] ) )
@@ -132,7 +132,7 @@ public class KNeighborsClassifier {
132132 let labelsAndWeightsTensor = computeWeights (
133133 distances: minDistances, labels: Tensor < Float > ( minDistanceLabels) )
134134
135- ( classes, indices) = Raw . unique ( Tensor < Int32 > ( minDistanceLabels) )
135+ ( classes, indices) = _Raw . unique ( Tensor < Int32 > ( minDistanceLabels) )
136136
137137 var kClasses = Tensor < Int32 > ( zeros: [ classes. shape [ 0 ] ] )
138138 var kWeights = Tensor < Float > ( zeros: [ classes. shape [ 0 ] ] )
@@ -148,7 +148,7 @@ public class KNeighborsClassifier {
148148 }
149149
150150 // Returns class with highest weight.
151- let resultSet = Raw . topKV2 ( kWeights, k: Tensor < Int32 > ( 1 ) , sorted: true )
151+ let resultSet = _Raw . topKV2 ( kWeights, k: Tensor < Int32 > ( 1 ) , sorted: true )
152152 let classIndex = Int ( resultSet. indices [ 0 ] . scalarized ( ) )
153153 return kClasses [ classIndex]
154154 }
0 commit comments