private static INDArray exec(ScalarOp op) {
        if (op.x().isCleanedUp())
            throw new IllegalStateException("NDArray already freed");
        return Nd4j.getExecutioner().exec(op).z();
    }
private static INDArray exec ( ScalarOp op ) { if ( op . x ( ) . isCleanedUp ( ) ) throw new IllegalStateException ( "NDArray already freed" ) ; return Nd4j . getExecutioner ( ) . exec ( op ) . z ( ) ; }
Apply the given elementwise op

@param op the factory to create the op
@return the new ndarray