1 /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 3 Licensed under the Apache License, Version 2.0 (the "License"); 4 you may not use this file except in compliance with the License. 5 You may obtain a copy of the License at 6 7 http://www.apache.org/licenses/LICENSE-2.0 8 9 Unless required by applicable law or agreed to in writing, software 10 distributed under the License is distributed on an "AS IS" BASIS, 11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 See the License for the specific language governing permissions and 13 limitations under the License. 14 ==============================================================================*/ 15 16 #ifndef TENSORFLOW_C_EXPERIMENTAL_SAVED_MODEL_PUBLIC_TENSOR_SPEC_H_ 17 #define TENSORFLOW_C_EXPERIMENTAL_SAVED_MODEL_PUBLIC_TENSOR_SPEC_H_ 18 19 #include <stddef.h> 20 21 #include "tensorflow/c/c_api_macros.h" 22 #include "tensorflow/c/tf_datatype.h" 23 #include "tensorflow/c/tf_shape.h" 24 25 #ifdef __cplusplus 26 extern "C" { 27 #endif // __cplusplus 28 29 // An opaque type corresponding to TensorSpec 30 typedef struct TF_TensorSpec TF_TensorSpec; 31 32 // Returns the dtype associated with the TensorSpec. 33 TF_CAPI_EXPORT extern TF_DataType TF_TensorSpecDataType( 34 const TF_TensorSpec* spec); 35 36 // Returns the shape associated with the TensorSpec. The returned Shape is not 37 // owned by the caller. Caller must not call TF_DeleteShape on the returned 38 // shape. 39 TF_CAPI_EXPORT extern const TF_Shape* TF_TensorSpecShape( 40 const TF_TensorSpec* spec); 41 42 #ifdef __cplusplus 43 } // end extern "C" 44 #endif // __cplusplus 45 46 #endif // TENSORFLOW_C_EXPERIMENTAL_SAVED_MODEL_PUBLIC_TENSOR_SPEC_H_ 47