<commit_before>#ifndef STAN__AGRAD__FWD__MATRIX__LOG_SUM_EXP_HPP
#define STAN__AGRAD__FWD__MATRIX__LOG_SUM_EXP_HPP

#include <vector>
#include <stan/agrad/fwd/fvar.hpp>
#include <stan/math/matrix/log_sum_exp.hpp>
#include <stan/math/matrix/Eigen.hpp>
#include <stan/agrad/fwd/functions/log.hpp>
#include <stan/agrad/fwd/functions/exp.hpp>

namespace stan{

  namespace agrad{

    // FIXME: cut-and-paste from fwd/log_sum_exp.hpp; should
    // be able to generalize
    template <typename T, int R, int C>
    fvar<T>
    log_sum_exp(const Eigen::Matrix<fvar<T>,R,C>& v) {
      using stan::math::log_sum_exp;
      using stan::agrad::log_sum_exp;
      using stan::agrad::exp;
      using std::exp;
      using stan::agrad::log;
      using std::log;

      Eigen::Matrix<T,1,Eigen::Dynamic> vals(v.size());
      for (int i = 0; i < v.size(); ++i)
        vals[i] = v(i).val_;
      T deriv(0.0);
      T denominator(0.0);
      for (size_t i = 0; i < v.size(); ++i) {<commit_msg>removed unsigned warning from agrad/fwd/matrix/log_sum_exp.hpp<commit_after>#ifndef STAN__AGRAD__FWD__MATRIX__LOG_SUM_EXP_HPP
#define STAN__AGRAD__FWD__MATRIX__LOG_SUM_EXP_HPP

#include <vector>
#include <stan/agrad/fwd/fvar.hpp>
#include <stan/math/matrix/log_sum_exp.hpp>
#include <stan/math/matrix/Eigen.hpp>
#include <stan/agrad/fwd/functions/log.hpp>
#include <stan/agrad/fwd/functions/exp.hpp>

namespace stan{

  namespace agrad{

    // FIXME: cut-and-paste from fwd/log_sum_exp.hpp; should
    // be able to generalize
    template <typename T, int R, int C>
    fvar<T>
    log_sum_exp(const Eigen::Matrix<fvar<T>,R,C>& v) {
      using stan::math::log_sum_exp;
      using stan::agrad::log_sum_exp;
      using stan::agrad::exp;
      using std::exp;
      using stan::agrad::log;
      using std::log;

      Eigen::Matrix<T,1,Eigen::Dynamic> vals(v.size());
      for (int i = 0; i < v.size(); ++i)
        vals[i] = v(i).val_;
      T deriv(0.0);
      T denominator(0.0);
      for (int i = 0; i < v.size(); ++i) {
{'fraction_non_alphanumeric': 0.1540755467196819, 'fraction_numerical': 0.006958250497017893, 'mean_word_length': 3.5033557046979866, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4727759', 'n_tokens_mistral': 821, 'n_tokens_neox': 801, 'n_words': 152}