diff --git a/tensorflow/BUILD b/tensorflow/BUILD index 6745b3e54fa..d1c1d7dcdef 100644 --- a/tensorflow/BUILD +++ b/tensorflow/BUILD @@ -882,30 +882,6 @@ genrule( visibility = ["//visibility:public"], ) -# The interface library (tensorflow_framework.dll.if.lib) for linking tensorflow DLL -# library (tensorflow_framework.dll) on Windows. -# To learn more about import library (called interface library in Bazel): -# https://docs.microsoft.com/en-us/cpp/build/linking-an-executable-to-a-dll?view=vs-2017#linking-implicitly -filegroup( - name = "get_tensorflow_framework_dll_import_lib", - srcs = ["//tensorflow:tensorflow_framework.dll"], - output_group = "interface_library", - visibility = ["//visibility:public"], -) - -# Rename the import library for tensorflow_framework.dll from -# tensorflow_framework.dll.if.lib to tensorflow_framework.lib -genrule( - name = "tensorflow_framework_dll_import_lib", - srcs = [":get_tensorflow_framework_dll_import_lib"], - outs = ["tensorflow_framework.lib"], - cmd = select({ - "//tensorflow:windows": "cp -f $< $@", - "//conditions:default": "touch $@", # Just a placeholder for Unix platforms - }), - visibility = ["//visibility:public"], -) - # The interface library (tensorflow_cc.dll.if.lib) for linking tensorflow DLL library (tensorflow_cc.dll) on Windows. # To learn more about import library (called interface library in Bazel): # https://docs.microsoft.com/en-us/cpp/build/linking-an-executable-to-a-dll?view=vs-2017#linking-implicitly diff --git a/tensorflow/core/util/tensor_bundle/tensor_bundle.cc b/tensorflow/core/util/tensor_bundle/tensor_bundle.cc index ae9e10b3f67..bb18000fcfe 100644 --- a/tensorflow/core/util/tensor_bundle/tensor_bundle.cc +++ b/tensorflow/core/util/tensor_bundle/tensor_bundle.cc @@ -741,7 +741,7 @@ Status MergeBundles(Env* env, gtl::ArraySlice prefixes, // Interface for reading a tensor bundle. -TF_EXPORT BundleReader::BundleReader(Env* env, StringPiece prefix) +BundleReader::BundleReader(Env* env, StringPiece prefix) : env_(env), prefix_(prefix), metadata_(nullptr), @@ -796,7 +796,7 @@ TF_EXPORT BundleReader::BundleReader(Env* env, StringPiece prefix) kTensorBundleMinProducer, "Checkpoint", "checkpoint"); } -TF_EXPORT BundleReader::~BundleReader() { +BundleReader::~BundleReader() { delete metadata_; delete iter_; delete table_; @@ -936,7 +936,7 @@ Status BundleReader::GetValue(const BundleEntryProto& entry, Tensor* val) { return Status::OK(); } -TF_EXPORT Status BundleReader::Lookup(StringPiece key, Tensor* val) { +Status BundleReader::Lookup(StringPiece key, Tensor* val) { CHECK(val != nullptr); BundleEntryProto entry; TF_RETURN_IF_ERROR(GetBundleEntryProto(key, &entry)); @@ -950,7 +950,7 @@ TF_EXPORT Status BundleReader::Lookup(StringPiece key, Tensor* val) { } } -TF_EXPORT Status BundleReader::ReadCurrent(Tensor* val) { +Status BundleReader::ReadCurrent(Tensor* val) { CHECK(val != nullptr); BundleEntryProto entry; TF_RETURN_IF_ERROR(ParseEntryProto(iter_->key(), iter_->value(), &entry)); @@ -968,8 +968,8 @@ TF_EXPORT Status BundleReader::ReadCurrent(Tensor* val) { } } -TF_EXPORT Status BundleReader::LookupTensorSlices( - StringPiece key, std::vector* slices) { +Status BundleReader::LookupTensorSlices(StringPiece key, + std::vector* slices) { slices->clear(); BundleEntryProto entry; TF_RETURN_IF_ERROR(GetBundleEntryProto(key, &entry)); @@ -980,9 +980,8 @@ TF_EXPORT Status BundleReader::LookupTensorSlices( return Status::OK(); } -TF_EXPORT Status BundleReader::LookupSlice(StringPiece full_tensor_key, - const TensorSlice& slice_spec, - Tensor* val) { +Status BundleReader::LookupSlice(StringPiece full_tensor_key, + const TensorSlice& slice_spec, Tensor* val) { CHECK(val != nullptr); BundleEntryProto entry; TF_RETURN_IF_ERROR(GetBundleEntryProto(full_tensor_key, &entry)); @@ -1104,14 +1103,13 @@ Status BundleReader::GetSliceValue(StringPiece full_tensor_key, return Status::OK(); } -TF_EXPORT bool BundleReader::Contains(StringPiece key) { +bool BundleReader::Contains(StringPiece key) { Seek(key); return Valid() && (this->key() == key); } -TF_EXPORT Status BundleReader::LookupDtypeAndShape(StringPiece key, - DataType* dtype, - TensorShape* shape) { +Status BundleReader::LookupDtypeAndShape(StringPiece key, DataType* dtype, + TensorShape* shape) { BundleEntryProto entry; TF_RETURN_IF_ERROR(GetBundleEntryProto(key, &entry)); *dtype = entry.dtype(); @@ -1119,13 +1117,12 @@ TF_EXPORT Status BundleReader::LookupDtypeAndShape(StringPiece key, return Status::OK(); } -TF_EXPORT Status BundleReader::LookupTensorShape(StringPiece key, - TensorShape* shape) { +Status BundleReader::LookupTensorShape(StringPiece key, TensorShape* shape) { DataType ignored; return LookupDtypeAndShape(key, &ignored, shape); } -TF_EXPORT string BundleReader::DebugString() { +string BundleReader::DebugString() { // Format used below emulates that of TensorSliceReader::DebugString(). string shape_str; BundleEntryProto entry; diff --git a/tensorflow/core/util/tensor_bundle/tensor_bundle.h b/tensorflow/core/util/tensor_bundle/tensor_bundle.h index 0ff0b2d8939..c441000e47d 100644 --- a/tensorflow/core/util/tensor_bundle/tensor_bundle.h +++ b/tensorflow/core/util/tensor_bundle/tensor_bundle.h @@ -182,28 +182,28 @@ Status MergeBundles(Env* env, gtl::ArraySlice prefixes, // All threads accessing the same BundleReader must synchronize. class BundleReader { public: - TF_EXPORT BundleReader(Env* const env, StringPiece prefix); - TF_EXPORT ~BundleReader(); + BundleReader(Env* const env, StringPiece prefix); + ~BundleReader(); // Is ok() iff the reader construction is successful (completed the read of // the metadata). - TF_EXPORT Status status() const { return status_; } + Status status() const { return status_; } // Queries whether the bundle contains an entry keyed by "key". Calls Seek() // internally, so this call invalidates the reader's current position. // REQUIRES: status().ok() - TF_EXPORT bool Contains(StringPiece key); + bool Contains(StringPiece key); // Looks up the dtype and the shape of the tensor keyed by "key". // REQUIRES: status().ok() - TF_EXPORT Status LookupDtypeAndShape(StringPiece key, DataType* dtype, - TensorShape* shape) TF_MUST_USE_RESULT; + Status LookupDtypeAndShape(StringPiece key, DataType* dtype, + TensorShape* shape) TF_MUST_USE_RESULT; // Looks up the shape of the tensor keyed by "key". // Clears "shape" if not found. // REQUIRES: status().ok() - TF_EXPORT Status LookupTensorShape(StringPiece key, - TensorShape* shape) TF_MUST_USE_RESULT; + Status LookupTensorShape(StringPiece key, + TensorShape* shape) TF_MUST_USE_RESULT; // Looks up the tensor keyed by "key". If "key" refers to a partitioned // tensor, attempts to look up the full contents using all stored slices. @@ -217,7 +217,7 @@ class BundleReader { // // Validates the stored crc32c checksum against the restored bytes. // REQUIRES: status().ok() - TF_EXPORT Status Lookup(StringPiece key, Tensor* val) TF_MUST_USE_RESULT; + Status Lookup(StringPiece key, Tensor* val) TF_MUST_USE_RESULT; // Looks up the tensor pointed to by the internal iterator. // @@ -225,7 +225,7 @@ class BundleReader { // // Validates the stored crc32c checksum against the restored bytes. // REQUIRES: status().ok() && Valid() - TF_EXPORT Status ReadCurrent(Tensor* val) TF_MUST_USE_RESULT; + Status ReadCurrent(Tensor* val) TF_MUST_USE_RESULT; // Looks up the slices of the tensor keyed by "key". On OK, "slices" // is non-empty if and only if the tensor is a partitioned tensor. @@ -234,35 +234,34 @@ class BundleReader { // a slice with a larger start index in some dimension could come before // another slice with a smaller start index in the same dimension. // REQUIRES: status().ok() - TF_EXPORT Status LookupTensorSlices( - StringPiece key, std::vector* slices) TF_MUST_USE_RESULT; + Status LookupTensorSlices(StringPiece key, std::vector* slices) + TF_MUST_USE_RESULT; // Looks up a specific slice of a partitioned tensor. // It is only required that the stored slices cover the requested slice, // namely "slice_spec" is a subset of the union of the stored slices. // REQUIRES: status().ok() - TF_EXPORT Status LookupSlice(StringPiece full_tensor_key, - const TensorSlice& slice_spec, - Tensor* val) TF_MUST_USE_RESULT; + Status LookupSlice(StringPiece full_tensor_key, const TensorSlice& slice_spec, + Tensor* val) TF_MUST_USE_RESULT; // Seeks to the first position in the bundle whose key is no less than "key". // REQUIRES: status().ok() - TF_EXPORT void Seek(StringPiece key) { return iter_->Seek(key); } + void Seek(StringPiece key) { return iter_->Seek(key); } // Moves to the next position in the bundle. // REQUIRES: status().ok() - TF_EXPORT void Next() const { iter_->Next(); } + void Next() const { iter_->Next(); } // Returns true iff the reader is positioned to a key/val pair. // REQUIRES: status().ok() - TF_EXPORT bool Valid() const { return iter_->Valid(); } + bool Valid() const { return iter_->Valid(); } // Returns the key at the current position. // REQUIRES: status().ok() && Valid() - TF_EXPORT StringPiece key() const { return iter_->key(); } + StringPiece key() const { return iter_->key(); } // Returns the raw value at the current position. // REQUIRES: status().ok() && Valid() - TF_EXPORT StringPiece value() const { return iter_->value(); } + StringPiece value() const { return iter_->value(); } - TF_EXPORT string DebugString(); + string DebugString(); private: // Seeks for "key" and reads the metadata proto. diff --git a/tensorflow/tools/def_file_filter/def_file_filter.py.tpl b/tensorflow/tools/def_file_filter/def_file_filter.py.tpl index 8642a6d2e24..1049939c94b 100644 --- a/tensorflow/tools/def_file_filter/def_file_filter.py.tpl +++ b/tensorflow/tools/def_file_filter/def_file_filter.py.tpl @@ -51,11 +51,8 @@ INCLUDEPRE_RE = re.compile(r"google::protobuf::internal::ExplicitlyConstructed|" r"google::protobuf::internal::ArenaImpl::AddCleanup|" # for contrib/data/_prefetching_ops r"google::protobuf::internal::LogMessage|" # for contrib/data/_prefetching_ops r"google::protobuf::Arena::OnArenaAllocation|" # for contrib/data/_prefetching_ops - r"google::protobuf::Message::InitializationErrorString|" - r"google::protobuf::MessageLite::ParseFromArray|" r"absl::Mutex::ReaderLock|" # for //tensorflow/contrib/rnn:python/ops/_gru_ops.so and more ops r"absl::Mutex::ReaderUnlock|" # for //tensorflow/contrib/rnn:python/ops/_gru_ops.so and more ops - r"tensorflow::TensorShape|" r"tensorflow::internal::LogMessage|" r"tensorflow::internal::LogString|" r"tensorflow::internal::CheckOpMessageBuilder|"