Exemple #1
0
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================

"""Ops for building neural network losses. See @{$python/contrib.losses}."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

# pylint: disable=unused-import,wildcard-import
from tensorflow.contrib.losses.python import losses
from tensorflow.contrib.losses.python.losses import *
# pylint: enable=unused-import,wildcard-import

from tensorflow.python.util.all_util import remove_undocumented
remove_undocumented(__name__, doc_string_modules=[losses])
Exemple #2
0
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Functions to copy elements between graphs.
"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

from tensorflow.contrib.copy_graph.python.util import copy_elements
# pylint: disable=wildcard-import
from tensorflow.contrib.copy_graph.python.util.copy_elements import *
# pylint: enable=wildcard-import

from tensorflow.python.util.all_util import remove_undocumented

remove_undocumented(__name__, doc_string_modules=[copy_elements])
Exemple #3
0
@@has_inf_or_nan
@@DumpingDebugHook
@@DumpingDebugWrapperSession
@@LocalCLIDebugHook
@@LocalCLIDebugWrapperSession
"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

# pylint: disable=unused-imports
from tensorflow.python.debug.lib.debug_data import DebugDumpDir
from tensorflow.python.debug.lib.debug_data import DebugTensorDatum
from tensorflow.python.debug.lib.debug_data import has_inf_or_nan
from tensorflow.python.debug.lib.debug_data import load_tensor_from_event_file

from tensorflow.python.debug.lib.debug_utils import add_debug_tensor_watch
from tensorflow.python.debug.lib.debug_utils import watch_graph
from tensorflow.python.debug.lib.debug_utils import watch_graph_with_blacklists

from tensorflow.python.debug.wrappers.dumping_wrapper import DumpingDebugWrapperSession
from tensorflow.python.debug.wrappers.hooks import DumpingDebugHook
from tensorflow.python.debug.wrappers.hooks import LocalCLIDebugHook
from tensorflow.python.debug.wrappers.local_cli_wrapper import LocalCLIDebugWrapperSession

from tensorflow.python.util import all_util as _all_util


_all_util.remove_undocumented(__name__)
Exemple #4
0
    'train',
    'user_ops',
])

# Variables framework.versions:
_allowed_symbols.extend([
    'VERSION',
    'GIT_VERSION',
    'COMPILER_VERSION',
])

# Remove all extra symbols that don't have a docstring or are not explicitly
# referenced in the whitelist.
remove_undocumented(__name__, _allowed_symbols,
                    [framework_lib, array_ops, client_lib, check_ops,
                     compat, constant_op, control_flow_ops, functional_ops,
                     histogram_ops, io_ops, math_ops, nn, script_ops,
                     session_ops, sparse_ops, state_ops, string_ops,
                     summary, tensor_array_ops, train])

# Special dunders that we choose to export:
_exported_dunders = set([
    '__version__',
    '__git_version__',
    '__compiler_version__',
])

# Expose symbols minus dunders, unless they are whitelisted above.
# This is necessary to export our dunders.
__all__ = [s for s in dir() if s in _exported_dunders or not s.startswith('_')]
Exemple #5
0
    'check_data',
    'check_latent_vars',
    'copy',
    'dot',
    'get_ancestors',
    'get_blanket',
    'get_children',
    'get_control_variate_coef',
    'get_descendants',
    'get_parents',
    'get_session',
    'get_siblings',
    'get_variables',
    'is_independent',
    'Progbar',
    'random_variables',
    'ReplicaExchangeMC',
    'rbf',
    'set_seed',
    'to_simplex',
    'transform',
    '__version__',
    'VERSION',
]

# Remove all extra symbols that don't have a docstring or are not explicitly
# referenced in the whitelist.
remove_undocumented(__name__, _allowed_symbols, [
    criticisms, inferences, models, util
])
Exemple #6
0
# Bring more nn-associated functionality into this package.
# go/tf-wildcard-import
# pylint: disable=wildcard-import
from tensorflow.python.ops.ctc_ops import *
from tensorflow.python.ops.nn_impl import *
from tensorflow.python.ops.nn_ops import *
from tensorflow.python.ops.candidate_sampling_ops import *
from tensorflow.python.ops.embedding_ops import *
from tensorflow.python.ops.rnn import *
# pylint: enable=wildcard-import


# TODO(cwhipkey): sigmoid and tanh should not be exposed from tf.nn.
_allowed_symbols = [
    "zero_fraction",  # documented in training.py
    # Modules whitelisted for reference through tf.nn.
    # TODO(cwhipkey): migrate callers to use the submodule directly.
    "rnn_cell",
    # Symbols whitelisted for export without documentation.
    # TODO(cwhipkey): review these and move to contrib or expose through
    # documentation.
    "all_candidate_sampler",  # Excluded in gen_docs_combined.
    "lrn",  # Excluded in gen_docs_combined.
    "relu_layer",  # Excluded in gen_docs_combined.
    "xw_plus_b",  # Excluded in gen_docs_combined.
]

remove_undocumented(__name__, _allowed_symbols,
                    [_sys.modules[__name__], _ctc_ops, _nn_ops, _nn_grad,
                     rnn_cell])
Exemple #7
0
    "FeatureLists",  # from example_pb2
    "FloatList",  # from example_pb2.
    "Int64List",  # from example_pb2.
    "JobDef",
    "SaverDef",  # From saver_pb2.
    "SequenceExample",  # from example_pb2.
    "ServerDef",
]

# pylint: disable=undefined-variable
tf_export("train.BytesList")(BytesList)
tf_export("train.ClusterDef")(ClusterDef)
tf_export("train.Example")(Example)
tf_export("train.Feature")(Feature)
tf_export("train.Features")(Features)
tf_export("train.FeatureList")(FeatureList)
tf_export("train.FeatureLists")(FeatureLists)
tf_export("train.FloatList")(FloatList)
tf_export("train.Int64List")(Int64List)
tf_export("train.JobDef")(JobDef)
tf_export("train.SaverDef")(SaverDef)
tf_export("train.SequenceExample")(SequenceExample)
tf_export("train.ServerDef")(ServerDef)
# pylint: enable=undefined-variable

# Include extra modules for docstrings because:
# * Input methods in tf.train are documented in io_ops.
# * Saver methods in tf.train are documented in state_ops.
remove_undocumented(__name__, _allowed_symbols,
                    [_sys.modules[__name__], _io_ops, _sdca_ops, _state_ops])
Exemple #8
0
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Data compression tools."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

# pylint: disable=wildcard-import
from compression.python.layers.entropybottleneck import *
from tensorflow.contrib.coder.python.ops.coder_ops import *
# pylint: enable=wildcard-import

from tensorflow.python.util.all_util import remove_undocumented
remove_undocumented(__name__, [
    "EntropyBottleneck",
    "pmf_to_quantized_cdf",
    "range_decode",
    "range_encode",
])
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""TFGAN grouped API. Please see README.md for details and usage."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

# pylint: disable=wildcard-import
from astronet.contrib.gan.python.losses.python import losses_impl
from astronet.contrib.gan.python.losses.python.losses_impl import *
# pylint: enable=wildcard-import

from tensorflow.python.util.all_util import remove_undocumented

remove_undocumented(__name__, losses_impl.__all__)
Exemple #10
0
from __future__ import division
from __future__ import print_function

from tensorflow.contrib.rnn.python.ops.core_rnn import static_bidirectional_rnn
from tensorflow.contrib.rnn.python.ops.core_rnn import static_rnn
from tensorflow.contrib.rnn.python.ops.core_rnn import static_state_saving_rnn

from tensorflow.contrib.rnn.python.ops.core_rnn_cell import BasicLSTMCell
from tensorflow.contrib.rnn.python.ops.core_rnn_cell import BasicRNNCell
from tensorflow.contrib.rnn.python.ops.core_rnn_cell import DropoutWrapper
from tensorflow.contrib.rnn.python.ops.core_rnn_cell import EmbeddingWrapper
from tensorflow.contrib.rnn.python.ops.core_rnn_cell import GRUCell
from tensorflow.contrib.rnn.python.ops.core_rnn_cell import InputProjectionWrapper
from tensorflow.contrib.rnn.python.ops.core_rnn_cell import LSTMCell
from tensorflow.contrib.rnn.python.ops.core_rnn_cell import LSTMStateTuple
from tensorflow.contrib.rnn.python.ops.core_rnn_cell import MultiRNNCell
from tensorflow.contrib.rnn.python.ops.core_rnn_cell import OutputProjectionWrapper
from tensorflow.contrib.rnn.python.ops.core_rnn_cell import RNNCell

# pylint: disable=unused-import,wildcard-import,line-too-long
from tensorflow.contrib.rnn.python.ops.fused_rnn_cell import *
from tensorflow.contrib.rnn.python.ops.gru_ops import *
from tensorflow.contrib.rnn.python.ops.lstm_ops import *
from tensorflow.contrib.rnn.python.ops.rnn import *
from tensorflow.contrib.rnn.python.ops.rnn_cell import *
# pylint: enable=unused-import,wildcard-import,line-too-long

from tensorflow.python.util.all_util import remove_undocumented

remove_undocumented(__name__, ['core_rnn_cell'])
Exemple #11
0
# limitations under the License.
# ==============================================================================
"""A time series library in TensorFlow (TFTS).

