FDF循環(huán)互助智能合約游戲系統(tǒng)開發(fā)(開發(fā)案例)及源碼
Web2.0架構(gòu)由前端、后端、數(shù)據(jù)庫等組件組成。同樣的,Web3.0架構(gòu)也可以類似地分為前端、后端、數(shù)據(jù)庫,區(qū)別在于DApps前端架構(gòu)主要專注于與智能合約(去中心化程序)的通信,后端邏輯通過智能合約實現(xiàn),然后部署到共享狀態(tài)機(也就是區(qū)塊鏈網(wǎng)絡(luò)),不需要集中式數(shù)據(jù)庫或Web服務(wù)器,而是可以利用區(qū)塊鏈在計算機網(wǎng)絡(luò)之間分發(fā)應(yīng)用程序。
void TensorStatistic::updateRange(){
//根據(jù)輸入計算結(jié)果,得到特征圖每個通道的最大最小值
if(mUpdatedRangeFlags){
return;
}
mUpdatedRangeFlags=true;
mOriginTensor->copyToHostTensor(mHostTensor.get());
int batch=mHostTensor->batch();
int channel=mHostTensor->channel();
int width=mHostTensor->width();
int height=mHostTensor->height();
auto area=width*height;
for(int n=0;n<batch;++n){
auto dataBatch=mHostTensor->host<float>()+n*mHostTensor->stride(0);
for(int c=0;c<channel;++c){
int cIndex=c;
if(mMergeChannel){
cIndex=0;
}案例開發(fā)設(shè)計I59分析2OO7詳情3O69
auto minValue=mRangePerChannel[cIndex].first;
auto maxValue=mRangePerChannel[cIndex].second;
auto dataChannel=dataBatch+c*mHostTensor->stride(1);
for(int v=0;v<area;){開發(fā)方案及源碼:yy625019
minValue=std::min(minValue,dataChannel[v]);
maxValue=std::max(maxValue,dataChannel[v]);
}
mRangePerChannel[cIndex].first=minValue;
mRangePerChannel[cIndex].second=maxValue;
}
}
mVisited=true;
}
FDF循環(huán)互助智能合約游戲系統(tǒng)開發(fā)(開發(fā)案例)及源碼的評論 (共 條)
