<commit_before>#pragma once

#include <vector>
#include <memory>
#include <cstdint>
#include <vector>

#include <Eigen/Dense>
#include <Eigen/Sparse>

#include "SparseMode.h"
#include <SmurffCpp/Configs/TensorConfig.h>
#include <SmurffCpp/DataMatrices/Data.h>

namespace smurff {

class TensorData : public Data
{
private:
   std::vector<std::uint64_t> m_dims; //vector of dimention sizes
   std::uint64_t m_nnz;
   std::shared_ptr<std::vector<std::shared_ptr<SparseMode> > > m_Y; // this is a vector of tensor rotations

public:
   TensorData(const smurff::TensorConfig& tc);

   std::shared_ptr<SparseMode> Y(std::uint64_t mode) const;

protected:
   void init_pre() override;

public:
   double sum() const override;

public:
   std::uint64_t nmode() const override;
   std::uint64_t nnz() const override;
   std::uint64_t nna() const override;
   PVec<> dim() const override;

public:
   double train_rmse(const SubModel& model) const override;
   void get_pnm(const SubModel& model, uint32_t mode, int d, Eigen::VectorXd& rr, Eigen::MatrixXd& MM) override;
   void update_pnm(const SubModel& model, uint32_t mode) override;

public:
   double sumsq(const SubModel& model) const override;
   double var_total() const override;

public:
   std::ostream& info(std::ostream& os, std::string indent) override;
};

}<commit_msg>info does not require separate implementation in TensorData<commit_after>#pragma once

#include <vector>
#include <memory>
#include <cstdint>
#include <vector>

#include <Eigen/Dense>
#include <Eigen/Sparse>

#include "SparseMode.h"
#include <SmurffCpp/Configs/TensorConfig.h>
#include <SmurffCpp/DataMatrices/Data.h>

namespace smurff {

class TensorData : public Data
{
private:
   std::vector<std::uint64_t> m_dims; //vector of dimention sizes
   std::uint64_t m_nnz;
   std::shared_ptr<std::vector<std::shared_ptr<SparseMode> > > m_Y; // this is a vector of tensor rotations

public:
   TensorData(const smurff::TensorConfig& tc);

   std::shared_ptr<SparseMode> Y(std::uint64_t mode) const;

protected:
   void init_pre() override;

public:
   double sum() const override;

public:
   std::uint64_t nmode() const override;
   std::uint64_t nnz() const override;
   std::uint64_t nna() const override;
   PVec<> dim() const override;

public:
   double train_rmse(const SubModel& model) const override;
   void get_pnm(const SubModel& model, uint32_t mode, int d, Eigen::VectorXd& rr, Eigen::MatrixXd& MM) override;
   void update_pnm(const SubModel& model, uint32_t mode) override;

public:
   double sumsq(const SubModel& model) const override;
   double var_total() const override;
};

}
{'fraction_non_alphanumeric': 0.12018313620755437, 'fraction_numerical': 0.012209080503624571, 'mean_word_length': 5.348668280871671, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, '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': '6338952', 'n_tokens_mistral': 938, 'n_tokens_neox': 918, 'n_words': 246}