@@StructuralEnsembleRegressor
@@ARRegressor

@@ARModel

@@CSVReader
@@RandomWindowInputFn
@@WholeDatasetInputFn
@@predict_continuation_input_fn

@@TrainEvalFeatures
@@FilteringResults
"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

# pylint: disable=wildcard-import
from tensorflow.contrib.timeseries.python.timeseries import *
# pylint: enable=wildcard-import

from tensorflow.python.util.all_util import remove_undocumented

remove_undocumented(module_name=__name__,
                    allowed_exception_list=['saved_model_utils'])
Exemple #12
0
@@LocalCLIDebugHook
@@LocalCLIDebugWrapperSession
@@WatchOptions
"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

# pylint: disable=unused-imports
from tensorflow.python.debug.lib.debug_data import DebugDumpDir
from tensorflow.python.debug.lib.debug_data import DebugTensorDatum
from tensorflow.python.debug.lib.debug_data import has_inf_or_nan
from tensorflow.python.debug.lib.debug_data import load_tensor_from_event_file

from tensorflow.python.debug.lib.debug_utils import add_debug_tensor_watch
from tensorflow.python.debug.lib.debug_utils import watch_graph
from tensorflow.python.debug.lib.debug_utils import watch_graph_with_blacklists

from tensorflow.python.debug.wrappers.dumping_wrapper import DumpingDebugWrapperSession
from tensorflow.python.debug.wrappers.framework import WatchOptions
from tensorflow.python.debug.wrappers.grpc_wrapper import GrpcDebugWrapperSession
from tensorflow.python.debug.wrappers.hooks import DumpingDebugHook
from tensorflow.python.debug.wrappers.hooks import GrpcDebugHook
from tensorflow.python.debug.wrappers.hooks import LocalCLIDebugHook
from tensorflow.python.debug.wrappers.local_cli_wrapper import LocalCLIDebugWrapperSession

