#vulnerable code 
                                void computeOutputSoftmax(Vector hidden, Vector output) {
        output.mul(wo_, hidden);
        float max = output.data_[0], z = 0.0f;
        for (int i = 0; i < osz_; i++) {
            max = Math.max(output.data_[i], max);
        }
        for (int i = 0; i < osz_; i++) {
            output.data_[i] = (float) Math.exp(output.data_[i] - max);
            z += output.data_[i];
        }
        for (int i = 0; i < osz_; i++) {
            output.data_[i] /= z;
        }
    } 
                            #location 2 
                            #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code
                                Model(Matrix wi,
          Matrix wo,
          Args args,
          int seed) {
        hidden_ = new Vector(args.dim);
        output_ = new Vector(wo.m_);
        grad_ = new Vector(args.dim);
        random = new Random(seed);
        wi_ = wi;
        wo_ = wo;
        args_ = args;
        isz_ = wi.m_;
        osz_ = wo.m_;
        hsz_ = args.dim;
        negpos = 0;
        loss_ = 0.0f;
        nexamples_ = 1;
    }