提交 ca9cfc9c 编写于 作者: A A. Unique TensorFlower 提交者: TensorFlower Gardener

Removing lazy loading of sdca_ops.so since it is no longer necessary.

Change: 119643238
上级 16b856e7
......@@ -36,6 +36,14 @@ cc_library(
],
)
cc_library(
name = "contrib_ops_op_lib",
visibility = ["//visibility:public"],
deps = [
"//tensorflow/contrib/linear_optimizer:sdca_ops_op_lib",
],
)
filegroup(
name = "all_files",
srcs = glob(
......
......@@ -35,9 +35,6 @@ tf_gen_op_wrapper_py(
tf_kernel_library(
name = "sdca_op_kernels",
srcs = [
"ops/sdca_ops.cc",
],
deps = [
"//tensorflow/contrib/linear_optimizer/kernels:sdca_ops",
"//tensorflow/core:framework",
......
......@@ -17,8 +17,6 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os.path
import threading
import uuid
from six.moves import range # pylint: disable=redefined-builtin
......@@ -40,22 +38,9 @@ from tensorflow.python.platform import resource_loader
__all__ = ['SdcaModel']
_sdca_ops = None
_sdca_ops_lock = threading.Lock()
# Workaround for the fact that importing tensorflow imports contrib
# (even if a user isn't using this or any other contrib op), but
# there's not yet any guarantee that the shared object exists.
# In which case, "import tensorflow" will always crash, even for users that
# never use contrib.
def _maybe_load_sdca_ops():
with _sdca_ops_lock:
global _sdca_ops
if not _sdca_ops:
_sdca_ops = load_op_library(os.path.join(
resource_loader.get_data_files_path(), '_sdca_ops.so'))
assert _sdca_ops, 'Could not load _sdca_ops.so'
_sdca_ops = load_op_library(resource_loader.get_path_to_datafile(
'_sdca_ops.so'))
assert _sdca_ops, 'Could not load _sdca_ops.so'
# TODO(sibyl-Aix6ihai): add op_scope to appropriate methods.
......@@ -124,8 +109,6 @@ class SdcaModel(object):
def __init__(self, container, examples, variables, options):
"""Create a new sdca optimizer."""
_maybe_load_sdca_ops()
if not container or not examples or not variables or not options:
raise ValueError('All arguments must be specified.')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册