from tensorflow.python.util import all_util as _all_util

_all_util.remove_undocumented(__name__)
Exemple #13
0
    'Gibbs',
    'RandomVariable',
    'check_data',
    'check_latent_vars',
    'copy',
    'dot',
    'get_ancestors',
    'get_blanket',
    'get_children',
    'get_control_variate_coef',
    'get_descendants',
    'get_parents',
    'get_session',
    'get_siblings',
    'get_variables',
    'maybe_download_and_extract',
    'Progbar',
    'random_variables',
    'rbf',
    'set_seed',
    'to_simplex',
    '__version__',
    'VERSION',
]

# Remove all extra symbols that don't have a docstring or are not explicitly
# referenced in the whitelist.
remove_undocumented(__name__, _allowed_symbols, [
    criticisms, inferences, models, util
])
Exemple #14
0
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Ops and modules related to resampler."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function


# pylint: disable=wildcard-import
from tensorflow.contrib.resampler.python.ops.resampler_ops import *
from tensorflow.python.util.all_util import remove_undocumented

remove_undocumented(__name__, ["resampler"])
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Keras-like layers and utilities that implement Spectral Normalization.

Based on "Spectral Normalization for Generative Adversarial Networks" by Miyato,
et al in ICLR 2018. https://openreview.net/pdf?id=B1QRgziT-
"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

from tensorflow.contrib.gan.python.features.python import spectral_normalization_impl
# pylint: disable=wildcard-import
from tensorflow.contrib.gan.python.features.python.spectral_normalization_impl import *
# pylint: enable=wildcard-import
from tensorflow.python.util.all_util import remove_undocumented

__all__ = spectral_normalization_impl.__all__
remove_undocumented(__name__, __all__)
Exemple #16
0
          has shape [series length] (univariate) or [series length x number of
          features] (multivariate).
        Batch of sequences; `TIMES` is a vector of shape [batch size x series
          length], `VALUES` has shape [batch size x series length] or [batch
          size x series length x number of features].
      In any case, `VALUES` and any exogenous features must have their shapes
      prefixed by the shape of the value corresponding to the `TIMES` key.
  Returns:
    A dictionary containing model state updated to account for the observations
    in `features`.
  """
    filter_signature = signatures.signature_def[
        _feature_keys.SavedModelLabels.FILTER]
    features = _input_pipeline._canonicalize_numpy_data(  # pylint: disable=protected-access
        data=features,
        require_single_batch=False)
    output_tensors_by_name, feed_dict = _colate_features_to_feeds_and_fetches(
        continue_from=continue_from,
        signature=filter_signature,
        features=features,
        graph=session.graph)
    output = session.run(output_tensors_by_name, feed_dict=feed_dict)
    # Make it easier to chain filter -> predict by keeping track of the current
    # time.
    output[_feature_keys.FilteringResults.TIMES] = features[
        _feature_keys.FilteringFeatures.TIMES]
    return output


remove_undocumented(module_name=__name__)
Exemple #17
0
from tensorflow.contrib.rnn.python.ops.core_rnn import static_bidirectional_rnn
from tensorflow.contrib.rnn.python.ops.core_rnn import static_rnn
from tensorflow.contrib.rnn.python.ops.core_rnn import static_state_saving_rnn

from tensorflow.contrib.rnn.python.ops.core_rnn_cell import BasicLSTMCell
from tensorflow.contrib.rnn.python.ops.core_rnn_cell import BasicRNNCell
from tensorflow.contrib.rnn.python.ops.core_rnn_cell import DeviceWrapper
from tensorflow.contrib.rnn.python.ops.core_rnn_cell import DropoutWrapper
from tensorflow.contrib.rnn.python.ops.core_rnn_cell import EmbeddingWrapper
from tensorflow.contrib.rnn.python.ops.core_rnn_cell import GRUCell
from tensorflow.contrib.rnn.python.ops.core_rnn_cell import InputProjectionWrapper
from tensorflow.contrib.rnn.python.ops.core_rnn_cell import LSTMCell
from tensorflow.contrib.rnn.python.ops.core_rnn_cell import LSTMStateTuple
from tensorflow.contrib.rnn.python.ops.core_rnn_cell import MultiRNNCell
from tensorflow.contrib.rnn.python.ops.core_rnn_cell import OutputProjectionWrapper
from tensorflow.contrib.rnn.python.ops.core_rnn_cell import ResidualWrapper
from tensorflow.contrib.rnn.python.ops.core_rnn_cell import RNNCell

# pylint: disable=unused-import,wildcard-import,line-too-long
from tensorflow.contrib.rnn.python.ops.fused_rnn_cell import *
from tensorflow.contrib.rnn.python.ops.gru_ops import *
from tensorflow.contrib.rnn.python.ops.lstm_ops import *
from tensorflow.contrib.rnn.python.ops.rnn import *
from tensorflow.contrib.rnn.python.ops.rnn_cell import *
# pylint: enable=unused-import,wildcard-import,line-too-long

from tensorflow.python.util.all_util import remove_undocumented
remove_undocumented(__name__, ['core_rnn_cell'])

Exemple #18
0
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================

# pylint: disable=g-short-docstring-punctuation
"""Audio processing and decoding ops.

