Skip to content

Commit

Permalink
Fix ASAN error by removing tensor data filling for kNone in test.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 630492968
  • Loading branch information
aaronndx authored and copybara-github committed May 3, 2024
1 parent 119d569 commit 55ba90e
Showing 1 changed file with 0 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,6 @@ TEST(InferenceCalculatorUtilsTest,
std::vector<float> values{1.0f, 2.0f, 3.0f, 4.0f};
int values_len = values.size();
Tensor tensor(ElementType::kNone, Tensor::Shape({values_len}));
std::memcpy(tensor.GetCpuWriteView().buffer<float>(), values.data(),
values_len * sizeof(float));
absl::Status status =
CopyCpuInputIntoInterpreterTensor(tensor, interpreter, tensor_index);
EXPECT_FALSE(status.ok());
Expand Down Expand Up @@ -392,8 +390,6 @@ TEST(InferenceCalculatorUtilsTest,
std::vector<uint8_t> values{1, 2, 3, 4};
int values_len = values.size();
Tensor tensor(ElementType::kNone, Tensor::Shape({values_len}));
std::memcpy(tensor.GetCpuWriteView().buffer<uint8_t>(), values.data(),
values_len * sizeof(uint8_t));
absl::Status status =
CopyInterpreterTensorIntoCpuOutput(interpreter, tensor_index, tensor);
EXPECT_FALSE(status.ok());
Expand Down

0 comments on commit 55ba90e

Please sign in to comment.