1#!/bin/bash 2# Copyright 2021 The TensorFlow Authors. All Rights Reserved. 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# Script to manually generate the C++ ops. 18 19set -e 20 21current_file="$(readlink -f "$0")" 22current_dir="$(dirname "$current_file")" 23api_dir="${current_dir}/../../../core/api_def/base_api" 24 25generate="bazel run \ 26 --test_output=all \ 27 //tensorflow/c/experimental/ops/gen:generate_cpp -- \ 28 --output_dir="${current_dir}" \ 29 --api_dirs="${api_dir}" \ 30 --source_dir=third_party/tensorflow" 31 32${generate} \ 33 --category=array \ 34 Identity \ 35 IdentityN \ 36 ZerosLike \ 37 Shape \ 38 ExpandDims \ 39 OnesLike 40 41${generate} \ 42 --category=math \ 43 Mul \ 44 Conj \ 45 AddV2 \ 46 MatMul \ 47 Neg \ 48 Sum \ 49 Sub \ 50 Div \ 51 DivNoNan \ 52 Exp \ 53 Sqrt \ 54 SqrtGrad \ 55 Log1p 56 57${generate} \ 58 --category=nn \ 59 SparseSoftmaxCrossEntropyWithLogits \ 60 ReluGrad \ 61 Relu \ 62 BiasAdd \ 63 BiasAddGrad 64 65${generate} \ 66 --category=resource_variable \ 67 VarHandleOp \ 68 ReadVariableOp \ 69 AssignVariableOp \ 70 DestroyResourceOp 71 72${generate} \ 73 --category=io \ 74 RestoreV2 \ 75 SaveV2 76