GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fool/data_layer.cpp at master · DaFuCoding/fool

Expand file tree

/

data_layer.cpp

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
47 lines (39 loc) · 1.42 KB
/

data_layer.cpp

Copy path

File metadata and controls

47 lines (39 loc) · 1.42 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "data_layer.hpp"
namespace fool{
template<typename Dtype>
DataLayer<Dtype>::DataLayer(
int data_total,
std::vector<Block<Dtype>*>& p_src_data,
std::vector<Block<Dtype>*>& p_label){
m_cursor = 0;
m_data_total = data_total;
m_labels = p_label;
m_src_data = p_src_data;
}
template<typename Dtype>
void DataLayer<Dtype>::load_batch(
int batch_size,
std::vector<Block<Dtype>*>& data_win,
std::vector<Block<Dtype>*>& label_win){
if(m_cursor + batch_size > m_data_total)
m_cursor = 0;
for(int id=0; id<data_win.size(); ++id){
for(int i = 0; i< data_win[id]->count(); ++i){
data_win[id]->m_data[i] = *(m_src_data[id]->m_data + m_cursor * data_win[id]->count() + i);
}
for(int j=0; j<label_win[id]->count(); ++j){
label_win[id]->m_data[j] = *(m_labels[id]->m_data + m_cursor * label_win[id]->count() + j);
}
//memcpy(data_win[id]->m_data, m_src_data[id]->m_data + m_cursor * data_win[id]->count(), batch_size * data_win[id]->count());
//memcpy(label_win[id]->m_data, m_labels[id]->m_data + m_cursor * data_win[id]->count(), batch_size * label_win[id]->count());
//data_win[id]->m_data = m_src_data[id]->m_data + m_cursor * data_win[id]->count();
//label_win[id]->m_data = m_labels[id]->m_data + m_cursor * label_win[id]->count();
}
m_cursor += batch_size;
}
// Only change cursor
template<typename Dtype>
void DataLayer<Dtype>::Next(int batch_size){
}
INSTANTIATE_CLASS(DataLayer);
} // namespace fool
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.