@@decode_wav
@@encode_wav
@@audio_spectrogram
@@mfcc
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function


# go/tf-wildcard-import
# pylint: disable=wildcard-import
from tensorflow.python.ops.gen_audio_ops import *
# pylint: enable=wildcard-import

from tensorflow.python.util.all_util import remove_undocumented

remove_undocumented(__name__, [])
Exemple #19
0
@@list_variables
@@load_variable
@@init_from_checkpoint
@@load_and_remap_matrix_initializer
@@load_embedding_initializer
@@load_linear_multiclass_bias_initializer
@@load_variable_slot_initializer

@@sort

@@CriticalSection
"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

# pylint: disable=unused-import,wildcard-import
from tensorflow.contrib.framework.python.framework import *
from tensorflow.contrib.framework.python.ops import *
# pylint: enable=unused-import,wildcard-import

from tensorflow.python.framework.ops import prepend_name_scope
from tensorflow.python.framework.ops import strip_name_scope

from tensorflow.python.util.all_util import remove_undocumented

_allowed_symbols = ['nest']

remove_undocumented(__name__, allowed_exception_list=_allowed_symbols)
Exemple #20
0
# pylint: enable=unused-import
from tensorflow.python.util.all_util import remove_undocumented

# Bring more nn-associated functionality into this package.
# go/tf-wildcard-import
# pylint: disable=wildcard-import
from tensorflow.python.ops.ctc_ops import *
from tensorflow.python.ops.nn_impl import *
from tensorflow.python.ops.nn_ops import *
from tensorflow.python.ops.candidate_sampling_ops import *
from tensorflow.python.ops.embedding_ops import *
from tensorflow.python.ops.rnn import *
# pylint: enable=wildcard-import

# TODO(cwhipkey): sigmoid and tanh should not be exposed from tf.nn.
_allowed_symbols = [
    "zero_fraction",  # documented in training.py
    # Modules whitelisted for reference through tf.nn.
    # TODO(cwhipkey): migrate callers to use the submodule directly.
    # Symbols whitelisted for export without documentation.
    # TODO(cwhipkey): review these and move to contrib or expose through
    # documentation.
    "all_candidate_sampler",  # Excluded in gen_docs_combined.
    "lrn",  # Excluded in gen_docs_combined.
    "relu_layer",  # Excluded in gen_docs_combined.
    "xw_plus_b",  # Excluded in gen_docs_combined.
]

remove_undocumented(__name__, _allowed_symbols,
                    [_sys.modules[__name__], _ctc_ops, _nn_ops, _nn_grad])
Exemple #21
0
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Probabilistic optimizer modules.

See @{tf.contrib.bayesflow.optimizers}.
"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

# go/tf-wildcard-import
# pylint: disable=wildcard-import
from tensorflow.contrib.bayesflow.python.ops.sgld_optimizer import *
from tensorflow.contrib.bayesflow.python.ops.variational_sgd_optimizer import *
# pylint: enable=wildcard-import
from tensorflow.python.util.all_util import remove_undocumented

_allowed_symbols = [
    'SGLDOptimizer',
    'VariationalSGDOptimizer',
]

