use of org.nd4j.linalg.api.ops.impl.accum.StandardDeviation in project nd4j by deeplearning4j.
the class DefaultOpFactory method createAccum.
@Override
public Accumulation createAccum(String name, INDArray x, INDArray y, INDArray z, Object[] extraArgs) {
Accumulation ret = null;
switch(name) {
case "mmul":
case "std":
ret = new StandardDeviation(x, y, z, x.length(), (boolean) extraArgs[0]);
break;
case "var":
ret = new Variance(x, y, z, x.length(), (boolean) extraArgs[0]);
break;
default:
try {
ret = (Accumulation) DifferentialFunctionClassHolder.getInstance().getInstance(name).getClass().getConstructor(INDArray.class, INDArray.class, INDArray.class, long.class).newInstance(x, y, z, x.length());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
if (ret == null)
throw new IllegalArgumentException("Illegal operation opName " + name);
ret.setExtraArgs(extraArgs);
return ret;
}
Aggregations