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

Function ExpectNodeEqual

tensorflow/cc/ops/const_op_test.cc:27–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25
26template <typename T>
27void ExpectNodeEqual(const Node* n, gtl::ArraySlice<T> values,
28 TensorShape shape) {
29 EXPECT_TRUE(n->IsConstant());
30 Tensor tensor;
31 TF_EXPECT_OK(GetNodeAttr(n->attrs(), "value", &tensor));
32 DataType dtype;
33 TF_EXPECT_OK(GetNodeAttr(n->attrs(), "dtype", &dtype));
34 EXPECT_EQ(tensor.dtype(), dtype);
35 test::ExpectTensorEqual<T>(tensor, test::AsTensor(values, shape));
36}
37
38void ExpectTypeAndShape(const Node* n, DataType expected_dtype,
39 TensorShape expected_shape) {

Callers

nothing calls this directly

Calls 5

GetNodeAttrFunction · 0.50
AsTensorFunction · 0.50
IsConstantMethod · 0.45
attrsMethod · 0.45
dtypeMethod · 0.45

Tested by

no test coverage detected