xref: /aosp_15_r20/external/federated-compute/fcp/tensorflow/testing/tf_helper.h (revision 14675a029014e728ec732f129a32e299b2da0601)
1 /*
2  * Copyright 2020 Google LLC
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef FCP_TENSORFLOW_TESTING_TF_HELPER_H_
18 #define FCP_TENSORFLOW_TESTING_TF_HELPER_H_
19 
20 #include <string>
21 
22 #include "gtest/gtest.h"
23 #include "absl/strings/cord.h"
24 #include "fcp/base/result.h"
25 #include "fcp/tensorflow/tf_session.h"
26 #include "tensorflow/cc/framework/scope.h"
27 #include "tensorflow/cc/ops/array_ops.h"
28 #include "tensorflow/cc/ops/const_op.h"
29 #include "tensorflow/cc/ops/io_ops.h"
30 #include "tensorflow/cc/ops/state_ops.h"
31 #include "tensorflow/core/protobuf/saver.pb.h"
32 
33 namespace fcp {
34 
35 /**
36  * Get a serialized graph with the operations defined on the provided scope.
37  */
38 absl::Cord CreateGraph(tensorflow::Scope* root);
39 
40 }  // namespace fcp
41 
42 #endif  // FCP_TENSORFLOW_TESTING_TF_HELPER_H_
43