fix output_size zero bug.
This commit is contained in:
parent
cc8d760c8b
commit
1498953ea0
|
@ -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];
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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];
|
||||
|
|
Loading…
Reference in New Issue