• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright 2019 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 #include "tensorflow/c/tf_shape.h"
17 
18 #include <stdint.h>
19 
20 #include "tensorflow/c/tf_shape_internal.h"
21 #include "tensorflow/core/framework/tensor_shape.h"
22 
23 extern "C" {
24 
TF_NewShape()25 TF_Shape* TF_NewShape() {
26   return tensorflow::wrap(new tensorflow::PartialTensorShape());
27 }
28 
TF_ShapeDims(const TF_Shape * shape)29 int TF_ShapeDims(const TF_Shape* shape) {
30   return tensorflow::unwrap(shape)->dims();
31 }
32 
TF_ShapeDimSize(const TF_Shape * shape,int d)33 int64_t TF_ShapeDimSize(const TF_Shape* shape, int d) {
34   return tensorflow::unwrap(shape)->dim_size(d);
35 }
36 
TF_DeleteShape(TF_Shape * shape)37 void TF_DeleteShape(TF_Shape* shape) { delete tensorflow::unwrap(shape); }
38 
39 }  // end extern "C"
40