Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package org.apache.spark.mllib.feature

import breeze.linalg.{DenseVector => BDV, SparseVector => BSV}
import breeze.linalg.{DenseVector => BDV, SparseVector => BSV, norm => brzNorm}

import org.apache.spark.annotation.Experimental
import org.apache.spark.mllib.linalg.{Vector, Vectors}
Expand Down Expand Up @@ -47,7 +47,7 @@ class Normalizer(p: Double) extends VectorTransformer {
* @return normalized vector. If the norm of the input is zero, it will return the input vector.
*/
override def transform(vector: Vector): Vector = {
var norm = vector.toBreeze.norm(p)
var norm = brzNorm(vector.toBreeze, p)

if (norm != 0.0) {
// For dense vector, we've to allocate new memory for new output vector.
Expand Down