remove_undocumented(__name__, _allowed_symbols)
Exemple #22
0
@@absolute_difference
@@compute_weighted_loss
@@cosine_distance
@@hinge_loss
@@huber_loss
@@log_loss
@@mean_pairwise_squared_error
@@mean_squared_error
@@sigmoid_cross_entropy
@@softmax_cross_entropy
@@sparse_softmax_cross_entropy

"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import sys

from tensorflow.python.ops.losses import util
# pylint: disable=wildcard-import
from tensorflow.python.ops.losses.losses_impl import *
from tensorflow.python.ops.losses.util import *
# pylint: enable=wildcard-import
from tensorflow.python.util.all_util import remove_undocumented

_allowed_symbols = []

remove_undocumented(__name__, _allowed_symbols, [sys.modules[__name__], util])
Exemple #23
0
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Ops and modules related to fused_conv2d_bias_activation."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

# pylint: disable=wildcard-import
from tensorflow.contrib.fused_conv.python.ops.fused_conv2d_bias_activation_op import *
from tensorflow.python.util.all_util import remove_undocumented

remove_undocumented(__name__, ['fused_conv2d_bias_activation'])
Exemple #24
0
remove_undocumented(__name__, _allowed_symbols, [
    _sys.modules[__name__],
    _array_ops,
    _check_ops,
    _clip_ops,
    _confusion_matrix,
    _control_flow_ops,
    _constant_op,
    _data_flow_ops,
    _functional_ops,
    _gradients,
    _histogram_ops,
    _init_ops,
    _io_ops,
    _linalg_ops,
    _logging_ops,
    _math_ops,
    _numerics,
    _parsing_ops,
    _partitioned_variables,
    _random_ops,
    _script_ops,
    _session_ops,
    _sparse_ops,
    _special_math_ops,
    _state_ops,
    _string_ops,
    _template,
    _tensor_array_ops,
    _variable_scope,
    _variables,
])
Exemple #25
0
    return None
  else:
    return merge(summary_ops)


def get_summary_description(node_def):
  """Given a TensorSummary node_def, retrieve its SummaryDescription.

  When a Summary op is instantiated, a SummaryDescription of associated
  metadata is stored in its NodeDef. This method retrieves the description.

  Args:
    node_def: the node_def_pb2.NodeDef of a TensorSummary op

  Returns:
    a summary_pb2.SummaryDescription

  Raises:
    ValueError: if the node is not a summary op.
  """

  if node_def.op != 'TensorSummary':
    raise ValueError("Can't get_summary_description on %s" % node_def.op)
  description_str = _compat.as_str_any(node_def.attr['description'].s)
  summary_description = _summary_pb2.SummaryDescription()
  _json_format.Parse(description_str, summary_description)
  return summary_description


remove_undocumented(__name__, [])
# Variables framework.versions:
_allowed_symbols.extend([
    'VERSION',
    'GIT_VERSION',
    'COMPILER_VERSION',
    'CXX11_ABI_FLAG',
    'MONOLITHIC_BUILD',
])

# Remove all extra symbols that don't have a docstring or are not explicitly
# referenced in the whitelist.
remove_undocumented(__name__, _allowed_symbols, [
    framework_lib, array_ops, check_ops, client_lib, compat, constant_op,
    control_flow_ops, confusion_matrix_m, data, distributions, functional_ops,
    histogram_ops, io_ops, keras, layers, losses, math_ops, metrics, nn,
    profiler, resource_loader, sets, script_ops, session_ops, sparse_ops,
    state_ops, string_ops, summary, tensor_array_ops, train
])

# Special dunders that we choose to export:
_exported_dunders = set([
    '__version__',
    '__git_version__',
    '__compiler_version__',
    '__cxx11_abi_flag__',
    '__monolithic_build__',
])

# Expose symbols minus dunders, unless they are whitelisted above.
# This is necessary to export our dunders.
Exemple #27
0
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Hamiltonian Monte Carlo, a gradient-based MCMC algorithm.
"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

# go/tf-wildcard-import
from tensorflow.contrib.bayesflow.python.ops.hmc_impl import *  # pylint: disable=wildcard-import,unused-wildcard-import,g-importing-member
from tensorflow.python.util import all_util

_allowed_symbols = [
    'chain',
    'kernel',
    'leapfrog_integrator',
    'leapfrog_step',
    'ais_chain'
]

all_util.remove_undocumented(__name__, _allowed_symbols)
Exemple #28
0
from tensorflow_probability.python.stats.sample_stats import variance

# pylint: enable=unused-import,wildcard-import,line-too-long,g-importing-member

from tensorflow.python.util.all_util import remove_undocumented  # pylint: disable=g-direct-tensorflow-import

__all__ = [
    'auto_correlation',
    'brier_decomposition',
    'brier_score',
    'cholesky_covariance',
    'correlation',
    'count_integers',
    'covariance',
    'expected_calibration_error',
    'find_bins',
    'histogram',
    'log_average_probs',
    'log_loomean_exp',
    'log_loosum_exp',
    'log_soomean_exp',
    'log_soosum_exp',
    'percentile',
    'quantile_auc',
    'quantiles',
    'stddev',
    'variance',
]

