Switch some targets to use android_tensorflow_lib_lite_no_runtime.

PiperOrigin-RevId: 297644994
Change-Id: Icca79c1fe18e21852a5d58d163b0bbbffc5982ab
This commit is contained in:
Anna R 2020-02-27 11:23:49 -08:00 committed by TensorFlower Gardener
parent a4a2cf7ad0
commit e920c2c257
8 changed files with 28 additions and 24 deletions

View File

@ -242,7 +242,7 @@ cc_library(
visibility = ["//visibility:public"],
deps = select({
"//tensorflow:android": [
"//tensorflow/core:android_tensorflow_lib_lite",
"//tensorflow/core:android_tensorflow_lib_lite", # TODO(annarev): exclude runtime srcs
],
"//conditions:default": [
"//tensorflow/core:framework",

View File

@ -272,6 +272,7 @@ filegroup(
"log_memory.cc",
"log_memory.h",
"numeric_types.h",
"op_requires.h",
"register_types.h",
"resource_handle.cc",
"resource_handle.h",
@ -353,7 +354,6 @@ filegroup(
"op_def_util.h",
"op_kernel.cc",
"op_kernel.h",
"op_requires.h",
"op_segment.cc",
"op_segment.h",
"ops_util.cc",
@ -866,6 +866,7 @@ cc_library(
"//tensorflow/core/platform:strcat",
"//tensorflow/core/platform:stringpiece",
"//tensorflow/core/platform:types",
"//tensorflow/core/util:padding",
"@com_google_absl//absl/strings",
],
)

View File

@ -419,6 +419,13 @@ bool TryGetNodeAttr(const AttrSlice& attrs, StringPiece attr_name,
return true;
}
Status GetNodeAttr(const AttrSlice& attrs, StringPiece attr_name,
Padding* value) {
string str_value;
TF_RETURN_IF_ERROR(GetNodeAttr(attrs, attr_name, &str_value));
return GetPaddingFromString(str_value, value);
}
namespace { // Helper for InOutTypesForNode().
template <class NodeDefOrAttrSlice>

View File

@ -34,6 +34,7 @@ limitations under the License.
#include "tensorflow/core/platform/status.h"
#include "tensorflow/core/platform/stringpiece.h"
#include "tensorflow/core/platform/types.h"
#include "tensorflow/core/util/padding.h"
namespace tensorflow {
@ -304,6 +305,10 @@ bool TryGetNodeAttr(
// REQUIRES: Must not use the returned value beyond the lifetime of node_def.
const string& GetNodeAttrString(const AttrSlice& attrs, StringPiece attr_name);
// Specialization to parse an attribute directly into a Padding enum.
Status GetNodeAttr(const AttrSlice& attrs, StringPiece attr_name,
Padding* value);
// Computes the input type for a specific node input.
// REQUIRES: ValidateOpDef(op_def).ok()
Status InputTypeForNode(const NodeDef& node_def, const OpDef& op_def,

View File

@ -3953,10 +3953,15 @@ cc_library(
"aggregate_ops.h",
"aggregate_ops_cpu.h",
],
deps = [
"//tensorflow/core:framework",
"//third_party/eigen3",
],
deps = select({
"//tensorflow:android": [
"//tensorflow/core:android_tensorflow_lib_lite", # TODO(annarev): exclude runtime srcs
],
"//conditions:default": [
"//third_party/eigen3",
"//tensorflow/core:framework",
],
}),
)
tf_kernel_library(

View File

@ -47,6 +47,10 @@ filegroup(
name = "mobile_srcs_no_runtime",
srcs = [
"overflow.h",
"padding.cc",
"padding.h",
"tensor_format.cc",
"tensor_format.h",
],
)
@ -81,8 +85,6 @@ filegroup(
"matmul_bcast.h",
"mirror_pad_mode.cc",
"mirror_pad_mode.h",
"padding.cc",
"padding.h",
"port.cc",
"port.h",
"presized_cuckoo_map.h",
@ -94,8 +96,6 @@ filegroup(
"stat_summarizer.h",
"strided_slice_op.cc",
"strided_slice_op.h",
"tensor_format.cc",
"tensor_format.h",
"tensor_ops_util.h",
"tensor_slice_reader.cc",
"tensor_slice_reader.h",
@ -465,7 +465,6 @@ cc_library(
deps = [
":tensor_format",
"//tensorflow/core/framework:attr_value_proto_cc",
"//tensorflow/core/framework:node_def_util",
"//tensorflow/core/lib/core:errors",
"//tensorflow/core/lib/core:status",
],

View File

@ -16,18 +16,10 @@ limitations under the License.
#include "tensorflow/core/util/padding.h"
#include "tensorflow/core/framework/attr_value.pb.h"
#include "tensorflow/core/framework/node_def_util.h"
#include "tensorflow/core/lib/core/errors.h"
namespace tensorflow {
Status GetNodeAttr(const AttrSlice& attrs, StringPiece attr_name,
Padding* value) {
string str_value;
TF_RETURN_IF_ERROR(GetNodeAttr(attrs, attr_name, &str_value));
return GetPaddingFromString(str_value, value);
}
Status GetPaddingFromString(StringPiece str_value, Padding* value) {
if (str_value == "SAME") {
*value = SAME;

View File

@ -22,7 +22,6 @@ limitations under the License.
#include <string>
#include <vector>
#include "tensorflow/core/framework/node_def_util.h"
#include "tensorflow/core/lib/core/status.h"
#include "tensorflow/core/util/tensor_format.h"
@ -60,10 +59,6 @@ string GetPaddingAttrStringWithExplicit();
string GetExplicitPaddingsAttrString();
// Specialization to parse an attribute directly into a Padding enum.
Status GetNodeAttr(const AttrSlice& attrs, StringPiece attr_name,
Padding* value);
// Sets padding value based on the given string padding value.
Status GetPaddingFromString(StringPiece str_value, Padding* value);