public SDVariable cosineDistance(SDVariable label, SDVariable predictions, SDVariable weights,
      LossReduce lossReduce, int dimension) {
    SDValidation.validateNumerical("cosineDistance", "label", label);
    SDValidation.validateNumerical("cosineDistance", "predictions", predictions);
    SDValidation.validateNumerical("cosineDistance", "weights", weights);