remove_undocumented(__name__, __all__)
Exemple #29
0
    'train',
    'user_ops',
])

# Variables framework.versions:
_allowed_symbols.extend([
    'VERSION',
    'GIT_VERSION',
    'COMPILER_VERSION',
])

# Remove all extra symbols that don't have a docstring or are not explicitly
# referenced in the whitelist.
remove_undocumented(__name__, _allowed_symbols,
                    [framework_lib, array_ops, client_lib, check_ops,
                     compat, constant_op, control_flow_ops, functional_ops,
                     histogram_ops, io_ops, math_ops, nn, script_ops,
                     session_ops, sparse_ops, state_ops, string_ops,
                     summary, tensor_array_ops, train])

# Special dunders that we choose to export:
_exported_dunders = set([
    '__version__',
    '__git_version__',
    '__compiler_version__',
])

# Expose symbols minus dunders, unless they are whitelisted above.
# This is necessary to export our dunders.
__all__ = [s for s in dir() if s in _exported_dunders or not s.startswith('_')]
Exemple #30
0
from tensorflow.python.util import all_util


def get_builtin_code_from_operator_code(opcode):
    """Return the builtin code of the given operator code.

  The following method is introduced to resolve op builtin code shortage
  problem. The new builtin operator will be assigned to the extended builtin
  code field in the flatbuffer schema. Those methods helps to hide builtin code
  details.

  Args:
    opcode: Operator code.

  Returns:
    The builtin code of the given operator code.
  """
    # Access BuiltinCode() method first if available.
    if hasattr(opcode, 'BuiltinCode') and callable(opcode.BuiltinCode):
        return max(opcode.BuiltinCode(), opcode.DeprecatedBuiltinCode())

    return max(opcode.builtinCode, opcode.deprecatedBuiltinCode)


_allowed_symbols = [
    'get_builtin_code_from_operator_code',
]

all_util.remove_undocumented(__name__, _allowed_symbols)
Exemple #31
0
from tensorflow.python.ops.ragged.ragged_math_ops import reduce_all
from tensorflow.python.ops.ragged.ragged_math_ops import reduce_any
from tensorflow.python.ops.ragged.ragged_math_ops import reduce_max
from tensorflow.python.ops.ragged.ragged_math_ops import reduce_mean
from tensorflow.python.ops.ragged.ragged_math_ops import reduce_min
from tensorflow.python.ops.ragged.ragged_math_ops import reduce_prod
from tensorflow.python.ops.ragged.ragged_math_ops import reduce_sum

from tensorflow.python.ops.ragged.ragged_math_ops import segment_max
from tensorflow.python.ops.ragged.ragged_math_ops import segment_mean
from tensorflow.python.ops.ragged.ragged_math_ops import segment_min
from tensorflow.python.ops.ragged.ragged_math_ops import segment_prod
from tensorflow.python.ops.ragged.ragged_math_ops import segment_sqrt_n
from tensorflow.python.ops.ragged.ragged_math_ops import segment_sum

from tensorflow.python.ops.ragged.ragged_tensor import is_ragged
from tensorflow.python.ops.ragged.ragged_tensor import RaggedTensor
from tensorflow.python.ops.ragged.ragged_tensor import RaggedTensorType

from tensorflow.python.ops.ragged.ragged_tensor_value import RaggedTensorValue

from tensorflow.python.ops.ragged.segment_id_ops import row_splits_to_segment_ids
from tensorflow.python.ops.ragged.segment_id_ops import segment_ids_to_row_splits

from tensorflow.python.util import all_util as _all_util

# Any symbol that is not referenced (with "@@name") in the module docstring
# above, or included in the "_elementwise_ops" whitelist, will be removed.
_all_util.remove_undocumented(__name__, _elementwise_ops)
Exemple #32
0
    # Legacy: remove.
    "do_quantize_training_on_graphdef",  # At least use grah_def, not graphdef.
    # No uses within tensorflow.
    "queue_runner",  # Use tf.train.start_queue_runner etc directly.
    # This is also imported internally.

    # TODO(drpng): document these. The reference in howtos/distributed does
    # not link.
    "SyncReplicasOptimizer",
    # Protobufs:
    "BytesList",  # from example_pb2.
    "ClusterDef",
    "Example",  # from example_pb2
    "Feature",  # from example_pb2
    "Features",  # from example_pb2
    "FeatureList",  # from example_pb2
    "FeatureLists",  # from example_pb2
    "FloatList",  # from example_pb2.
    "Int64List",  # from example_pb2.
    "JobDef",
    "SaverDef",  # From saver_pb2.
    "SequenceExample",  # from example_pb2.
    "ServerDef",
]
# Include extra modules for docstrings because:
# * Input methods in tf.train are documented in io_ops.
# * Saver methods in tf.train are documented in state_ops.
remove_undocumented(__name__, _allowed_symbols,
                    [_sys.modules[__name__], _io_ops, _sdca_ops, _state_ops])
