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

Function TestSetTensorValue

tensorflow/core/grappler/utils_test.cc:521–531  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

519
520template <typename T>
521void TestSetTensorValue(DataType type, int val, bool success,
522 absl::string_view error_msg) {
523 Tensor t(type, TensorShape({}));
524 Status s = SetTensorValue(t.dtype(), val, &t);
525 EXPECT_EQ(s.ok(), success);
526 if (s.ok()) {
527 test::ExpectTensorEqual<T>(Tensor(static_cast<T>(val)), t);
528 } else {
529 EXPECT_EQ(s.error_message(), error_msg);
530 }
531}
532
533TEST(SetTensorValueTest, Quantized) {
534 auto int_min_error = [](DataType type) {

Callers

nothing calls this directly

Calls 5

SetTensorValueFunction · 0.85
TensorShapeClass · 0.50
TensorClass · 0.50
dtypeMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected