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

Function TEST

tensorflow/compiler/jit/encapsulate_subgraphs_pass_test.cc:570–590  ·  view source on GitHub ↗

If there are no marked nodes, funcification should be a no-op.

Source from the content-addressed store, hash-verified

568
569// If there are no marked nodes, funcification should be a no-op.
570TEST(EncapsulateSubgraphsTest, NoFunctions) {
571 GraphDefBuilder builder(GraphDefBuilder::kFailImmediately);
572
573 Node* a = Input(builder.opts().WithName("A"));
574 Node* b = Input(builder.opts().WithName("B"));
575 Node* c = Unary(a, builder.opts().WithName("C"));
576 Binary(b, c, builder.opts().WithName("D"));
577
578 GraphDef graphdef_in;
579 FunctionDefLibrary library_in;
580 TF_EXPECT_OK(builder.ToGraphDef(&graphdef_in));
581 *library_in.add_function() = test::function::XTimesTwo();
582
583 GraphDef graphdef_out = graphdef_in;
584 FunctionDefLibrary library_out = library_in;
585 TF_EXPECT_OK(Encapsulate(&graphdef_out, &library_out));
586
587 // If there are no marked nodes, funcification should be a no-op.
588 TF_EXPECT_GRAPH_EQ(graphdef_in, graphdef_out);
589 TF_EXPECT_FUNCTIONDEFLIBRARY_EQ(library_in, library_out);
590}
591
592// Test with one function to transform.
593TEST(EncapsulateSubgraphsTest, OneFunction) {

Callers

nothing calls this directly

Calls 15

XTimesTwoFunction · 0.85
GuaranteeConstFunction · 0.85
StartsWithFunction · 0.85
HasGuaranteeConstAttrFunction · 0.85
WithAttrMethod · 0.80
WithControlInputMethod · 0.80
FinalizeBuilderMethod · 0.80
ExitOnErrorMethod · 0.80
WithOpNameMethod · 0.80
AddAttrMethod · 0.80
ToGraphMethod · 0.80

Tested by

no test coverage detected