fix output_size zero bug.

This commit is contained in:
linqingke 2021-06-29 17:30:07 +08:00
parent cc8d760c8b
commit 1498953ea0
3 changed files with 0 additions and 9 deletions

View File

@ -97,9 +97,6 @@ class GatherGpuFwdKernel : public GpuKernel {
return;
}
size_t GetSize(const std::vector<size_t> &shape, const bool flag = true) const {
if (shape.size() == 0) {
return 0;
}
size_t result = flag ? sizeof(T) : sizeof(S);
for (size_t i = 0; i < shape.size(); i++) {
result *= shape[i];

View File

@ -98,9 +98,6 @@ class GatherGradGpuKernel : public GpuKernel {
return;
}
size_t GetSize(const std::vector<size_t> &shape, const bool flag = true) const {
if (shape.size() == 0) {
return 0;
}
size_t result = flag ? sizeof(T) : sizeof(S);
for (size_t i = 0; i < shape.size(); i++) {
result *= shape[i];

View File

@ -288,9 +288,6 @@ class AnfRuntimeAlgorithm {
// Calc tensor size in byte.
template <typename T>
static size_t TensorSizeInByte(const std::vector<size_t> &shape) {
if (shape.size() == 0) {
return 0;
}
size_t result = sizeof(T);
for (size_t i = 0; i < shape.size(); i++) {
result *= shape[i];