Exemple #33
0
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Tools for working with object-based checkpoints.


For creating and managing dependencies:
@@split_dependency
"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

from tensorflow.contrib.checkpoint.python.split_dependency import split_dependency
from tensorflow.python.util.all_util import remove_undocumented

remove_undocumented(module_name=__name__)
@@CudnnRNNReluSaveable
@@CudnnRNNTanhSaveable
"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

from tensorflow.contrib.cudnn_rnn.python.ops.cudnn_rnn_ops import CudnnGRU
from tensorflow.contrib.cudnn_rnn.python.ops.cudnn_rnn_ops import CudnnGRUSaveable
from tensorflow.contrib.cudnn_rnn.python.ops.cudnn_rnn_ops import CudnnLSTM
from tensorflow.contrib.cudnn_rnn.python.ops.cudnn_rnn_ops import CudnnLSTMSaveable
from tensorflow.contrib.cudnn_rnn.python.ops.cudnn_rnn_ops import CudnnRNNRelu
from tensorflow.contrib.cudnn_rnn.python.ops.cudnn_rnn_ops import CudnnRNNReluSaveable
from tensorflow.contrib.cudnn_rnn.python.ops.cudnn_rnn_ops import CudnnRNNTanhSaveable

from tensorflow.python.util.all_util import remove_undocumented

_allowed_symbols = [
    "CudnnGRU",
    "CudnnLSTM",
    "CudnnRNNRelu",
    "CudnnRNNTanh",
    "CudnnLSTMSaveable",
    "CudnnGRUSaveable",
    "CudnnRNNReluSaveable",
    "CudnnRNNTanhSaveable",
]

remove_undocumented(__name__)
Exemple #35
0
@@absolute_difference
@@compute_weighted_loss
@@cosine_distance
@@hinge_loss
@@log_loss
@@mean_pairwise_squared_error
@@mean_squared_error
@@sigmoid_cross_entropy
@@softmax_cross_entropy
@@sparse_softmax_cross_entropy

"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import sys

from tensorflow.python.ops.losses import util
# pylint: disable=wildcard-import
from tensorflow.python.ops.losses.losses_impl import *
from tensorflow.python.ops.losses.util import *
# pylint: enable=wildcard-import
from tensorflow.python.util.all_util import remove_undocumented

_allowed_symbols = []

remove_undocumented(__name__, _allowed_symbols,
                    [sys.modules[__name__], util])
from tensorflow.python.framework.ops import strip_name_scope
from tensorflow.python.framework.smart_cond import smart_case
from tensorflow.python.framework.smart_cond import smart_cond
from tensorflow.python.framework.smart_cond import smart_constant_value
from tensorflow.python.framework.tensor_spec import BoundedTensorSpec
from tensorflow.python.framework.tensor_spec import TensorSpec
from tensorflow.python.ops.init_ops import convolutional_delta_orthogonal
from tensorflow.python.ops.init_ops import convolutional_orthogonal_1d
from tensorflow.python.ops.init_ops import convolutional_orthogonal_2d
from tensorflow.python.ops.init_ops import convolutional_orthogonal_3d
from tensorflow.python.util.all_util import remove_undocumented

_allowed_symbols = ['nest']
_nest_allowed_symbols = [
    'assert_same_structure',
    'is_sequence',
    'flatten',
    'flatten_dict_items',
    'pack_sequence_as',
    'map_structure',
    'assert_shallow_structure',
    'flatten_up_to',
    'map_structure_up_to',
    'get_traverse_shallow_structure',
    'yield_flat_paths',
    'flatten_with_joined_string_paths',
]

remove_undocumented(nest.__name__, allowed_exception_list=_nest_allowed_symbols)
remove_undocumented(__name__, allowed_exception_list=_allowed_symbols)
Exemple #37
0
from tensorflow.python.profiler.model_analyzer import profile
from tensorflow.python.profiler.model_analyzer import Profiler
from tensorflow.python.profiler.option_builder import ProfileOptionBuilder
from tensorflow.python.profiler.tfprof_logger import write_op_log

from tensorflow.python.util.all_util import remove_undocumented


_allowed_symbols = [
    'Profiler',
    'profile',
    'ProfileOptionBuilder',
    'advise',
    'write_op_log',
]

_allowed_symbols.extend([
    'GraphNodeProto',
    'MultiGraphNodeProto',
    'AdviceProto',
    'OpLogProto',
])

remove_undocumented(__name__, _allowed_symbols, [
    Profiler,
    profile,
    ProfileOptionBuilder,
    advise,
    write_op_log,
])
Exemple #38
0
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Remote fused graph ops python library.

## This package provides classes for remote fused graph ops.

"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

# pylint: disable=unused-import,wildcard-import, line-too-long
from tensorflow.contrib.remote_fused_graph.pylib.python.ops.remote_fused_graph_ops import *
# pylint: enable=unused-import,wildcard-import,line-too-long

