18#include "cuda_runtime.h"
32 const std::vector<TMatrixT<Double_t> > &inputTensor = std::get<0>(fData);
34 if (fBatchDepth == 1) {
35 for (
size_t i = 0; i < fBatchHeight; i++) {
37 for (
size_t j = 0;
j < fBatchWidth;
j++) {
44 for (
size_t i = 0; i < fBatchDepth; i++) {
46 for (
size_t j = 0;
j < fBatchHeight;
j++) {
47 for (
size_t k = 0; k < fBatchWidth; k++) {
48 size_t bufferIndex = i * fBatchHeight * fBatchWidth + k * fBatchHeight +
j;
63 size_t n = outputMatrix.GetNcols();
65 for (
size_t i = 0; i < fBatchSize; i++) {
67 for (
size_t j = 0;
j <
n;
j++) {
82 for (
size_t i = 0; i < fBatchSize; i++) {
95 if (fBatchDepth == 1 && fBatchHeight == fBatchSize) {
96 for (
size_t i = 0; i < fBatchHeight; i++) {
99 for (
size_t j = 0;
j < fBatchWidth;
j++) {
106 }
else if (fBatchDepth == fBatchSize) {
107 for (
size_t i = 0; i < fBatchSize; i++) {
110 for (
size_t j = 0;
j < fBatchHeight;
j++) {
111 for (
size_t k = 0; k < fBatchWidth; k++) {
113 size_t bufferIndex = i * fBatchHeight * fBatchWidth +
j * fBatchWidth + k;
114 buffer[
bufferIndex] =
event->GetValue(
j * fBatchWidth + k);
121 std::cout << fBatchDepth << fBatchSize << fBatchHeight << std::endl;
122 Error(
"TTensorDataLoader",
"Inconsistency between batch depth and batch size");
132 size_t n = buffer.GetSize() / fBatchSize;
135 for (
size_t i = 0; i < fBatchSize; i++) {
138 for (
size_t j = 0;
j <
n;
j++) {
142 if (event->GetNTargets() == 0) {
149 if (
j == event->GetClass()) {
165 for (
size_t i = 0; i < fBatchSize; i++) {
168 buffer[i] =
event->GetWeight();
177 const std::vector<TMatrixT<Double_t> > &inputTensor = std::get<0>(fData);
179 if (fBatchDepth == 1) {
180 for (
size_t i = 0; i < fBatchHeight; i++) {
182 for (
size_t j = 0;
j < fBatchWidth;
j++) {
189 for (
size_t i = 0; i < fBatchDepth; i++) {
191 for (
size_t j = 0;
j < fBatchHeight;
j++) {
192 for (
size_t k = 0; k < fBatchWidth; k++) {
193 size_t bufferIndex = i * fBatchHeight * fBatchWidth + k * fBatchHeight +
j;
208 size_t n = outputMatrix.GetNcols();
210 for (
size_t i = 0; i < fBatchSize; i++) {
212 for (
size_t j = 0;
j <
n;
j++) {
226 for (
size_t i = 0; i < fBatchSize; i++) {
238 if (fBatchDepth == 1 && fBatchHeight == fBatchSize) {
239 for (
size_t i = 0; i < fBatchHeight; i++) {
242 for (
size_t j = 0;
j < fBatchWidth;
j++) {
248 }
else if (fBatchDepth == fBatchSize) {
250 for (
size_t i = 0; i < fBatchDepth; i++) {
253 for (
size_t j = 0;
j < fBatchHeight;
j++) {
254 for (
size_t k = 0; k < fBatchWidth; k++) {
256 size_t bufferIndex = i * fBatchHeight * fBatchWidth +
j * fBatchWidth + k;
257 buffer[
bufferIndex] =
event->GetValue(
j * fBatchWidth + k);
264 Error(
"TTensorDataLoader",
"Inconsistency between batch depth and batch size");
275 size_t n = buffer.GetSize() / fBatchSize;
279 for (
size_t i = 0; i < fBatchSize; i++) {
282 for (
size_t j = 0;
j <
n;
j++) {
286 if (event->GetNTargets() == 0) {
293 if (
j == event->GetClass()) {
309 for (
size_t i = 0; i < fBatchSize; i++) {
312 buffer[i] =
event->GetWeight();
324 std::vector<size_t>
outputShape {fBatchSize, 1, fNOutputFeatures, 1};
342 std::vector<size_t>
outputShape {fBatchSize, 1, fNOutputFeatures, 1};
360 std::vector<size_t>
outputShape {fBatchSize, 1, fNOutputFeatures, 1};
378 std::vector<size_t>
outputShape {fBatchSize, 1, fNOutputFeatures, 1};
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Class that contains all the data information.
create variable transformations