华为计算微信公众号
昇腾AI开发者公众号
华为计算微博
华为计算今日头条
"attr": [ { "name": "reduction", "param_type": "required", "type": "string", "default_value": "mean" } ]
const char *pvalue = context->GetAttrs()->GetStr(0); printf("getstr %s\r\n", pvalue);
__aicore__ inline void Compute(int32_t progress) { LocalTensor<DTYPE_PREDICT> inLocal = inQueueIN.DeQue<DTYPE_PREDICT>(); LocalTensor<DTYPE_PREDICT> predictLocal = inLocal; LocalTensor<DTYPE_LABEL> labelLocal = inLocal[this->tileLength]; LocalTensor<DTYPE_Y> outLocal = outQueueOUT.AllocTensor<DTYPE_Y>(); Sub(outLocal, predictLocal, labelLocal, this->tileLength); Mul(outLocal,outLocal,outLocal,this->tileLength); outQueueOUT.EnQue<DTYPE_Y>(outLocal); inQueueIN.FreeTensor(inLocal); }
我要发帖子
"attr": [ { "name": "reduction", "param_type": "required", "type": "string", "default_value": "mean" } ]const char *pvalue = context->GetAttrs()->GetStr(0); printf("getstr %s\r\n", pvalue);__aicore__ inline void Compute(int32_t progress) { LocalTensor<DTYPE_PREDICT> inLocal = inQueueIN.DeQue<DTYPE_PREDICT>(); LocalTensor<DTYPE_PREDICT> predictLocal = inLocal; LocalTensor<DTYPE_LABEL> labelLocal = inLocal[this->tileLength]; LocalTensor<DTYPE_Y> outLocal = outQueueOUT.AllocTensor<DTYPE_Y>(); Sub(outLocal, predictLocal, labelLocal, this->tileLength); Mul(outLocal,outLocal,outLocal,this->tileLength); outQueueOUT.EnQue<DTYPE_Y>(outLocal); inQueueIN.FreeTensor(inLocal); }