1# Copyright 2021 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 16load("//tensorflow:tensorflow.bzl", "tf_cc_test") 17load("//tensorflow/lite:build_def.bzl", "tflite_copts") 18 19# 20# This is a TF Lite delegate that is used for on-device training exclusively. 21# 22package( 23 default_visibility = ["//visibility:private"], 24 licenses = ["notice"], 25) 26 27cc_library( 28 name = "training_delegate", 29 srcs = [ 30 "training_delegate.cc", 31 ], 32 hdrs = [ 33 "training_delegate.h", 34 ], 35 copts = tflite_copts(), 36 visibility = [ 37 "//tensorflow/lite/delegates/flex/training:__subpackages__", 38 ], 39 deps = [ 40 "//tensorflow/core:framework", 41 "//tensorflow/lite/delegates/flex:delegate_without_symbol", 42 ], 43 alwayslink = 1, 44) 45 46tf_cc_test( 47 name = "training_delegate_test", 48 size = "small", 49 srcs = ["training_delegate_test.cc"], 50 tags = [ 51 "no_gpu", # GPU + flex is not supported. 52 ], 53 deps = [ 54 ":training_delegate", 55 "//tensorflow/lite:shared_library", 56 "//tensorflow/lite/delegates/flex:test_util", 57 "//tensorflow/lite/kernels:test_util", 58 "@com_google_googletest//:gtest_main", 59 ], 60) 61