Commit f1792ca4 by liyinqiao

Support fp16 data type for more operations and fix the minor errors. (Don't use…

Support fp16 data type for more operations and fix the minor errors.  (Don't use this! It's an incomplete version)
parent c52f9f7a
......@@ -528,7 +528,16 @@ void _SetDataRange(XTensor * tensor, DTYPE lower, DTYPE upper, DTYPE step)
/* set the data from the array */
tensor->SetData(data, num);
delete[] data;
if (tensor->dataType == X_INT) {
delete[] (int*)data;
}
else if (tensor->dataType == X_FLOAT) {
delete[] (float*)data;
}
else {
ShowNTErrors("TODO! Unsupported datatype!")
}
}
/*
......
......@@ -130,15 +130,18 @@ bool CheckStackShape(const TensorList &smalls, XTensor &t, int dim)
int order = tensor->order;
for (int i = 0; i < tensor->order; i++) {
if (i < dim)
if (i < dim) {
if (t.GetDim(i) != tensor->GetDim(i))
return false;
else if (i > dim)
if (t.GetDim(i) != tensor->GetDim(i-1))
}
else if (i > dim) {
if (t.GetDim(i) != tensor->GetDim(i-1))
return false;
else if (i == dim)
if (t.GetDim(i) != smalls.count)
}
else if (i == dim) {
if (t.GetDim(i) != smalls.count)
return false;
}
}
return true;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论