184138ef8bbb258ba5822808e19c54865f345cbefA. Unique TensorFlower# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
284138ef8bbb258ba5822808e19c54865f345cbefA. Unique TensorFlower#
384138ef8bbb258ba5822808e19c54865f345cbefA. Unique TensorFlower# Licensed under the Apache License, Version 2.0 (the "License");
484138ef8bbb258ba5822808e19c54865f345cbefA. Unique TensorFlower# you may not use this file except in compliance with the License.
584138ef8bbb258ba5822808e19c54865f345cbefA. Unique TensorFlower# You may obtain a copy of the License at
684138ef8bbb258ba5822808e19c54865f345cbefA. Unique TensorFlower#
784138ef8bbb258ba5822808e19c54865f345cbefA. Unique TensorFlower#     http://www.apache.org/licenses/LICENSE-2.0
884138ef8bbb258ba5822808e19c54865f345cbefA. Unique TensorFlower#
984138ef8bbb258ba5822808e19c54865f345cbefA. Unique TensorFlower# Unless required by applicable law or agreed to in writing, software
1084138ef8bbb258ba5822808e19c54865f345cbefA. Unique TensorFlower# distributed under the License is distributed on an "AS IS" BASIS,
1184138ef8bbb258ba5822808e19c54865f345cbefA. Unique TensorFlower# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1284138ef8bbb258ba5822808e19c54865f345cbefA. Unique TensorFlower# See the License for the specific language governing permissions and
1384138ef8bbb258ba5822808e19c54865f345cbefA. Unique TensorFlower# limitations under the License.
1484138ef8bbb258ba5822808e19c54865f345cbefA. Unique TensorFlower# ==============================================================================
1584138ef8bbb258ba5822808e19c54865f345cbefA. Unique TensorFlower"""Loads the _boosted_trees_ops.so when the binary is not statically linked."""
1684138ef8bbb258ba5822808e19c54865f345cbefA. Unique TensorFlower
1784138ef8bbb258ba5822808e19c54865f345cbefA. Unique TensorFlowerfrom __future__ import absolute_import
1884138ef8bbb258ba5822808e19c54865f345cbefA. Unique TensorFlowerfrom __future__ import division
1984138ef8bbb258ba5822808e19c54865f345cbefA. Unique TensorFlowerfrom __future__ import print_function
2084138ef8bbb258ba5822808e19c54865f345cbefA. Unique TensorFlower
2184138ef8bbb258ba5822808e19c54865f345cbefA. Unique TensorFlowerfrom tensorflow.contrib.util import loader
2284138ef8bbb258ba5822808e19c54865f345cbefA. Unique TensorFlowerfrom tensorflow.python.framework import errors
2384138ef8bbb258ba5822808e19c54865f345cbefA. Unique TensorFlowerfrom tensorflow.python.platform import resource_loader
2484138ef8bbb258ba5822808e19c54865f345cbefA. Unique TensorFlower
2584138ef8bbb258ba5822808e19c54865f345cbefA. Unique TensorFlower# Conditionally load ops, they might already be statically linked in.
2684138ef8bbb258ba5822808e19c54865f345cbefA. Unique TensorFlowertry:
2784138ef8bbb258ba5822808e19c54865f345cbefA. Unique TensorFlower  loader.load_op_library(
2884138ef8bbb258ba5822808e19c54865f345cbefA. Unique TensorFlower      resource_loader.get_path_to_datafile('_boosted_trees_ops.so'))
2984138ef8bbb258ba5822808e19c54865f345cbefA. Unique TensorFlowerexcept (errors.NotFoundError, IOError):
3084138ef8bbb258ba5822808e19c54865f345cbefA. Unique TensorFlower  print('Error loading _boosted_trees_ops.so')
31