summaryrefslogtreecommitdiff
path: root/nn/common
diff options
context:
space:
mode:
authorXusong Wang <xusongw@google.com>2020-05-15 10:04:42 -0700
committerXusong Wang <xusongw@google.com>2020-06-02 16:47:57 -0700
commitcc7ab07f7d1772b43d5a20afff8f95a257253b79 (patch)
treeeea30670e1e90ebd9b2bbfd32eb9c23e50296759 /nn/common
parent2d9c48f8083f813e966eb59d9545a51664755bae (diff)
downloadml-cc7ab07f7d1772b43d5a20afff8f95a257253b79.tar.gz
Fix CAST issue with outputs of unknown rank.
Fixes: 156750075 Test: NNT_static Test: 1.3 VTS with ag/11509996 Change-Id: I9afea6076af8153ab7572b5f0fecfec41451ec86 Merged-In: I9afea6076af8153ab7572b5f0fecfec41451ec86 (cherry picked from commit 28e0c9d9d39528d0d1c9ed18b3b9d861c7ec06fb)
Diffstat (limited to 'nn/common')
-rw-r--r--nn/common/operations/Cast.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/nn/common/operations/Cast.cpp b/nn/common/operations/Cast.cpp
index f8ca4022e..77e35afb0 100644
--- a/nn/common/operations/Cast.cpp
+++ b/nn/common/operations/Cast.cpp
@@ -17,12 +17,13 @@
#define LOG_TAG "Operations"
#include "Cast.h"
+
+#include <algorithm>
+
#include "HalInterfaces.h"
#include "Operations.h"
#include "Tracing.h"
-#include <algorithm>
-
namespace android {
namespace nn {
namespace cast {
@@ -67,9 +68,6 @@ bool copyToTensor(const FromT* inputData, int numElements, uint8_t* outputData,
} // namespace
bool prepare(const Shape& input, Shape* output) {
- if (input.dimensions.size() != output->dimensions.size()) {
- return false;
- }
output->dimensions = input.dimensions;
return true;
}