from tensorflow.python.util.all_util import remove_undocumented

_allowed_symbols = ['remote_fused_graph_execute']

remove_undocumented(__name__, _allowed_symbols)
Exemple #39
0
remove_undocumented(__name__, _allowed_symbols,
                    [_sys.modules[__name__],
                     _array_ops,
                     _check_ops,
                     _clip_ops,
                     _confusion_matrix,
                     _control_flow_ops,
                     _constant_op,
                     _data_flow_ops,
                     _functional_ops,
                     _gradients,
                     _histogram_ops,
                     _init_ops,
                     _io_ops,
                     _linalg_ops,
                     _logging_ops,
                     _math_ops,
                     _numerics,
                     _parsing_ops,
                     _partitioned_variables,
                     _random_ops,
                     _script_ops,
                     _session_ops,
                     _sparse_ops,
                     _special_math_ops,
                     _state_ops,
                     _string_ops,
                     _template,
                     _tensor_array_ops,
                     _variable_scope,
                     _variables,])
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""TFGAN grouped API. Please see README.md for details and usage."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

# pylint: disable=wildcard-import
from tensorflow.contrib.gan.python.losses.python import losses_impl
from tensorflow.contrib.gan.python.losses.python.losses_impl import *
# pylint: enable=wildcard-import

from tensorflow.python.util.all_util import remove_undocumented

remove_undocumented(__name__, losses_impl.__all__)
Exemple #41
0
    'layers',
])

# Variables framework.versions:
_allowed_symbols.extend([
    'VERSION',
    'GIT_VERSION',
    'COMPILER_VERSION',
])

# Remove all extra symbols that don't have a docstring or are not explicitly
# referenced in the whitelist.
remove_undocumented(__name__, _allowed_symbols, [
    framework_lib, array_ops, check_ops, client_lib, compat, constant_op,
    control_flow_ops, confusion_matrix_m, functional_ops, histogram_ops, io_ops,
    losses, math_ops, metrics, nn, resource_loader, sets, script_ops,
    session_ops, sparse_ops, state_ops, string_ops, summary, tensor_array_ops,
    train, layers
])

# Special dunders that we choose to export:
_exported_dunders = set([
    '__version__',
    '__git_version__',
    '__compiler_version__',
])

# Expose symbols minus dunders, unless they are whitelisted above.
# This is necessary to export our dunders.
__all__ = [s for s in dir() if s in _exported_dunders or not s.startswith('_')]
Exemple #42
0
# limitations under the License.
# ==============================================================================
"""A time series library in TensorFlow (TFTS).

@@StructuralEnsembleRegressor
@@ARRegressor

@@ARModel

@@CSVReader
@@RandomWindowInputFn
@@WholeDatasetInputFn
@@predict_continuation_input_fn

@@TrainEvalFeatures
@@FilteringResults
"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

# pylint: disable=wildcard-import
from tensorflow.contrib.timeseries.python.timeseries import *
# pylint: enable=wildcard-import

from tensorflow.python.util.all_util import remove_undocumented

remove_undocumented(module_name=__name__,
                    allowed_exception_list=['saved_model_utils'])
Exemple #43
0
## Random Dot Stereogram `Ops`

@@single_image_random_dot_stereograms
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

from tensorflow.contrib.image.python.ops.dense_image_warp import dense_image_warp

from tensorflow.contrib.image.python.ops.distort_image_ops import adjust_hsv_in_yiq
from tensorflow.contrib.image.python.ops.distort_image_ops import random_hsv_in_yiq

from tensorflow.contrib.image.python.ops.image_ops import angles_to_projective_transforms
from tensorflow.contrib.image.python.ops.image_ops import compose_transforms
from tensorflow.contrib.image.python.ops.image_ops import connected_components
from tensorflow.contrib.image.python.ops.image_ops import rotate
from tensorflow.contrib.image.python.ops.image_ops import transform
from tensorflow.contrib.image.python.ops.image_ops import translate
from tensorflow.contrib.image.python.ops.image_ops import translations_to_projective_transforms
from tensorflow.contrib.image.python.ops.interpolate_spline import interpolate_spline
from tensorflow.contrib.image.python.ops.single_image_random_dot_stereograms import single_image_random_dot_stereograms
from tensorflow.contrib.image.python.ops.sparse_image_warp import sparse_image_warp

from tensorflow.python.util.all_util import remove_undocumented

# pylint: enable=line-too-long

remove_undocumented(__name__)
Exemple #44
0
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Ops for building neural network losses. See @{$python/contrib.losses}."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

# pylint: disable=unused-import,wildcard-import
from tensorflow.contrib.losses.python import losses
from tensorflow.contrib.losses.python.losses import *
# pylint: enable=unused-import,wildcard-import

from tensorflow.python.util.all_util import remove_undocumented
remove_undocumented(__name__, doc_string_modules=[losses])