11#ifndef ROOT_INTERNAL_ML_RBATCHSINK
12#define ROOT_INTERNAL_ML_RBATCHSINK
62 virtual void FillRow(
const float *row) = 0;
94 void FillRow(
const float *row)
override;
114 void FillRow(
const float *row)
override;
125 std::vector<RColumnLayout>
layout, std::string_view
format);
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t format
Writes RFlat2DMatrix batches to disk letting RDataLoaderEngine::Save() stay agnostic to the output fo...
RBatchSink(const RBatchSink &)=delete
RBatchSink & operator=(const RBatchSink &)=delete
std::vector< RColumnLayout > fLayout
void FillBatch(const RFlat2DMatrix &batch)
Write every row of batch.
virtual void Commit()=0
Flush everything to disk once after the last batch.
virtual ~RBatchSink()=default
RBatchSink(RBatchSink &&)=delete
virtual void FillRow(const float *row)=0
Copy one row of fRowWidth floats into the writer's buffers and write the entry.
RBatchSink(std::vector< RColumnLayout > layout)
RBatchSink & operator=(RBatchSink &&)=delete
Writes batches into an RNTuple, as one float field per scalar column and one std::vector<float> field...
std::vector< std::shared_ptr< std::vector< float > > > fVectorFields
void FillRow(const float *row) override
Copy one row of fRowWidth floats into the writer's buffers and write the entry.
RNTupleBatchSink(const RNTupleBatchSink &)=delete
RNTupleBatchSink & operator=(RNTupleBatchSink &&)=delete
void Commit() override
Flush everything to disk once after the last batch.
RNTupleBatchSink(RNTupleBatchSink &&)=delete
std::unique_ptr< ROOT::RNTupleWriter > fWriter
RNTupleBatchSink & operator=(const RNTupleBatchSink &)=delete
~RNTupleBatchSink() override
RNTupleBatchSink(std::string_view dataset_name, std::string_view filename, std::vector< RColumnLayout > layout)
std::vector< float * > fDestinations
std::vector< std::shared_ptr< float > > fScalarFields
Writes batches into a TTree, as one float leaf per scalar column and one std::vector<float> branch pe...
RTTreeBatchSink & operator=(const RTTreeBatchSink &)=delete
void Commit() override
Flush everything to disk once after the last batch.
RTTreeBatchSink(std::string_view dataset_name, std::string_view filename, std::vector< RColumnLayout > layout)
std::vector< float > fRow
~RTTreeBatchSink() override
RTTreeBatchSink(const RTTreeBatchSink &)=delete
std::unique_ptr< TFile > fFile
RTTreeBatchSink & operator=(RTTreeBatchSink &&)=delete
void FillRow(const float *row) override
Copy one row of fRowWidth floats into the writer's buffers and write the entry.
RTTreeBatchSink(RTTreeBatchSink &&)=delete
std::vector< std::vector< float > > fVectorBuffers
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
A TTree represents a columnar dataset.
std::unique_ptr< RBatchSink > CreateBatchSink(std::string_view dataset_name, std::string_view filename, std::vector< RColumnLayout > layout, std::string_view format)
Create the sink matching format.
Where one of the loader's columns lives inside a batch-tensor row and how it's shaped.
Wrapper around ROOT::RVec<float> representing a 2D matrix.