tensorflow/core/kernels/unary_ops_composition_test.cc
// Unary ops chained together as a separate graph nodes.
Unary ops chained together as a separate graph nodes.
Unary ops chained together as a separate graph nodes .
static Graph* UnaryOpsChain(int tensor_size, int repeat_graph,
                            int num_functions) {
  Graph* g = new Graph(OpRegistry::Global());
  Tensor t(DT_FLOAT, TensorShape({tensor_size}));
  t.flat<float>() = t.flat<float>().setRandom();
  for (int i = 0; i < repeat_graph; ++i) {
    Node* node = test::graph::Constant(g, t);
    for (int j = 0; j < num_functions; ++j) {
      TF_CHECK_OK(NodeBuilder(g->NewName("n"), Function(j))
                      .Input(node)
                      .Attr("T", DT_FLOAT)
                      .Finalize(g, &node));
    }
  }
  return g;
}
static Graph * UnaryOpsChain ( int tensor_size , int repeat_graph , int num_functions ) { Graph * g = new Graph ( OpRegistry :: Global ( ) ) ; Tensor t ( DT_FLOAT , TensorShape ( { tensor_size } ) ) ; t . flat < float > ( ) = t . flat < float > ( ) . setRandom ( ) ; for ( int i = 0 ; i < repeat_graph ; ++ i ) { Node * node = test :: graph :: Constant ( g , t ) ; for ( int j = 0 ; j < num_functions ; ++ j ) { TF_CHECK_OK ( NodeBuilder ( g -> NewName ( " " ) , Function ( j ) ) . Input ( node ) . Attr ( " " , DT_FLOAT ) . Finalize ( g , & node ) ) ; } } return g ; }
Unary ops chained together as a separate graph nodes.
Unary ops chained together as a separate graph nodes .