MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / CompareInt32Tensor

Method CompareInt32Tensor

tensorflow/c/c_api_function_test.cc:136–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134 }
135
136 void CompareInt32Tensor(const std::vector<int32_t>& expected, TF_Tensor* t) {
137 int32_t* data = static_cast<int32_t*>(TF_TensorData(t));
138 size_t size = TF_TensorByteSize(t);
139 ASSERT_EQ(expected.size() * sizeof(int32_t), size);
140 for (int i = 0; i < expected.size(); ++i) {
141 ASSERT_EQ(expected[i], data[i]) << "Different data at index " << i;
142 }
143 }
144
145 std::vector<TF_Output> ToOutput(const std::vector<TF_Operation*> ops) {
146 std::vector<TF_Output> out;

Callers

nothing calls this directly

Calls 3

TF_TensorDataFunction · 0.85
TF_TensorByteSizeFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected