diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__internal__/saved_model/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__internal__/saved_model/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9b52b15dc1266ed65a564ba9fecd49aff7a9ed65 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__internal__/saved_model/__init__.py @@ -0,0 +1,13 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.__internal__.saved_model namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.__internal__.saved_model import load +from tensorflow.python.saved_model.builder_impl import _SavedModelBuilder as SavedModelBuilder # line: 48 +from tensorflow.python.saved_model.load import load_partial # line: 916 +from tensorflow.python.saved_model.loader_impl import parse_saved_model # line: 75 +from tensorflow.python.saved_model.nested_structure_coder import decode_proto # line: 109 +from tensorflow.python.saved_model.nested_structure_coder import encode_structure # line: 77 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__internal__/saved_model/load/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__internal__/saved_model/load/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7beac15fa9d89616ed735e4e7b9edd0a0abe091f --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__internal__/saved_model/load/__init__.py @@ -0,0 +1,11 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.__internal__.saved_model.load namespace +""" + +import sys as _sys + +from tensorflow.python.saved_model.revived_types import VersionedTypeRegistration # line: 25 +from tensorflow.python.saved_model.revived_types import get_setter # line: 179 +from tensorflow.python.saved_model.revived_types import register_revived_type # line: 109 +from tensorflow.python.saved_model.revived_types import registered_identifiers # line: 169 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__internal__/smart_cond/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__internal__/smart_cond/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b27d9157a88dce8c43586fa52f20fa15661cc93c --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__internal__/smart_cond/__init__.py @@ -0,0 +1,8 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.__internal__.smart_cond namespace +""" + +import sys as _sys + +from tensorflow.python.framework.smart_cond import smart_cond # line: 24 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__internal__/test/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__internal__/test/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5d04364d2539a039c8c1d6d21d869b56674e0fd9 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__internal__/test/__init__.py @@ -0,0 +1,9 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.__internal__.test namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.__internal__.test import combinations +from tensorflow.python.platform.benchmark import ParameterizedBenchmark # line: 150 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__internal__/test/combinations/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__internal__/test/combinations/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..17f5e961992099e8a213f310283d1b053ed6f42d --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__internal__/test/combinations/__init__.py @@ -0,0 +1,14 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.__internal__.test.combinations namespace +""" + +import sys as _sys + +from tensorflow.python.framework.combinations import generate # line: 83 +from tensorflow.python.framework.test_combinations import NamedObject # line: 437 +from tensorflow.python.framework.test_combinations import OptionalParameter # line: 187 +from tensorflow.python.framework.test_combinations import ParameterModifier # line: 112 +from tensorflow.python.framework.test_combinations import TestCombination # line: 58 +from tensorflow.python.framework.test_combinations import combine # line: 365 +from tensorflow.python.framework.test_combinations import times # line: 403 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__internal__/tf2/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__internal__/tf2/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ac7a0cbe0793de05e33951f91ac9d5eeb1cf6ea5 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__internal__/tf2/__init__.py @@ -0,0 +1,8 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.__internal__.tf2 namespace +""" + +import sys as _sys + +from tensorflow.python.tf2 import enabled # line: 35 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__internal__/tracking/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__internal__/tracking/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bcf6b5184f3b97f6ad66ebc8c55138d4b5629bfe --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__internal__/tracking/__init__.py @@ -0,0 +1,21 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.__internal__.tracking namespace +""" + +import sys as _sys + +from tensorflow.python.checkpoint.checkpoint import register_session_provider # line: 97 +from tensorflow.python.checkpoint.checkpoint import streaming_restore # line: 739 +from tensorflow.python.checkpoint.graph_view import ObjectGraphView # line: 25 +from tensorflow.python.trackable.autotrackable import AutoTrackable # line: 29 +from tensorflow.python.trackable.base import CheckpointInitialValue # line: 123 +from tensorflow.python.trackable.base import CheckpointInitialValueCallable # line: 96 +from tensorflow.python.trackable.base import Trackable # line: 277 +from tensorflow.python.trackable.base import TrackableReference # line: 35 +from tensorflow.python.trackable.base import no_automatic_dependency_tracking # line: 182 +from tensorflow.python.trackable.base_delegate import DelegatingTrackableMixin # line: 32 +from tensorflow.python.trackable.data_structures import TrackableDataStructure # line: 171 +from tensorflow.python.trackable.data_structures import sticky_attribute_assignment # line: 124 +from tensorflow.python.trackable.data_structures import wrap_or_unwrap as wrap # line: 86 +from tensorflow.python.training.saving.saveable_object_util import saveable_objects_from_trackable # line: 499 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__internal__/train/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__internal__/train/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c726d60cc56e03187d7bde20e9fbe90ad442b31f --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__internal__/train/__init__.py @@ -0,0 +1,11 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.__internal__.train namespace +""" + +import sys as _sys + +from tensorflow.python.checkpoint.checkpoint_management import update_checkpoint_state_internal as update_checkpoint_state # line: 175 +from tensorflow.python.training.experimental.mixed_precision_global_state import is_mixed_precision_graph_rewrite_enabled # line: 40 +from tensorflow.python.training.experimental.mixed_precision_global_state import set_using_mixed_precision_policy # line: 63 +from tensorflow.python.training.moving_averages import assign_moving_average # line: 34 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__internal__/types/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__internal__/types/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..14552f2bca71b37092c952dc14f74a9cc50d5322 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__internal__/types/__init__.py @@ -0,0 +1,9 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.__internal__.types namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.__internal__.types import data +from tensorflow.python.types.core import Tensor # line: 46 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__internal__/types/data/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__internal__/types/data/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..04663471ff260665fb05617d7e27a204adf14c22 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__internal__/types/data/__init__.py @@ -0,0 +1,8 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.__internal__.types.data namespace +""" + +import sys as _sys + +from tensorflow.python.types.data import DatasetV2 as Dataset # line: 22 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__operators__/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__operators__/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..099e8539f105acfb024fc8f44f4989948107d0dd --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/__operators__/__init__.py @@ -0,0 +1,12 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.__operators__ namespace +""" + +import sys as _sys + +from tensorflow.python.ops.array_ops import _slice_helper as getitem # line: 968 +from tensorflow.python.ops.math_ops import _add_dispatch as add # line: 1841 +from tensorflow.python.ops.math_ops import tensor_equals as eq # line: 2077 +from tensorflow.python.ops.math_ops import tensor_not_equals as ne # line: 2119 +from tensorflow.python.ops.ragged.ragged_getitem import ragged_tensor_getitem as ragged_getitem # line: 34 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/audio/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/audio/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8f40f747e668e9da287ff7ccd2bcdf1346ee56eb --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/audio/__init__.py @@ -0,0 +1,9 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.audio namespace +""" + +import sys as _sys + +from tensorflow.python.ops.gen_audio_ops import decode_wav # line: 136 +from tensorflow.python.ops.gen_audio_ops import encode_wav # line: 263 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/autodiff/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/autodiff/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9187a497de14435f522c57541613bb2ba0d60950 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/autodiff/__init__.py @@ -0,0 +1,9 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.autodiff namespace +""" + +import sys as _sys + +from tensorflow.python.eager.backprop import GradientTape # line: 704 +from tensorflow.python.eager.forwardprop import ForwardAccumulator # line: 229 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/autograph/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/autograph/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2bfa9fabd1c85bc55dda176ef9e1780b73434d09 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/autograph/__init__.py @@ -0,0 +1,12 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.autograph namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.autograph import experimental +from tensorflow.python.autograph.impl.api import to_code # line: 904 +from tensorflow.python.autograph.impl.api import to_graph # line: 707 +from tensorflow.python.autograph.utils.ag_logging import set_verbosity # line: 36 +from tensorflow.python.autograph.utils.ag_logging import trace # line: 87 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/autograph/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/autograph/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1d98a370ed034a61ff7d752242dee2f39adf179e --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/autograph/experimental/__init__.py @@ -0,0 +1,10 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.autograph.experimental namespace +""" + +import sys as _sys + +from tensorflow.python.autograph.core.converter import Feature # line: 78 +from tensorflow.python.autograph.impl.api import do_not_convert # line: 624 +from tensorflow.python.autograph.lang.directives import set_loop_options # line: 45 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/bitwise/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/bitwise/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4ccb08e754cbf7c38470d097581387058f9b6cb2 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/bitwise/__init__.py @@ -0,0 +1,13 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.bitwise namespace +""" + +import sys as _sys + +from tensorflow.python.ops.gen_bitwise_ops import bitwise_and # line: 29 +from tensorflow.python.ops.gen_bitwise_ops import bitwise_or # line: 135 +from tensorflow.python.ops.gen_bitwise_ops import bitwise_xor # line: 241 +from tensorflow.python.ops.gen_bitwise_ops import invert # line: 347 +from tensorflow.python.ops.gen_bitwise_ops import left_shift # line: 471 +from tensorflow.python.ops.gen_bitwise_ops import right_shift # line: 651 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/compat/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/compat/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..cb0d3fe4d154a776dae088bb83eee5f8a7b4cdf8 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/compat/__init__.py @@ -0,0 +1,22 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.compat namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.compat import v1 +from tensorflow._api.v2.compat.v2.compat import v2 +from tensorflow.python.compat.compat import forward_compatibility_horizon # line: 125 +from tensorflow.python.compat.compat import forward_compatible # line: 65 +from tensorflow.python.framework.tensor_shape import dimension_at_index # line: 139 +from tensorflow.python.framework.tensor_shape import dimension_value # line: 103 +from tensorflow.python.util.compat import as_bytes # line: 121 +from tensorflow.python.util.compat import as_str # line: 122 +from tensorflow.python.util.compat import as_str_any # line: 125 +from tensorflow.python.util.compat import as_text # line: 120 +from tensorflow.python.util.compat import bytes_or_text_types # line: 216 +from tensorflow.python.util.compat import complex_types # line: 212 +from tensorflow.python.util.compat import integral_types # line: 208 +from tensorflow.python.util.compat import path_to_str # line: 145 +from tensorflow.python.util.compat import real_types # line: 210 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/compat/v1/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/compat/v1/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f49156f42e93f82aad620e35dd8abc5566ca4b4b --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/compat/v1/__init__.py @@ -0,0 +1,749 @@ +# 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. +# ============================================================================== +"""Bring in all of the public TensorFlow interface into this module.""" + +# pylint: disable=g-bad-import-order,g-import-not-at-top,protected-access + +import os as _os +import sys as _sys +import typing as _typing + +from tensorflow.python.tools import module_util as _module_util +from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader +from tensorflow.python.util.lazy_loader import KerasLazyLoader as _KerasLazyLoader + +from tensorflow._api.v2.compat.v1 import __internal__ +from tensorflow._api.v2.compat.v1 import app +from tensorflow._api.v2.compat.v1 import audio +from tensorflow._api.v2.compat.v1 import autograph +from tensorflow._api.v2.compat.v1 import bitwise +from tensorflow._api.v2.compat.v1 import compat +from tensorflow._api.v2.compat.v1 import config +from tensorflow._api.v2.compat.v1 import data +from tensorflow._api.v2.compat.v1 import debugging +from tensorflow._api.v2.compat.v1 import distribute +from tensorflow._api.v2.compat.v1 import distributions +from tensorflow._api.v2.compat.v1 import dtypes +from tensorflow._api.v2.compat.v1 import errors +from tensorflow._api.v2.compat.v1 import experimental +from tensorflow._api.v2.compat.v1 import feature_column +from tensorflow._api.v2.compat.v1 import gfile +from tensorflow._api.v2.compat.v1 import graph_util +from tensorflow._api.v2.compat.v1 import image +from tensorflow._api.v2.compat.v1 import initializers +from tensorflow._api.v2.compat.v1 import io +from tensorflow._api.v2.compat.v1 import layers +from tensorflow._api.v2.compat.v1 import linalg +from tensorflow._api.v2.compat.v1 import lite +from tensorflow._api.v2.compat.v1 import logging +from tensorflow._api.v2.compat.v1 import lookup +from tensorflow._api.v2.compat.v1 import losses +from tensorflow._api.v2.compat.v1 import manip +from tensorflow._api.v2.compat.v1 import math +from tensorflow._api.v2.compat.v1 import metrics +from tensorflow._api.v2.compat.v1 import mixed_precision +from tensorflow._api.v2.compat.v1 import mlir +from tensorflow._api.v2.compat.v1 import nest +from tensorflow._api.v2.compat.v1 import nn +from tensorflow._api.v2.compat.v1 import profiler +from tensorflow._api.v2.compat.v1 import python_io +from tensorflow._api.v2.compat.v1 import quantization +from tensorflow._api.v2.compat.v1 import queue +from tensorflow._api.v2.compat.v1 import ragged +from tensorflow._api.v2.compat.v1 import random +from tensorflow._api.v2.compat.v1 import raw_ops +from tensorflow._api.v2.compat.v1 import resource_loader +from tensorflow._api.v2.compat.v1 import saved_model +from tensorflow._api.v2.compat.v1 import sets +from tensorflow._api.v2.compat.v1 import signal +from tensorflow._api.v2.compat.v1 import sparse +from tensorflow._api.v2.compat.v1 import spectral +from tensorflow._api.v2.compat.v1 import strings +from tensorflow._api.v2.compat.v1 import summary +from tensorflow._api.v2.compat.v1 import sysconfig +from tensorflow._api.v2.compat.v1 import test +from tensorflow._api.v2.compat.v1 import tpu +from tensorflow._api.v2.compat.v1 import train +from tensorflow._api.v2.compat.v1 import types +from tensorflow._api.v2.compat.v1 import user_ops +from tensorflow._api.v2.compat.v1 import version +from tensorflow._api.v2.compat.v1 import xla +from tensorflow.python.ops.gen_array_ops import batch_to_space_nd # line: 343 +from tensorflow.python.ops.gen_array_ops import bitcast # line: 558 +from tensorflow.python.ops.gen_array_ops import broadcast_to # line: 829 +from tensorflow.python.ops.gen_array_ops import check_numerics # line: 950 +from tensorflow.python.ops.gen_array_ops import diag # line: 1949 +from tensorflow.python.ops.gen_array_ops import extract_volume_patches # line: 2569 +from tensorflow.python.ops.gen_array_ops import fake_quant_with_min_max_args # line: 2698 +from tensorflow.python.ops.gen_array_ops import fake_quant_with_min_max_args_gradient # line: 2867 +from tensorflow.python.ops.gen_array_ops import fake_quant_with_min_max_vars # line: 3003 +from tensorflow.python.ops.gen_array_ops import fake_quant_with_min_max_vars_gradient # line: 3145 +from tensorflow.python.ops.gen_array_ops import fake_quant_with_min_max_vars_per_channel # line: 3276 +from tensorflow.python.ops.gen_array_ops import fake_quant_with_min_max_vars_per_channel_gradient # line: 3423 +from tensorflow.python.ops.gen_array_ops import identity_n # line: 4226 +from tensorflow.python.ops.gen_array_ops import invert_permutation # line: 4592 +from tensorflow.python.ops.gen_array_ops import matrix_band_part # line: 4879 +from tensorflow.python.ops.gen_array_ops import quantized_concat # line: 8202 +from tensorflow.python.ops.gen_array_ops import reverse_v2 as reverse # line: 9140 +from tensorflow.python.ops.gen_array_ops import reverse_v2 # line: 9140 +from tensorflow.python.ops.gen_array_ops import scatter_nd # line: 9276 +from tensorflow.python.ops.gen_array_ops import space_to_batch_nd # line: 10076 +from tensorflow.python.ops.gen_array_ops import tensor_scatter_add # line: 11226 +from tensorflow.python.ops.gen_array_ops import tensor_scatter_add as tensor_scatter_nd_add # line: 11226 +from tensorflow.python.ops.gen_array_ops import tensor_scatter_max as tensor_scatter_nd_max # line: 11382 +from tensorflow.python.ops.gen_array_ops import tensor_scatter_min as tensor_scatter_nd_min # line: 11488 +from tensorflow.python.ops.gen_array_ops import tensor_scatter_sub as tensor_scatter_nd_sub # line: 11583 +from tensorflow.python.ops.gen_array_ops import tensor_scatter_sub # line: 11583 +from tensorflow.python.ops.gen_array_ops import tile # line: 11970 +from tensorflow.python.ops.gen_array_ops import unravel_index # line: 12731 +from tensorflow.python.ops.gen_control_flow_ops import no_op # line: 475 +from tensorflow.python.ops.gen_data_flow_ops import dynamic_partition # line: 594 +from tensorflow.python.ops.gen_data_flow_ops import dynamic_stitch # line: 736 +from tensorflow.python.ops.gen_io_ops import matching_files # line: 391 +from tensorflow.python.ops.gen_io_ops import write_file # line: 2269 +from tensorflow.python.ops.gen_linalg_ops import cholesky # line: 766 +from tensorflow.python.ops.gen_linalg_ops import matrix_determinant # line: 1370 +from tensorflow.python.ops.gen_linalg_ops import matrix_inverse # line: 1516 +from tensorflow.python.ops.gen_linalg_ops import matrix_solve # line: 1694 +from tensorflow.python.ops.gen_linalg_ops import matrix_square_root # line: 1913 +from tensorflow.python.ops.gen_linalg_ops import qr # line: 2150 +from tensorflow.python.ops.gen_logging_ops import timestamp # line: 886 +from tensorflow.python.ops.gen_math_ops import acosh # line: 231 +from tensorflow.python.ops.gen_math_ops import asin # line: 991 +from tensorflow.python.ops.gen_math_ops import asinh # line: 1091 +from tensorflow.python.ops.gen_math_ops import atan # line: 1184 +from tensorflow.python.ops.gen_math_ops import atan2 # line: 1284 +from tensorflow.python.ops.gen_math_ops import atanh # line: 1383 +from tensorflow.python.ops.gen_math_ops import betainc # line: 1787 +from tensorflow.python.ops.gen_math_ops import cos # line: 2464 +from tensorflow.python.ops.gen_math_ops import cosh # line: 2558 +from tensorflow.python.ops.gen_math_ops import cross # line: 2651 +from tensorflow.python.ops.gen_math_ops import digamma # line: 3161 +from tensorflow.python.ops.gen_math_ops import erf # line: 3454 +from tensorflow.python.ops.gen_math_ops import erfc # line: 3546 +from tensorflow.python.ops.gen_math_ops import expm1 # line: 3847 +from tensorflow.python.ops.gen_math_ops import floor_div # line: 4002 +from tensorflow.python.ops.gen_math_ops import floor_mod as floormod # line: 4092 +from tensorflow.python.ops.gen_math_ops import greater # line: 4186 +from tensorflow.python.ops.gen_math_ops import greater_equal # line: 4287 +from tensorflow.python.ops.gen_math_ops import igamma # line: 4480 +from tensorflow.python.ops.gen_math_ops import igammac # line: 4639 +from tensorflow.python.ops.gen_math_ops import is_finite # line: 4935 +from tensorflow.python.ops.gen_math_ops import is_inf # line: 5031 +from tensorflow.python.ops.gen_math_ops import is_nan # line: 5127 +from tensorflow.python.ops.gen_math_ops import less # line: 5223 +from tensorflow.python.ops.gen_math_ops import less_equal # line: 5324 +from tensorflow.python.ops.gen_math_ops import lgamma # line: 5425 +from tensorflow.python.ops.gen_math_ops import log # line: 5595 +from tensorflow.python.ops.gen_math_ops import log1p # line: 5689 +from tensorflow.python.ops.gen_math_ops import logical_and # line: 5779 +from tensorflow.python.ops.gen_math_ops import logical_not # line: 5918 +from tensorflow.python.ops.gen_math_ops import logical_or # line: 6005 +from tensorflow.python.ops.gen_math_ops import maximum # line: 6310 +from tensorflow.python.ops.gen_math_ops import minimum # line: 6566 +from tensorflow.python.ops.gen_math_ops import floor_mod as mod # line: 4092 +from tensorflow.python.ops.gen_math_ops import neg as negative # line: 6913 +from tensorflow.python.ops.gen_math_ops import polygamma # line: 7167 +from tensorflow.python.ops.gen_math_ops import real_div as realdiv # line: 8068 +from tensorflow.python.ops.gen_math_ops import reciprocal # line: 8159 +from tensorflow.python.ops.gen_math_ops import rint # line: 8656 +from tensorflow.python.ops.gen_math_ops import segment_max # line: 8930 +from tensorflow.python.ops.gen_math_ops import segment_mean # line: 9164 +from tensorflow.python.ops.gen_math_ops import segment_min # line: 9289 +from tensorflow.python.ops.gen_math_ops import segment_prod # line: 9523 +from tensorflow.python.ops.gen_math_ops import segment_sum # line: 9749 +from tensorflow.python.ops.gen_math_ops import sin # line: 10299 +from tensorflow.python.ops.gen_math_ops import sinh # line: 10392 +from tensorflow.python.ops.gen_math_ops import square # line: 11962 +from tensorflow.python.ops.gen_math_ops import squared_difference # line: 12051 +from tensorflow.python.ops.gen_math_ops import tan # line: 12352 +from tensorflow.python.ops.gen_math_ops import tanh # line: 12446 +from tensorflow.python.ops.gen_math_ops import truncate_div as truncatediv # line: 12601 +from tensorflow.python.ops.gen_math_ops import truncate_mod as truncatemod # line: 12695 +from tensorflow.python.ops.gen_math_ops import unsorted_segment_max # line: 12789 +from tensorflow.python.ops.gen_math_ops import unsorted_segment_min # line: 12927 +from tensorflow.python.ops.gen_math_ops import unsorted_segment_prod # line: 13061 +from tensorflow.python.ops.gen_math_ops import unsorted_segment_sum # line: 13195 +from tensorflow.python.ops.gen_math_ops import zeta # line: 13530 +from tensorflow.python.ops.gen_nn_ops import approx_top_k # line: 33 +from tensorflow.python.ops.gen_nn_ops import conv # line: 1061 +from tensorflow.python.ops.gen_nn_ops import conv2d_backprop_filter_v2 # line: 1609 +from tensorflow.python.ops.gen_nn_ops import conv2d_backprop_input_v2 # line: 1977 +from tensorflow.python.ops.gen_parsing_ops import decode_compressed # line: 144 +from tensorflow.python.ops.gen_parsing_ops import parse_tensor # line: 2135 +from tensorflow.python.ops.gen_ragged_array_ops import ragged_fill_empty_rows # line: 196 +from tensorflow.python.ops.gen_ragged_array_ops import ragged_fill_empty_rows_grad # line: 305 +from tensorflow.python.ops.gen_random_index_shuffle_ops import random_index_shuffle # line: 30 +from tensorflow.python.ops.gen_spectral_ops import fft # line: 353 +from tensorflow.python.ops.gen_spectral_ops import fft2d # line: 442 +from tensorflow.python.ops.gen_spectral_ops import fft3d # line: 531 +from tensorflow.python.ops.gen_spectral_ops import fftnd # line: 620 +from tensorflow.python.ops.gen_spectral_ops import ifft # line: 724 +from tensorflow.python.ops.gen_spectral_ops import ifft2d # line: 813 +from tensorflow.python.ops.gen_spectral_ops import ifft3d # line: 902 +from tensorflow.python.ops.gen_spectral_ops import ifftnd # line: 991 +from tensorflow.python.ops.gen_spectral_ops import irfftnd # line: 1347 +from tensorflow.python.ops.gen_spectral_ops import rfftnd # line: 1707 +from tensorflow.python.ops.gen_string_ops import as_string # line: 29 +from tensorflow.python.ops.gen_string_ops import decode_base64 # line: 182 +from tensorflow.python.ops.gen_string_ops import encode_base64 # line: 269 +from tensorflow.python.ops.gen_string_ops import string_strip # line: 1429 +from tensorflow.python.ops.gen_string_ops import string_to_hash_bucket_fast # line: 1583 +from tensorflow.python.ops.gen_string_ops import string_to_hash_bucket_strong # line: 1688 +from tensorflow.python.client.session import InteractiveSession # line: 1720 +from tensorflow.python.client.session import Session # line: 1541 +from tensorflow.python.compat.v2_compat import disable_v2_behavior # line: 83 +from tensorflow.python.compat.v2_compat import enable_v2_behavior # line: 39 +from tensorflow.python.data.ops.optional_ops import OptionalSpec # line: 205 +from tensorflow.python.eager.backprop import GradientTape # line: 704 +from tensorflow.python.eager.context import executing_eagerly_v1 as executing_eagerly # line: 2354 +from tensorflow.python.eager.polymorphic_function.polymorphic_function import function # line: 1276 +from tensorflow.python.eager.wrap_function import wrap_function # line: 576 +from tensorflow.python.framework.constant_op import constant_v1 as constant # line: 106 +from tensorflow.python.framework.device_spec import DeviceSpecV1 as DeviceSpec # line: 420 +from tensorflow.python.framework.dtypes import DType # line: 51 +from tensorflow.python.framework.dtypes import QUANTIZED_DTYPES # line: 771 +from tensorflow.python.framework.dtypes import as_dtype # line: 793 +from tensorflow.python.framework.dtypes import bfloat16 # line: 450 +from tensorflow.python.framework.dtypes import bool # line: 414 +from tensorflow.python.framework.dtypes import complex128 # line: 401 +from tensorflow.python.framework.dtypes import complex64 # line: 394 +from tensorflow.python.framework.dtypes import double # line: 388 +from tensorflow.python.framework.dtypes import float16 # line: 373 +from tensorflow.python.framework.dtypes import float32 # line: 380 +from tensorflow.python.framework.dtypes import float64 # line: 386 +from tensorflow.python.framework.dtypes import half # line: 374 +from tensorflow.python.framework.dtypes import int16 # line: 354 +from tensorflow.python.framework.dtypes import int32 # line: 360 +from tensorflow.python.framework.dtypes import int64 # line: 366 +from tensorflow.python.framework.dtypes import int8 # line: 348 +from tensorflow.python.framework.dtypes import qint16 # line: 426 +from tensorflow.python.framework.dtypes import qint32 # line: 432 +from tensorflow.python.framework.dtypes import qint8 # line: 420 +from tensorflow.python.framework.dtypes import quint16 # line: 444 +from tensorflow.python.framework.dtypes import quint8 # line: 438 +from tensorflow.python.framework.dtypes import resource # line: 312 +from tensorflow.python.framework.dtypes import string # line: 408 +from tensorflow.python.framework.dtypes import uint16 # line: 330 +from tensorflow.python.framework.dtypes import uint32 # line: 336 +from tensorflow.python.framework.dtypes import uint64 # line: 342 +from tensorflow.python.framework.dtypes import uint8 # line: 324 +from tensorflow.python.framework.dtypes import variant # line: 318 +from tensorflow.python.framework.errors_impl import OpError # line: 57 +from tensorflow.python.framework.graph_util_impl import GraphDef # line: 29 +from tensorflow.python.framework.importer import import_graph_def # line: 354 +from tensorflow.python.framework.indexed_slices import IndexedSlices # line: 54 +from tensorflow.python.framework.indexed_slices import IndexedSlicesSpec # line: 203 +from tensorflow.python.framework.indexed_slices import convert_to_tensor_or_indexed_slices # line: 277 +from tensorflow.python.framework.load_library import load_file_system_library # line: 79 +from tensorflow.python.framework.load_library import load_library # line: 120 +from tensorflow.python.framework.load_library import load_op_library # line: 31 +from tensorflow.python.framework.ops import Graph # line: 1912 +from tensorflow.python.framework.ops import GraphKeys # line: 5149 +from tensorflow.python.framework.ops import no_gradient as NoGradient # line: 1687 +from tensorflow.python.framework.ops import no_gradient as NotDifferentiable # line: 1687 +from tensorflow.python.framework.ops import Operation # line: 1032 +from tensorflow.python.framework.ops import RegisterGradient # line: 1638 +from tensorflow.python.framework.ops import add_to_collection # line: 5307 +from tensorflow.python.framework.ops import add_to_collections # line: 5327 +from tensorflow.python.framework.ops import _colocate_with as colocate_with # line: 4420 +from tensorflow.python.framework.ops import container # line: 4377 +from tensorflow.python.framework.ops import control_dependencies # line: 4425 +from tensorflow.python.framework.ops import device # line: 4302 +from tensorflow.python.framework.ops import disable_eager_execution # line: 4863 +from tensorflow.python.framework.ops import enable_eager_execution # line: 4785 +from tensorflow.python.framework.ops import executing_eagerly_outside_functions # line: 4731 +from tensorflow.python.framework.ops import get_collection # line: 5371 +from tensorflow.python.framework.ops import get_collection_ref # line: 5347 +from tensorflow.python.framework.ops import get_default_graph # line: 5010 +from tensorflow.python.framework.ops import init_scope # line: 4626 +from tensorflow.python.framework.ops import is_symbolic_tensor # line: 6076 +from tensorflow.python.framework.ops import name_scope_v1 as name_scope # line: 5525 +from tensorflow.python.framework.ops import no_gradient # line: 1687 +from tensorflow.python.framework.ops import op_scope # line: 5761 +from tensorflow.python.framework.ops import reset_default_graph # line: 4980 +from tensorflow.python.framework.random_seed import get_seed # line: 38 +from tensorflow.python.framework.random_seed import set_random_seed # line: 96 +from tensorflow.python.framework.sparse_tensor import SparseTensor # line: 47 +from tensorflow.python.framework.sparse_tensor import SparseTensorSpec # line: 377 +from tensorflow.python.framework.sparse_tensor import SparseTensorValue # line: 373 +from tensorflow.python.framework.sparse_tensor import convert_to_tensor_or_sparse_tensor # line: 534 +from tensorflow.python.framework.stack import get_default_session # line: 118 +from tensorflow.python.framework.tensor import Tensor # line: 139 +from tensorflow.python.framework.tensor import TensorSpec # line: 918 +from tensorflow.python.framework.tensor import disable_tensor_equality # line: 784 +from tensorflow.python.framework.tensor import enable_tensor_equality # line: 770 +from tensorflow.python.framework.tensor_conversion import convert_to_tensor_v1_with_dispatch as convert_to_tensor # line: 33 +from tensorflow.python.framework.tensor_conversion_registry import register_tensor_conversion_function # line: 80 +from tensorflow.python.framework.tensor_shape import Dimension # line: 188 +from tensorflow.python.framework.tensor_shape import TensorShape # line: 747 +from tensorflow.python.framework.tensor_shape import dimension_at_index # line: 139 +from tensorflow.python.framework.tensor_shape import dimension_value # line: 103 +from tensorflow.python.framework.tensor_shape import disable_v2_tensorshape # line: 91 +from tensorflow.python.framework.tensor_shape import enable_v2_tensorshape # line: 38 +from tensorflow.python.framework.tensor_util import constant_value as get_static_value # line: 896 +from tensorflow.python.framework.tensor_util import is_tf_type as is_tensor # line: 1128 +from tensorflow.python.framework.tensor_util import MakeNdarray as make_ndarray # line: 633 +from tensorflow.python.framework.tensor_util import make_tensor_proto # line: 425 +from tensorflow.python.framework.type_spec import TypeSpec # line: 50 +from tensorflow.python.framework.type_spec import type_spec_from_value # line: 959 +from tensorflow.python.framework.versions import COMPILER_VERSION # line: 41 +from tensorflow.python.framework.versions import CXX11_ABI_FLAG # line: 48 +from tensorflow.python.framework.versions import CXX_VERSION # line: 54 +from tensorflow.python.framework.versions import GIT_VERSION # line: 35 +from tensorflow.python.framework.versions import GRAPH_DEF_VERSION # line: 68 +from tensorflow.python.framework.versions import GRAPH_DEF_VERSION_MIN_CONSUMER # line: 74 +from tensorflow.python.framework.versions import GRAPH_DEF_VERSION_MIN_PRODUCER # line: 82 +from tensorflow.python.framework.versions import MONOLITHIC_BUILD # line: 60 +from tensorflow.python.framework.versions import VERSION # line: 29 +from tensorflow.python.framework.versions import COMPILER_VERSION as __compiler_version__ # line: 41 +from tensorflow.python.framework.versions import CXX11_ABI_FLAG as __cxx11_abi_flag__ # line: 48 +from tensorflow.python.framework.versions import CXX_VERSION as __cxx_version__ # line: 54 +from tensorflow.python.framework.versions import GIT_VERSION as __git_version__ # line: 35 +from tensorflow.python.framework.versions import MONOLITHIC_BUILD as __monolithic_build__ # line: 60 +from tensorflow.python.framework.versions import VERSION as __version__ # line: 29 +from tensorflow.python.module.module import Module # line: 29 +from tensorflow.python.ops.array_ops import batch_gather # line: 5263 +from tensorflow.python.ops.array_ops import batch_to_space # line: 4078 +from tensorflow.python.ops.array_ops import boolean_mask # line: 1691 +from tensorflow.python.ops.array_ops import broadcast_dynamic_shape # line: 528 +from tensorflow.python.ops.array_ops import broadcast_static_shape # line: 562 +from tensorflow.python.ops.array_ops import concat # line: 1596 +from tensorflow.python.ops.array_ops import depth_to_space # line: 4059 +from tensorflow.python.ops.array_ops import dequantize # line: 6139 +from tensorflow.python.ops.array_ops import tensor_diag_part as diag_part # line: 2634 +from tensorflow.python.ops.array_ops import edit_distance # line: 3770 +from tensorflow.python.ops.array_ops import expand_dims # line: 320 +from tensorflow.python.ops.array_ops import extract_image_patches # line: 6538 +from tensorflow.python.ops.array_ops import fill # line: 206 +from tensorflow.python.ops.array_ops import fingerprint # line: 6587 +from tensorflow.python.ops.array_ops import gather # line: 5027 +from tensorflow.python.ops.array_ops import gather_nd # line: 5402 +from tensorflow.python.ops.array_ops import guarantee_const # line: 6926 +from tensorflow.python.ops.array_ops import identity # line: 255 +from tensorflow.python.ops.array_ops import matrix_diag # line: 2322 +from tensorflow.python.ops.array_ops import matrix_diag_part # line: 2491 +from tensorflow.python.ops.array_ops import matrix_set_diag # line: 2679 +from tensorflow.python.ops.array_ops import matrix_transpose # line: 2242 +from tensorflow.python.ops.array_ops import meshgrid # line: 3624 +from tensorflow.python.ops.array_ops import newaxis # line: 58 +from tensorflow.python.ops.array_ops import one_hot # line: 4234 +from tensorflow.python.ops.array_ops import ones # line: 3163 +from tensorflow.python.ops.array_ops import ones_like # line: 3061 +from tensorflow.python.ops.array_ops import pad # line: 3502 +from tensorflow.python.ops.array_ops import parallel_stack # line: 1414 +from tensorflow.python.ops.array_ops import placeholder # line: 3222 +from tensorflow.python.ops.array_ops import placeholder_with_default # line: 3277 +from tensorflow.python.ops.array_ops import quantize # line: 6100 +from tensorflow.python.ops.array_ops import quantize_v2 # line: 6046 +from tensorflow.python.ops.array_ops import rank # line: 879 +from tensorflow.python.ops.array_ops import repeat # line: 6872 +from tensorflow.python.ops.array_ops import required_space_to_batch_paddings # line: 3928 +from tensorflow.python.ops.array_ops import reshape # line: 65 +from tensorflow.python.ops.array_ops import reverse_sequence # line: 4904 +from tensorflow.python.ops.array_ops import searchsorted # line: 6330 +from tensorflow.python.ops.array_ops import sequence_mask # line: 4412 +from tensorflow.python.ops.array_ops import setdiff1d # line: 484 +from tensorflow.python.ops.array_ops import shape # line: 659 +from tensorflow.python.ops.array_ops import shape_n # line: 732 +from tensorflow.python.ops.array_ops import size # line: 802 +from tensorflow.python.ops.array_ops import slice # line: 1171 +from tensorflow.python.ops.array_ops import space_to_batch # line: 4007 +from tensorflow.python.ops.array_ops import space_to_depth # line: 4040 +from tensorflow.python.ops.array_ops import sparse_mask # line: 1845 +from tensorflow.python.ops.array_ops import sparse_placeholder # line: 3329 +from tensorflow.python.ops.array_ops import split # line: 1990 +from tensorflow.python.ops.array_ops import squeeze # line: 4479 +from tensorflow.python.ops.array_ops import stop_gradient # line: 6945 +from tensorflow.python.ops.array_ops import strided_slice # line: 1227 +from tensorflow.python.ops.array_ops import tensor_scatter_nd_update # line: 5757 +from tensorflow.python.ops.array_ops import tensor_scatter_nd_update as tensor_scatter_update # line: 5757 +from tensorflow.python.ops.array_ops import transpose # line: 2153 +from tensorflow.python.ops.array_ops import unique # line: 1889 +from tensorflow.python.ops.array_ops import unique_with_counts # line: 1937 +from tensorflow.python.ops.array_ops import where # line: 4610 +from tensorflow.python.ops.array_ops import where_v2 # line: 4691 +from tensorflow.python.ops.array_ops import zeros # line: 2845 +from tensorflow.python.ops.array_ops import zeros_like # line: 2907 +from tensorflow.python.ops.array_ops_stack import stack # line: 24 +from tensorflow.python.ops.array_ops_stack import unstack # line: 88 +from tensorflow.python.ops.batch_ops import batch_function as nondifferentiable_batch_function # line: 28 +from tensorflow.python.ops.bincount_ops import bincount_v1 as bincount # line: 190 +from tensorflow.python.ops.check_ops import assert_equal # line: 770 +from tensorflow.python.ops.check_ops import assert_greater # line: 987 +from tensorflow.python.ops.check_ops import assert_greater_equal # line: 1005 +from tensorflow.python.ops.check_ops import assert_integer # line: 1448 +from tensorflow.python.ops.check_ops import assert_less # line: 950 +from tensorflow.python.ops.check_ops import assert_less_equal # line: 968 +from tensorflow.python.ops.check_ops import assert_near # line: 858 +from tensorflow.python.ops.check_ops import assert_negative # line: 576 +from tensorflow.python.ops.check_ops import assert_non_negative # line: 685 +from tensorflow.python.ops.check_ops import assert_non_positive # line: 741 +from tensorflow.python.ops.check_ops import assert_none_equal # line: 792 +from tensorflow.python.ops.check_ops import assert_positive # line: 630 +from tensorflow.python.ops.check_ops import assert_proper_iterable # line: 511 +from tensorflow.python.ops.check_ops import assert_rank # line: 1098 +from tensorflow.python.ops.check_ops import assert_rank_at_least # line: 1196 +from tensorflow.python.ops.check_ops import assert_rank_in # line: 1362 +from tensorflow.python.ops.check_ops import assert_same_float_dtype # line: 2118 +from tensorflow.python.ops.check_ops import assert_scalar # line: 2176 +from tensorflow.python.ops.check_ops import assert_type # line: 1522 +from tensorflow.python.ops.check_ops import ensure_shape # line: 2218 +from tensorflow.python.ops.check_ops import is_non_decreasing # line: 1986 +from tensorflow.python.ops.check_ops import is_numeric_tensor # line: 1951 +from tensorflow.python.ops.check_ops import is_strictly_increasing # line: 2028 +from tensorflow.python.ops.clip_ops import clip_by_average_norm # line: 390 +from tensorflow.python.ops.clip_ops import clip_by_global_norm # line: 288 +from tensorflow.python.ops.clip_ops import clip_by_norm # line: 150 +from tensorflow.python.ops.clip_ops import clip_by_value # line: 32 +from tensorflow.python.ops.clip_ops import global_norm # line: 235 +from tensorflow.python.ops.cond import cond # line: 39 +from tensorflow.python.ops.confusion_matrix import confusion_matrix_v1 as confusion_matrix # line: 199 +from tensorflow.python.ops.control_flow_assert import Assert # line: 62 +from tensorflow.python.ops.control_flow_case import case # line: 138 +from tensorflow.python.ops.control_flow_ops import group # line: 1958 +from tensorflow.python.ops.control_flow_ops import tuple # line: 2106 +from tensorflow.python.ops.control_flow_switch_case import switch_case # line: 181 +from tensorflow.python.ops.control_flow_v2_toggles import control_flow_v2_enabled # line: 64 +from tensorflow.python.ops.control_flow_v2_toggles import disable_control_flow_v2 # line: 48 +from tensorflow.python.ops.control_flow_v2_toggles import enable_control_flow_v2 # line: 25 +from tensorflow.python.ops.critical_section_ops import CriticalSection # line: 121 +from tensorflow.python.ops.custom_gradient import custom_gradient # line: 45 +from tensorflow.python.ops.custom_gradient import grad_pass_through # line: 777 +from tensorflow.python.ops.custom_gradient import recompute_grad # line: 604 +from tensorflow.python.ops.data_flow_ops import ConditionalAccumulator # line: 1321 +from tensorflow.python.ops.data_flow_ops import ConditionalAccumulatorBase # line: 1241 +from tensorflow.python.ops.data_flow_ops import FIFOQueue # line: 712 +from tensorflow.python.ops.data_flow_ops import PaddingFIFOQueue # line: 848 +from tensorflow.python.ops.data_flow_ops import PriorityQueue # line: 924 +from tensorflow.python.ops.data_flow_ops import QueueBase # line: 115 +from tensorflow.python.ops.data_flow_ops import RandomShuffleQueue # line: 622 +from tensorflow.python.ops.data_flow_ops import SparseConditionalAccumulator # line: 1412 +from tensorflow.python.ops.functional_ops import foldl # line: 42 +from tensorflow.python.ops.functional_ops import foldr # line: 238 +from tensorflow.python.ops.functional_ops import scan # line: 435 +from tensorflow.python.ops.gradients_impl import gradients # line: 51 +from tensorflow.python.ops.gradients_impl import hessians # line: 384 +from tensorflow.python.ops.gradients_util import AggregationMethod # line: 943 +from tensorflow.python.ops.histogram_ops import histogram_fixed_width # line: 103 +from tensorflow.python.ops.histogram_ops import histogram_fixed_width_bins # line: 31 +from tensorflow.python.ops.init_ops import Constant as constant_initializer # line: 219 +from tensorflow.python.ops.init_ops import GlorotNormal as glorot_normal_initializer # line: 1627 +from tensorflow.python.ops.init_ops import GlorotUniform as glorot_uniform_initializer # line: 1595 +from tensorflow.python.ops.init_ops import Ones as ones_initializer # line: 182 +from tensorflow.python.ops.init_ops import Orthogonal as orthogonal_initializer # line: 895 +from tensorflow.python.ops.init_ops import RandomNormal as random_normal_initializer # line: 487 +from tensorflow.python.ops.init_ops import RandomUniform as random_uniform_initializer # line: 397 +from tensorflow.python.ops.init_ops import TruncatedNormal as truncated_normal_initializer # line: 577 +from tensorflow.python.ops.init_ops import UniformUnitScaling as uniform_unit_scaling_initializer # line: 673 +from tensorflow.python.ops.init_ops import VarianceScaling as variance_scaling_initializer # line: 741 +from tensorflow.python.ops.init_ops import Zeros as zeros_initializer # line: 97 +from tensorflow.python.ops.io_ops import FixedLengthRecordReader # line: 495 +from tensorflow.python.ops.io_ops import IdentityReader # line: 605 +from tensorflow.python.ops.io_ops import LMDBReader # line: 575 +from tensorflow.python.ops.io_ops import ReaderBase # line: 217 +from tensorflow.python.ops.io_ops import TFRecordReader # line: 541 +from tensorflow.python.ops.io_ops import TextLineReader # line: 462 +from tensorflow.python.ops.io_ops import WholeFileReader # line: 431 +from tensorflow.python.ops.io_ops import read_file # line: 97 +from tensorflow.python.ops.io_ops import serialize_tensor # line: 137 +from tensorflow.python.ops.linalg_ops import cholesky_solve # line: 147 +from tensorflow.python.ops.linalg_ops import eye # line: 196 +from tensorflow.python.ops.linalg_ops import matrix_solve_ls # line: 244 +from tensorflow.python.ops.linalg_ops import matrix_triangular_solve # line: 84 +from tensorflow.python.ops.linalg_ops import norm # line: 633 +from tensorflow.python.ops.linalg_ops import self_adjoint_eig # line: 441 +from tensorflow.python.ops.linalg_ops import self_adjoint_eigvals # line: 465 +from tensorflow.python.ops.linalg_ops import svd # line: 489 +from tensorflow.python.ops.logging_ops import Print # line: 75 +from tensorflow.python.ops.logging_ops import print_v2 as print # line: 147 +from tensorflow.python.ops.lookup_ops import initialize_all_tables # line: 50 +from tensorflow.python.ops.lookup_ops import tables_initializer # line: 65 +from tensorflow.python.ops.manip_ops import roll # line: 27 +from tensorflow.python.ops.map_fn import map_fn # line: 41 +from tensorflow.python.ops.math_ops import abs # line: 365 +from tensorflow.python.ops.math_ops import accumulate_n # line: 4161 +from tensorflow.python.ops.math_ops import acos # line: 5747 +from tensorflow.python.ops.math_ops import add # line: 4020 +from tensorflow.python.ops.math_ops import add_n # line: 4101 +from tensorflow.python.ops.math_ops import angle # line: 869 +from tensorflow.python.ops.math_ops import arg_max # line: 232 +from tensorflow.python.ops.math_ops import arg_min # line: 233 +from tensorflow.python.ops.math_ops import argmax # line: 251 +from tensorflow.python.ops.math_ops import argmin # line: 305 +from tensorflow.python.ops.math_ops import cast # line: 944 +from tensorflow.python.ops.math_ops import ceil # line: 5577 +from tensorflow.python.ops.math_ops import complex # line: 699 +from tensorflow.python.ops.math_ops import conj # line: 4534 +from tensorflow.python.ops.math_ops import count_nonzero # line: 2492 +from tensorflow.python.ops.math_ops import cumprod # line: 4424 +from tensorflow.python.ops.math_ops import cumsum # line: 4352 +from tensorflow.python.ops.math_ops import div # line: 1664 +from tensorflow.python.ops.math_ops import div_no_nan # line: 1696 +from tensorflow.python.ops.math_ops import divide # line: 446 +from tensorflow.python.ops.math_ops import equal # line: 2003 +from tensorflow.python.ops.math_ops import exp # line: 5644 +from tensorflow.python.ops.math_ops import floor # line: 5778 +from tensorflow.python.ops.math_ops import floordiv # line: 1804 +from tensorflow.python.ops.math_ops import imag # line: 835 +from tensorflow.python.ops.math_ops import linspace_nd as lin_space # line: 112 +from tensorflow.python.ops.math_ops import linspace_nd as linspace # line: 112 +from tensorflow.python.ops.math_ops import log_sigmoid # line: 4307 +from tensorflow.python.ops.math_ops import logical_xor # line: 1904 +from tensorflow.python.ops.math_ops import matmul # line: 3617 +from tensorflow.python.ops.math_ops import multiply # line: 481 +from tensorflow.python.ops.math_ops import not_equal # line: 2040 +from tensorflow.python.ops.math_ops import pow # line: 669 +from tensorflow.python.ops.math_ops import range # line: 2163 +from tensorflow.python.ops.math_ops import real # line: 794 +from tensorflow.python.ops.math_ops import reduce_all_v1 as reduce_all # line: 3248 +from tensorflow.python.ops.math_ops import reduce_any_v1 as reduce_any # line: 3354 +from tensorflow.python.ops.math_ops import reduce_logsumexp_v1 as reduce_logsumexp # line: 3460 +from tensorflow.python.ops.math_ops import reduce_max_v1 as reduce_max # line: 3123 +from tensorflow.python.ops.math_ops import reduce_mean_v1 as reduce_mean # line: 2646 +from tensorflow.python.ops.math_ops import reduce_min_v1 as reduce_min # line: 2995 +from tensorflow.python.ops.math_ops import reduce_prod_v1 as reduce_prod # line: 2936 +from tensorflow.python.ops.math_ops import reduce_sum_v1 as reduce_sum # line: 2289 +from tensorflow.python.ops.math_ops import round # line: 914 +from tensorflow.python.ops.math_ops import rsqrt # line: 5722 +from tensorflow.python.ops.math_ops import saturate_cast # line: 1028 +from tensorflow.python.ops.math_ops import scalar_mul # line: 592 +from tensorflow.python.ops.math_ops import sigmoid # line: 4254 +from tensorflow.python.ops.math_ops import sign # line: 747 +from tensorflow.python.ops.math_ops import sparse_matmul # line: 3957 +from tensorflow.python.ops.math_ops import sparse_segment_mean # line: 4942 +from tensorflow.python.ops.math_ops import sparse_segment_sqrt_n # line: 5054 +from tensorflow.python.ops.math_ops import sparse_segment_sum # line: 4770 +from tensorflow.python.ops.math_ops import sqrt # line: 5605 +from tensorflow.python.ops.math_ops import subtract # line: 545 +from tensorflow.python.ops.math_ops import tensordot # line: 5152 +from tensorflow.python.ops.math_ops import to_bfloat16 # line: 1271 +from tensorflow.python.ops.math_ops import to_complex128 # line: 1351 +from tensorflow.python.ops.math_ops import to_complex64 # line: 1311 +from tensorflow.python.ops.math_ops import to_double # line: 1151 +from tensorflow.python.ops.math_ops import to_float # line: 1111 +from tensorflow.python.ops.math_ops import to_int32 # line: 1191 +from tensorflow.python.ops.math_ops import to_int64 # line: 1231 +from tensorflow.python.ops.math_ops import trace # line: 3573 +from tensorflow.python.ops.math_ops import truediv # line: 1630 +from tensorflow.python.ops.math_ops import unsorted_segment_mean # line: 4657 +from tensorflow.python.ops.math_ops import unsorted_segment_sqrt_n # line: 4712 +from tensorflow.python.ops.numerics import add_check_numerics_ops # line: 81 +from tensorflow.python.ops.numerics import verify_tensor_all_finite # line: 28 +from tensorflow.python.ops.parallel_for.control_flow_ops import vectorized_map # line: 452 +from tensorflow.python.ops.parsing_config import FixedLenFeature # line: 298 +from tensorflow.python.ops.parsing_config import FixedLenSequenceFeature # line: 318 +from tensorflow.python.ops.parsing_config import SparseFeature # line: 223 +from tensorflow.python.ops.parsing_config import VarLenFeature # line: 44 +from tensorflow.python.ops.parsing_ops import decode_csv # line: 1023 +from tensorflow.python.ops.parsing_ops import decode_json_example # line: 1152 +from tensorflow.python.ops.parsing_ops import decode_raw_v1 as decode_raw # line: 978 +from tensorflow.python.ops.parsing_ops import parse_example # line: 315 +from tensorflow.python.ops.parsing_ops import parse_single_example # line: 375 +from tensorflow.python.ops.parsing_ops import parse_single_sequence_example # line: 696 +from tensorflow.python.ops.partitioned_variables import create_partitioned_variables # line: 275 +from tensorflow.python.ops.partitioned_variables import fixed_size_partitioner # line: 220 +from tensorflow.python.ops.partitioned_variables import min_max_variable_partitioner # line: 155 +from tensorflow.python.ops.partitioned_variables import variable_axis_size_partitioner # line: 67 +from tensorflow.python.ops.ragged.ragged_string_ops import string_split # line: 528 +from tensorflow.python.ops.ragged.ragged_tensor import RaggedTensor # line: 65 +from tensorflow.python.ops.ragged.ragged_tensor import RaggedTensorSpec # line: 2319 +from tensorflow.python.ops.random_crop_ops import random_crop # line: 30 +from tensorflow.python.ops.random_ops import multinomial # line: 362 +from tensorflow.python.ops.random_ops import random_gamma # line: 451 +from tensorflow.python.ops.random_ops import random_normal # line: 39 +from tensorflow.python.ops.random_ops import random_poisson # line: 545 +from tensorflow.python.ops.random_ops import random_shuffle # line: 326 +from tensorflow.python.ops.random_ops import random_uniform # line: 211 +from tensorflow.python.ops.random_ops import truncated_normal # line: 155 +from tensorflow.python.ops.script_ops import numpy_function # line: 804 +from tensorflow.python.ops.script_ops import py_func # line: 795 +from tensorflow.python.ops.script_ops import eager_py_func as py_function # line: 461 +from tensorflow.python.ops.session_ops import delete_session_tensor # line: 219 +from tensorflow.python.ops.session_ops import get_session_handle # line: 135 +from tensorflow.python.ops.session_ops import get_session_tensor # line: 178 +from tensorflow.python.ops.sort_ops import argsort # line: 86 +from tensorflow.python.ops.sort_ops import sort # line: 29 +from tensorflow.python.ops.sparse_ops import deserialize_many_sparse # line: 2356 +from tensorflow.python.ops.sparse_ops import serialize_many_sparse # line: 2224 +from tensorflow.python.ops.sparse_ops import serialize_sparse # line: 2176 +from tensorflow.python.ops.sparse_ops import sparse_add # line: 460 +from tensorflow.python.ops.sparse_ops import sparse_concat # line: 284 +from tensorflow.python.ops.sparse_ops import sparse_fill_empty_rows # line: 2109 +from tensorflow.python.ops.sparse_ops import sparse_maximum # line: 2734 +from tensorflow.python.ops.sparse_ops import sparse_merge # line: 1802 +from tensorflow.python.ops.sparse_ops import sparse_minimum # line: 2780 +from tensorflow.python.ops.sparse_ops import sparse_reduce_max # line: 1341 +from tensorflow.python.ops.sparse_ops import sparse_reduce_max_sparse # line: 1427 +from tensorflow.python.ops.sparse_ops import sparse_reduce_sum # line: 1559 +from tensorflow.python.ops.sparse_ops import sparse_reduce_sum_sparse # line: 1628 +from tensorflow.python.ops.sparse_ops import sparse_reorder # line: 821 +from tensorflow.python.ops.sparse_ops import sparse_reset_shape # line: 2004 +from tensorflow.python.ops.sparse_ops import sparse_reshape # line: 876 +from tensorflow.python.ops.sparse_ops import sparse_retain # line: 1957 +from tensorflow.python.ops.sparse_ops import sparse_slice # line: 1136 +from tensorflow.python.ops.sparse_ops import sparse_softmax # line: 2671 +from tensorflow.python.ops.sparse_ops import sparse_split # line: 991 +from tensorflow.python.ops.sparse_ops import sparse_tensor_dense_matmul # line: 2430 +from tensorflow.python.ops.sparse_ops import sparse_tensor_to_dense # line: 1681 +from tensorflow.python.ops.sparse_ops import sparse_to_dense # line: 1186 +from tensorflow.python.ops.sparse_ops import sparse_to_indicator # line: 1737 +from tensorflow.python.ops.sparse_ops import sparse_transpose # line: 2824 +from tensorflow.python.ops.special_math_ops import einsum # line: 618 +from tensorflow.python.ops.special_math_ops import lbeta # line: 45 +from tensorflow.python.ops.state_ops import assign # line: 277 +from tensorflow.python.ops.state_ops import assign_add # line: 205 +from tensorflow.python.ops.state_ops import assign_sub # line: 133 +from tensorflow.python.ops.state_ops import batch_scatter_update # line: 946 +from tensorflow.python.ops.state_ops import count_up_to # line: 359 +from tensorflow.python.ops.state_ops import scatter_add # line: 499 +from tensorflow.python.ops.state_ops import scatter_div # line: 784 +from tensorflow.python.ops.state_ops import scatter_max # line: 836 +from tensorflow.python.ops.state_ops import scatter_min # line: 891 +from tensorflow.python.ops.state_ops import scatter_mul # line: 732 +from tensorflow.python.ops.state_ops import scatter_nd_add # line: 551 +from tensorflow.python.ops.state_ops import scatter_nd_sub # line: 668 +from tensorflow.python.ops.state_ops import scatter_nd_update # line: 437 +from tensorflow.python.ops.state_ops import scatter_sub # line: 614 +from tensorflow.python.ops.state_ops import scatter_update # line: 383 +from tensorflow.python.ops.string_ops import reduce_join # line: 305 +from tensorflow.python.ops.string_ops import regex_replace # line: 74 +from tensorflow.python.ops.string_ops import string_join # line: 551 +from tensorflow.python.ops.string_ops import string_to_hash_bucket_v1 as string_to_hash_bucket # line: 536 +from tensorflow.python.ops.string_ops import string_to_number_v1 as string_to_number # line: 491 +from tensorflow.python.ops.string_ops import substr_deprecated as substr # line: 422 +from tensorflow.python.ops.template import make_template # line: 33 +from tensorflow.python.ops.tensor_array_ops import TensorArray # line: 971 +from tensorflow.python.ops.tensor_array_ops import TensorArraySpec # line: 1363 +from tensorflow.python.ops.unconnected_gradients import UnconnectedGradients # line: 22 +from tensorflow.python.ops.variable_scope import AUTO_REUSE # line: 200 +from tensorflow.python.ops.variable_scope import VariableScope # line: 1123 +from tensorflow.python.ops.variable_scope import disable_resource_variables # line: 269 +from tensorflow.python.ops.variable_scope import enable_resource_variables # line: 225 +from tensorflow.python.ops.variable_scope import get_local_variable # line: 1790 +from tensorflow.python.ops.variable_scope import get_variable # line: 1614 +from tensorflow.python.ops.variable_scope import get_variable_scope # line: 1480 +from tensorflow.python.ops.variable_scope import no_regularizer # line: 1116 +from tensorflow.python.ops.variable_scope import resource_variables_enabled # line: 247 +from tensorflow.python.ops.variable_scope import variable_creator_scope_v1 as variable_creator_scope # line: 2708 +from tensorflow.python.ops.variable_scope import variable_op_scope # line: 2596 +from tensorflow.python.ops.variable_scope import variable_scope # line: 2156 +from tensorflow.python.ops.variable_v1 import VariableV1 as Variable # line: 55 +from tensorflow.python.ops.variable_v1 import is_variable_initialized # line: 35 +from tensorflow.python.ops.variables import VariableAggregation # line: 139 +from tensorflow.python.ops.variables import VariableSynchronization # line: 61 +from tensorflow.python.ops.variables import all_variables # line: 1735 +from tensorflow.python.ops.variables import assert_variables_initialized # line: 1950 +from tensorflow.python.ops.variables import global_variables # line: 1700 +from tensorflow.python.ops.variables import global_variables_initializer # line: 1896 +from tensorflow.python.ops.variables import initialize_all_variables # line: 1915 +from tensorflow.python.ops.variables import initialize_local_variables # line: 1942 +from tensorflow.python.ops.variables import initialize_variables # line: 1888 +from tensorflow.python.ops.variables import local_variables # line: 1760 +from tensorflow.python.ops.variables import local_variables_initializer # line: 1923 +from tensorflow.python.ops.variables import model_variables # line: 1788 +from tensorflow.python.ops.variables import moving_average_variables # line: 1835 +from tensorflow.python.ops.variables import report_uninitialized_variables # line: 1993 +from tensorflow.python.ops.variables import trainable_variables # line: 1805 +from tensorflow.python.ops.variables import variables_initializer # line: 1857 +from tensorflow.python.ops.while_loop import while_loop # line: 255 +from tensorflow.python.platform.tf_logging import get_logger # line: 93 +from tensorflow.python.proto_exports import AttrValue # line: 26 +from tensorflow.python.proto_exports import ConfigProto # line: 27 +from tensorflow.python.proto_exports import Event # line: 28 +from tensorflow.python.proto_exports import GPUOptions # line: 29 +from tensorflow.python.proto_exports import GraphOptions # line: 30 +from tensorflow.python.proto_exports import HistogramProto # line: 31 +from tensorflow.python.proto_exports import LogMessage # line: 34 +from tensorflow.python.proto_exports import MetaGraphDef # line: 35 +from tensorflow.python.proto_exports import NameAttrList # line: 38 +from tensorflow.python.proto_exports import NodeDef # line: 41 +from tensorflow.python.proto_exports import OptimizerOptions # line: 42 +from tensorflow.python.proto_exports import RunMetadata # line: 45 +from tensorflow.python.proto_exports import RunOptions # line: 46 +from tensorflow.python.proto_exports import SessionLog # line: 47 +from tensorflow.python.proto_exports import Summary # line: 50 +from tensorflow.python.proto_exports import SummaryMetadata # line: 56 +from tensorflow.python.proto_exports import TensorInfo # line: 62 + + + +from tensorflow.python.util import module_wrapper as _module_wrapper + +if not isinstance(_sys.modules[__name__], _module_wrapper.TFModuleWrapper): + _sys.modules[__name__] = _module_wrapper.TFModuleWrapper( + _sys.modules[__name__], "", public_apis=None, deprecation=False, + has_lite=False) + + +# Hook external TensorFlow modules. +_current_module = _sys.modules[__name__] + +# Lazy-load estimator. +_estimator_module = "tensorflow_estimator.python.estimator.api._v1.estimator" +estimator = _LazyLoader("estimator", globals(), _estimator_module) +_module_dir = _module_util.get_parent_dir_for_name(_estimator_module) +if _module_dir: + _current_module.__path__ = [_module_dir] + _current_module.__path__ +setattr(_current_module, "estimator", estimator) + +# Lazy load Keras v1 +_tf_uses_legacy_keras = ( + _os.environ.get("TF_USE_LEGACY_KERAS", None) in ("true", "True", "1")) +setattr(_current_module, "keras", _KerasLazyLoader(globals(), mode="v1")) +if _tf_uses_legacy_keras: + _module_dir = _module_util.get_parent_dir_for_name("tf_keras.api._v1.keras") +else: + _module_dir = _module_util.get_parent_dir_for_name("keras.api._v1.keras") +_current_module.__path__ = [_module_dir] + _current_module.__path__ + + +from tensorflow.python.platform import flags # pylint: disable=g-import-not-at-top +_current_module.app.flags = flags # pylint: disable=undefined-variable +setattr(_current_module, "flags", flags) + +# Add module aliases from Keras to TF. +# Some tf endpoints actually lives under Keras. +_current_module.layers = _KerasLazyLoader( + globals(), + submodule="__internal__.legacy.layers", + name="layers", + mode="v1") +if _tf_uses_legacy_keras: + _module_dir = _module_util.get_parent_dir_for_name( + "tf_keras.api._v1.keras.__internal__.legacy.layers") +else: + _module_dir = _module_util.get_parent_dir_for_name( + "keras.api._v1.keras.__internal__.legacy.layers") +_current_module.__path__ = [_module_dir] + _current_module.__path__ + +_current_module.nn.rnn_cell = _KerasLazyLoader( + globals(), + submodule="__internal__.legacy.rnn_cell", + name="rnn_cell", + mode="v1") +if _tf_uses_legacy_keras: + _module_dir = _module_util.get_parent_dir_for_name( + "tf_keras.api._v1.keras.__internal__.legacy.rnn_cell") +else: + _module_dir = _module_util.get_parent_dir_for_name( + "keras.api._v1.keras.__internal__.legacy.rnn_cell") +_current_module.nn.__path__ = [_module_dir] + _current_module.nn.__path__ + +# Explicitly import lazy-loaded modules to support autocompletion. +# pylint: disable=g-import-not-at-top +if _typing.TYPE_CHECKING: + from tensorflow_estimator.python.estimator.api._v1 import estimator as estimator +# pylint: enable=g-import-not-at-top diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/compat/v1/compat/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/compat/v1/compat/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ed5f0941c4614fb67675f4e7384972b2598ab260 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/compat/v1/compat/__init__.py @@ -0,0 +1,29 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.compat namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v1.compat import v1 +from tensorflow._api.v2.compat.v1.compat import v2 +from tensorflow.python.compat.compat import forward_compatibility_horizon # line: 125 +from tensorflow.python.compat.compat import forward_compatible # line: 65 +from tensorflow.python.framework.tensor_shape import dimension_at_index # line: 139 +from tensorflow.python.framework.tensor_shape import dimension_value # line: 103 +from tensorflow.python.util.compat import as_bytes # line: 121 +from tensorflow.python.util.compat import as_str # line: 122 +from tensorflow.python.util.compat import as_str_any # line: 125 +from tensorflow.python.util.compat import as_text # line: 120 +from tensorflow.python.util.compat import bytes_or_text_types # line: 216 +from tensorflow.python.util.compat import complex_types # line: 212 +from tensorflow.python.util.compat import integral_types # line: 208 +from tensorflow.python.util.compat import path_to_str # line: 145 +from tensorflow.python.util.compat import real_types # line: 210 + +from tensorflow.python.util import module_wrapper as _module_wrapper + +if not isinstance(_sys.modules[__name__], _module_wrapper.TFModuleWrapper): + _sys.modules[__name__] = _module_wrapper.TFModuleWrapper( + _sys.modules[__name__], "compat", public_apis=None, deprecation=False, + has_lite=False) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/compat/v2/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/compat/v2/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e5cf8171806130577957146915fe7f96847d8137 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/compat/v2/__init__.py @@ -0,0 +1,396 @@ +# 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. +# ============================================================================== +"""Bring in all of the public TensorFlow interface into this module.""" + +# pylint: disable=g-bad-import-order,g-import-not-at-top,protected-access + +import logging as _logging +import os as _os +import sys as _sys +import typing as _typing + +from tensorflow.python.tools import module_util as _module_util +from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader +from tensorflow.python.util.lazy_loader import KerasLazyLoader as _KerasLazyLoader + +from tensorflow._api.v2.compat.v2 import __internal__ +from tensorflow._api.v2.compat.v2 import __operators__ +from tensorflow._api.v2.compat.v2 import audio +from tensorflow._api.v2.compat.v2 import autodiff +from tensorflow._api.v2.compat.v2 import autograph +from tensorflow._api.v2.compat.v2 import bitwise +from tensorflow._api.v2.compat.v2 import compat +from tensorflow._api.v2.compat.v2 import config +from tensorflow._api.v2.compat.v2 import data +from tensorflow._api.v2.compat.v2 import debugging +from tensorflow._api.v2.compat.v2 import distribute +from tensorflow._api.v2.compat.v2 import dtypes +from tensorflow._api.v2.compat.v2 import errors +from tensorflow._api.v2.compat.v2 import experimental +from tensorflow._api.v2.compat.v2 import feature_column +from tensorflow._api.v2.compat.v2 import graph_util +from tensorflow._api.v2.compat.v2 import image +from tensorflow._api.v2.compat.v2 import io +from tensorflow._api.v2.compat.v2 import linalg +from tensorflow._api.v2.compat.v2 import lite +from tensorflow._api.v2.compat.v2 import lookup +from tensorflow._api.v2.compat.v2 import math +from tensorflow._api.v2.compat.v2 import mlir +from tensorflow._api.v2.compat.v2 import nest +from tensorflow._api.v2.compat.v2 import nn +from tensorflow._api.v2.compat.v2 import profiler +from tensorflow._api.v2.compat.v2 import quantization +from tensorflow._api.v2.compat.v2 import queue +from tensorflow._api.v2.compat.v2 import ragged +from tensorflow._api.v2.compat.v2 import random +from tensorflow._api.v2.compat.v2 import raw_ops +from tensorflow._api.v2.compat.v2 import saved_model +from tensorflow._api.v2.compat.v2 import sets +from tensorflow._api.v2.compat.v2 import signal +from tensorflow._api.v2.compat.v2 import sparse +from tensorflow._api.v2.compat.v2 import strings +from tensorflow._api.v2.compat.v2 import summary +from tensorflow._api.v2.compat.v2 import sysconfig +from tensorflow._api.v2.compat.v2 import test +from tensorflow._api.v2.compat.v2 import tpu +from tensorflow._api.v2.compat.v2 import train +from tensorflow._api.v2.compat.v2 import types +from tensorflow._api.v2.compat.v2 import version +from tensorflow._api.v2.compat.v2 import xla +from tensorflow.python.ops.gen_array_ops import bitcast # line: 558 +from tensorflow.python.ops.gen_array_ops import broadcast_to # line: 829 +from tensorflow.python.ops.gen_array_ops import extract_volume_patches # line: 2569 +from tensorflow.python.ops.gen_array_ops import identity_n # line: 4226 +from tensorflow.python.ops.gen_array_ops import reverse_v2 as reverse # line: 9140 +from tensorflow.python.ops.gen_array_ops import scatter_nd # line: 9276 +from tensorflow.python.ops.gen_array_ops import space_to_batch_nd # line: 10076 +from tensorflow.python.ops.gen_array_ops import tensor_scatter_add as tensor_scatter_nd_add # line: 11226 +from tensorflow.python.ops.gen_array_ops import tensor_scatter_max as tensor_scatter_nd_max # line: 11382 +from tensorflow.python.ops.gen_array_ops import tensor_scatter_min as tensor_scatter_nd_min # line: 11488 +from tensorflow.python.ops.gen_array_ops import tensor_scatter_sub as tensor_scatter_nd_sub # line: 11583 +from tensorflow.python.ops.gen_array_ops import tile # line: 11970 +from tensorflow.python.ops.gen_array_ops import unravel_index # line: 12731 +from tensorflow.python.ops.gen_control_flow_ops import no_op # line: 475 +from tensorflow.python.ops.gen_data_flow_ops import dynamic_partition # line: 594 +from tensorflow.python.ops.gen_data_flow_ops import dynamic_stitch # line: 736 +from tensorflow.python.ops.gen_linalg_ops import matrix_square_root # line: 1913 +from tensorflow.python.ops.gen_logging_ops import timestamp # line: 886 +from tensorflow.python.ops.gen_math_ops import acosh # line: 231 +from tensorflow.python.ops.gen_math_ops import asin # line: 991 +from tensorflow.python.ops.gen_math_ops import asinh # line: 1091 +from tensorflow.python.ops.gen_math_ops import atan # line: 1184 +from tensorflow.python.ops.gen_math_ops import atan2 # line: 1284 +from tensorflow.python.ops.gen_math_ops import atanh # line: 1383 +from tensorflow.python.ops.gen_math_ops import cos # line: 2464 +from tensorflow.python.ops.gen_math_ops import cosh # line: 2558 +from tensorflow.python.ops.gen_math_ops import greater # line: 4186 +from tensorflow.python.ops.gen_math_ops import greater_equal # line: 4287 +from tensorflow.python.ops.gen_math_ops import less # line: 5223 +from tensorflow.python.ops.gen_math_ops import less_equal # line: 5324 +from tensorflow.python.ops.gen_math_ops import logical_and # line: 5779 +from tensorflow.python.ops.gen_math_ops import logical_not # line: 5918 +from tensorflow.python.ops.gen_math_ops import logical_or # line: 6005 +from tensorflow.python.ops.gen_math_ops import maximum # line: 6310 +from tensorflow.python.ops.gen_math_ops import minimum # line: 6566 +from tensorflow.python.ops.gen_math_ops import neg as negative # line: 6913 +from tensorflow.python.ops.gen_math_ops import real_div as realdiv # line: 8068 +from tensorflow.python.ops.gen_math_ops import sin # line: 10299 +from tensorflow.python.ops.gen_math_ops import sinh # line: 10392 +from tensorflow.python.ops.gen_math_ops import square # line: 11962 +from tensorflow.python.ops.gen_math_ops import tan # line: 12352 +from tensorflow.python.ops.gen_math_ops import tanh # line: 12446 +from tensorflow.python.ops.gen_math_ops import truncate_div as truncatediv # line: 12601 +from tensorflow.python.ops.gen_math_ops import truncate_mod as truncatemod # line: 12695 +from tensorflow.python.ops.gen_nn_ops import approx_top_k # line: 33 +from tensorflow.python.ops.gen_nn_ops import conv # line: 1061 +from tensorflow.python.ops.gen_nn_ops import conv2d_backprop_filter_v2 # line: 1609 +from tensorflow.python.ops.gen_nn_ops import conv2d_backprop_input_v2 # line: 1977 +from tensorflow.python.ops.gen_ragged_array_ops import ragged_fill_empty_rows # line: 196 +from tensorflow.python.ops.gen_ragged_array_ops import ragged_fill_empty_rows_grad # line: 305 +from tensorflow.python.ops.gen_random_index_shuffle_ops import random_index_shuffle # line: 30 +from tensorflow.python.ops.gen_spectral_ops import fftnd # line: 620 +from tensorflow.python.ops.gen_spectral_ops import ifftnd # line: 991 +from tensorflow.python.ops.gen_spectral_ops import irfftnd # line: 1347 +from tensorflow.python.ops.gen_spectral_ops import rfftnd # line: 1707 +from tensorflow.python.ops.gen_string_ops import as_string # line: 29 +from tensorflow.python.data.ops.optional_ops import OptionalSpec # line: 205 +from tensorflow.python.eager.backprop import GradientTape # line: 704 +from tensorflow.python.eager.context import executing_eagerly # line: 2293 +from tensorflow.python.eager.polymorphic_function.polymorphic_function import function # line: 1276 +from tensorflow.python.framework.constant_op import constant # line: 172 +from tensorflow.python.framework.device_spec import DeviceSpecV2 as DeviceSpec # line: 46 +from tensorflow.python.framework.dtypes import DType # line: 51 +from tensorflow.python.framework.dtypes import as_dtype # line: 793 +from tensorflow.python.framework.dtypes import bfloat16 # line: 450 +from tensorflow.python.framework.dtypes import bool # line: 414 +from tensorflow.python.framework.dtypes import complex128 # line: 401 +from tensorflow.python.framework.dtypes import complex64 # line: 394 +from tensorflow.python.framework.dtypes import double # line: 388 +from tensorflow.python.framework.dtypes import float16 # line: 373 +from tensorflow.python.framework.dtypes import float32 # line: 380 +from tensorflow.python.framework.dtypes import float64 # line: 386 +from tensorflow.python.framework.dtypes import half # line: 374 +from tensorflow.python.framework.dtypes import int16 # line: 354 +from tensorflow.python.framework.dtypes import int32 # line: 360 +from tensorflow.python.framework.dtypes import int64 # line: 366 +from tensorflow.python.framework.dtypes import int8 # line: 348 +from tensorflow.python.framework.dtypes import qint16 # line: 426 +from tensorflow.python.framework.dtypes import qint32 # line: 432 +from tensorflow.python.framework.dtypes import qint8 # line: 420 +from tensorflow.python.framework.dtypes import quint16 # line: 444 +from tensorflow.python.framework.dtypes import quint8 # line: 438 +from tensorflow.python.framework.dtypes import resource # line: 312 +from tensorflow.python.framework.dtypes import string # line: 408 +from tensorflow.python.framework.dtypes import uint16 # line: 330 +from tensorflow.python.framework.dtypes import uint32 # line: 336 +from tensorflow.python.framework.dtypes import uint64 # line: 342 +from tensorflow.python.framework.dtypes import uint8 # line: 324 +from tensorflow.python.framework.dtypes import variant # line: 318 +from tensorflow.python.framework.importer import import_graph_def # line: 354 +from tensorflow.python.framework.indexed_slices import IndexedSlices # line: 54 +from tensorflow.python.framework.indexed_slices import IndexedSlicesSpec # line: 203 +from tensorflow.python.framework.load_library import load_library # line: 120 +from tensorflow.python.framework.load_library import load_op_library # line: 31 +from tensorflow.python.framework.ops import Graph # line: 1912 +from tensorflow.python.framework.ops import Operation # line: 1032 +from tensorflow.python.framework.ops import RegisterGradient # line: 1638 +from tensorflow.python.framework.ops import control_dependencies # line: 4425 +from tensorflow.python.framework.ops import device_v2 as device # line: 4338 +from tensorflow.python.framework.ops import get_current_name_scope # line: 5576 +from tensorflow.python.framework.ops import init_scope # line: 4626 +from tensorflow.python.framework.ops import inside_function # line: 4764 +from tensorflow.python.framework.ops import is_symbolic_tensor # line: 6076 +from tensorflow.python.framework.ops import name_scope_v2 as name_scope # line: 5611 +from tensorflow.python.framework.ops import no_gradient # line: 1687 +from tensorflow.python.framework.sparse_tensor import SparseTensor # line: 47 +from tensorflow.python.framework.sparse_tensor import SparseTensorSpec # line: 377 +from tensorflow.python.framework.tensor import Tensor # line: 139 +from tensorflow.python.framework.tensor import TensorSpec # line: 918 +from tensorflow.python.framework.tensor_conversion import convert_to_tensor_v2_with_dispatch as convert_to_tensor # line: 96 +from tensorflow.python.framework.tensor_conversion_registry import register_tensor_conversion_function # line: 80 +from tensorflow.python.framework.tensor_shape import TensorShape # line: 747 +from tensorflow.python.framework.tensor_util import constant_value as get_static_value # line: 896 +from tensorflow.python.framework.tensor_util import is_tf_type as is_tensor # line: 1128 +from tensorflow.python.framework.tensor_util import MakeNdarray as make_ndarray # line: 633 +from tensorflow.python.framework.tensor_util import make_tensor_proto # line: 425 +from tensorflow.python.framework.type_spec import TypeSpec # line: 50 +from tensorflow.python.framework.type_spec import type_spec_from_value # line: 959 +from tensorflow.python.framework.versions import COMPILER_VERSION as __compiler_version__ # line: 41 +from tensorflow.python.framework.versions import CXX11_ABI_FLAG as __cxx11_abi_flag__ # line: 48 +from tensorflow.python.framework.versions import CXX_VERSION as __cxx_version__ # line: 54 +from tensorflow.python.framework.versions import GIT_VERSION as __git_version__ # line: 35 +from tensorflow.python.framework.versions import MONOLITHIC_BUILD as __monolithic_build__ # line: 60 +from tensorflow.python.framework.versions import VERSION as __version__ # line: 29 +from tensorflow.python.module.module import Module # line: 29 +from tensorflow.python.ops.array_ops import batch_to_space_v2 as batch_to_space # line: 4096 +from tensorflow.python.ops.array_ops import boolean_mask_v2 as boolean_mask # line: 1785 +from tensorflow.python.ops.array_ops import broadcast_dynamic_shape # line: 528 +from tensorflow.python.ops.array_ops import broadcast_static_shape # line: 562 +from tensorflow.python.ops.array_ops import concat # line: 1596 +from tensorflow.python.ops.array_ops import edit_distance # line: 3770 +from tensorflow.python.ops.array_ops import expand_dims_v2 as expand_dims # line: 393 +from tensorflow.python.ops.array_ops import fill # line: 206 +from tensorflow.python.ops.array_ops import fingerprint # line: 6587 +from tensorflow.python.ops.array_ops import gather_v2 as gather # line: 5243 +from tensorflow.python.ops.array_ops import gather_nd_v2 as gather_nd # line: 5661 +from tensorflow.python.ops.array_ops import guarantee_const # line: 6926 +from tensorflow.python.ops.array_ops import identity # line: 255 +from tensorflow.python.ops.array_ops import meshgrid # line: 3624 +from tensorflow.python.ops.array_ops import newaxis # line: 58 +from tensorflow.python.ops.array_ops import one_hot # line: 4234 +from tensorflow.python.ops.array_ops import ones # line: 3163 +from tensorflow.python.ops.array_ops import ones_like_v2 as ones_like # line: 3095 +from tensorflow.python.ops.array_ops import pad_v2 as pad # line: 3443 +from tensorflow.python.ops.array_ops import parallel_stack # line: 1414 +from tensorflow.python.ops.array_ops import rank # line: 879 +from tensorflow.python.ops.array_ops import repeat # line: 6872 +from tensorflow.python.ops.array_ops import required_space_to_batch_paddings # line: 3928 +from tensorflow.python.ops.array_ops import reshape # line: 65 +from tensorflow.python.ops.array_ops import reverse_sequence_v2 as reverse_sequence # line: 4970 +from tensorflow.python.ops.array_ops import searchsorted # line: 6330 +from tensorflow.python.ops.array_ops import sequence_mask # line: 4412 +from tensorflow.python.ops.array_ops import shape_v2 as shape # line: 598 +from tensorflow.python.ops.array_ops import shape_n # line: 732 +from tensorflow.python.ops.array_ops import size_v2 as size # line: 762 +from tensorflow.python.ops.array_ops import slice # line: 1171 +from tensorflow.python.ops.array_ops import space_to_batch_v2 as space_to_batch # line: 4031 +from tensorflow.python.ops.array_ops import split # line: 1990 +from tensorflow.python.ops.array_ops import squeeze_v2 as squeeze # line: 4534 +from tensorflow.python.ops.array_ops import stop_gradient # line: 6945 +from tensorflow.python.ops.array_ops import strided_slice # line: 1227 +from tensorflow.python.ops.array_ops import tensor_scatter_nd_update # line: 5757 +from tensorflow.python.ops.array_ops import transpose_v2 as transpose # line: 2072 +from tensorflow.python.ops.array_ops import unique # line: 1889 +from tensorflow.python.ops.array_ops import unique_with_counts # line: 1937 +from tensorflow.python.ops.array_ops import where_v2 as where # line: 4691 +from tensorflow.python.ops.array_ops import zeros # line: 2845 +from tensorflow.python.ops.array_ops import zeros_like_v2 as zeros_like # line: 2947 +from tensorflow.python.ops.array_ops_stack import stack # line: 24 +from tensorflow.python.ops.array_ops_stack import unstack # line: 88 +from tensorflow.python.ops.batch_ops import batch_function as nondifferentiable_batch_function # line: 28 +from tensorflow.python.ops.check_ops import assert_equal_v2 as assert_equal # line: 762 +from tensorflow.python.ops.check_ops import assert_greater_v2 as assert_greater # line: 978 +from tensorflow.python.ops.check_ops import assert_less_v2 as assert_less # line: 942 +from tensorflow.python.ops.check_ops import assert_rank_v2 as assert_rank # line: 1064 +from tensorflow.python.ops.check_ops import ensure_shape # line: 2218 +from tensorflow.python.ops.clip_ops import clip_by_global_norm # line: 288 +from tensorflow.python.ops.clip_ops import clip_by_norm # line: 150 +from tensorflow.python.ops.clip_ops import clip_by_value # line: 32 +from tensorflow.python.ops.cond import cond_for_tf_v2 as cond # line: 243 +from tensorflow.python.ops.control_flow_assert import Assert # line: 62 +from tensorflow.python.ops.control_flow_case import case_v2 as case # line: 33 +from tensorflow.python.ops.control_flow_ops import group # line: 1958 +from tensorflow.python.ops.control_flow_ops import tuple_v2 as tuple # line: 2037 +from tensorflow.python.ops.control_flow_switch_case import switch_case # line: 181 +from tensorflow.python.ops.critical_section_ops import CriticalSection # line: 121 +from tensorflow.python.ops.custom_gradient import custom_gradient # line: 45 +from tensorflow.python.ops.custom_gradient import grad_pass_through # line: 777 +from tensorflow.python.ops.custom_gradient import recompute_grad # line: 604 +from tensorflow.python.ops.functional_ops import foldl_v2 as foldl # line: 161 +from tensorflow.python.ops.functional_ops import foldr_v2 as foldr # line: 358 +from tensorflow.python.ops.functional_ops import scan_v2 as scan # line: 691 +from tensorflow.python.ops.gradients_impl import gradients_v2 as gradients # line: 184 +from tensorflow.python.ops.gradients_impl import HessiansV2 as hessians # line: 451 +from tensorflow.python.ops.gradients_util import AggregationMethod # line: 943 +from tensorflow.python.ops.histogram_ops import histogram_fixed_width # line: 103 +from tensorflow.python.ops.histogram_ops import histogram_fixed_width_bins # line: 31 +from tensorflow.python.ops.init_ops_v2 import Constant as constant_initializer # line: 204 +from tensorflow.python.ops.init_ops_v2 import Ones as ones_initializer # line: 157 +from tensorflow.python.ops.init_ops_v2 import RandomNormal as random_normal_initializer # line: 371 +from tensorflow.python.ops.init_ops_v2 import RandomUniform as random_uniform_initializer # line: 302 +from tensorflow.python.ops.init_ops_v2 import Zeros as zeros_initializer # line: 110 +from tensorflow.python.ops.linalg_ops import eig # line: 382 +from tensorflow.python.ops.linalg_ops import eigvals # line: 414 +from tensorflow.python.ops.linalg_ops import eye # line: 196 +from tensorflow.python.ops.linalg_ops import norm_v2 as norm # line: 561 +from tensorflow.python.ops.logging_ops import print_v2 as print # line: 147 +from tensorflow.python.ops.manip_ops import roll # line: 27 +from tensorflow.python.ops.map_fn import map_fn_v2 as map_fn # line: 614 +from tensorflow.python.ops.math_ops import abs # line: 365 +from tensorflow.python.ops.math_ops import acos # line: 5747 +from tensorflow.python.ops.math_ops import add # line: 4020 +from tensorflow.python.ops.math_ops import add_n # line: 4101 +from tensorflow.python.ops.math_ops import argmax_v2 as argmax # line: 268 +from tensorflow.python.ops.math_ops import argmin_v2 as argmin # line: 322 +from tensorflow.python.ops.math_ops import cast # line: 944 +from tensorflow.python.ops.math_ops import complex # line: 699 +from tensorflow.python.ops.math_ops import cumsum # line: 4352 +from tensorflow.python.ops.math_ops import divide # line: 446 +from tensorflow.python.ops.math_ops import equal # line: 2003 +from tensorflow.python.ops.math_ops import exp # line: 5644 +from tensorflow.python.ops.math_ops import floor # line: 5778 +from tensorflow.python.ops.math_ops import linspace_nd as linspace # line: 112 +from tensorflow.python.ops.math_ops import matmul # line: 3617 +from tensorflow.python.ops.math_ops import multiply # line: 481 +from tensorflow.python.ops.math_ops import not_equal # line: 2040 +from tensorflow.python.ops.math_ops import pow # line: 669 +from tensorflow.python.ops.math_ops import range # line: 2163 +from tensorflow.python.ops.math_ops import reduce_all # line: 3306 +from tensorflow.python.ops.math_ops import reduce_any # line: 3412 +from tensorflow.python.ops.math_ops import reduce_logsumexp # line: 3517 +from tensorflow.python.ops.math_ops import reduce_max # line: 3187 +from tensorflow.python.ops.math_ops import reduce_mean # line: 2713 +from tensorflow.python.ops.math_ops import reduce_min # line: 3059 +from tensorflow.python.ops.math_ops import reduce_prod # line: 2887 +from tensorflow.python.ops.math_ops import reduce_sum # line: 2369 +from tensorflow.python.ops.math_ops import round # line: 914 +from tensorflow.python.ops.math_ops import saturate_cast # line: 1028 +from tensorflow.python.ops.math_ops import scalar_mul_v2 as scalar_mul # line: 660 +from tensorflow.python.ops.math_ops import sigmoid # line: 4254 +from tensorflow.python.ops.math_ops import sign # line: 747 +from tensorflow.python.ops.math_ops import sqrt # line: 5605 +from tensorflow.python.ops.math_ops import subtract # line: 545 +from tensorflow.python.ops.math_ops import tensordot # line: 5152 +from tensorflow.python.ops.math_ops import truediv # line: 1630 +from tensorflow.python.ops.parallel_for.control_flow_ops import vectorized_map # line: 452 +from tensorflow.python.ops.ragged.ragged_tensor import RaggedTensor # line: 65 +from tensorflow.python.ops.ragged.ragged_tensor import RaggedTensorSpec # line: 2319 +from tensorflow.python.ops.script_ops import numpy_function # line: 804 +from tensorflow.python.ops.script_ops import eager_py_func as py_function # line: 461 +from tensorflow.python.ops.sort_ops import argsort # line: 86 +from tensorflow.python.ops.sort_ops import sort # line: 29 +from tensorflow.python.ops.special_math_ops import einsum # line: 618 +from tensorflow.python.ops.tensor_array_ops import TensorArray # line: 971 +from tensorflow.python.ops.tensor_array_ops import TensorArraySpec # line: 1363 +from tensorflow.python.ops.unconnected_gradients import UnconnectedGradients # line: 22 +from tensorflow.python.ops.variable_scope import variable_creator_scope # line: 2784 +from tensorflow.python.ops.variables import Variable # line: 201 +from tensorflow.python.ops.variables import VariableAggregationV2 as VariableAggregation # line: 89 +from tensorflow.python.ops.variables import VariableSynchronization # line: 61 +from tensorflow.python.ops.while_loop import while_loop_v2 as while_loop # line: 35 +from tensorflow.python.platform.tf_logging import get_logger # line: 93 + + + + +# Hook external TensorFlow modules. +_current_module = _sys.modules[__name__] +try: + from tensorboard.summary._tf import summary + _current_module.__path__ = ( + [_module_util.get_parent_dir(summary)] + _current_module.__path__) + setattr(_current_module, "summary", summary) +except ImportError: + _logging.warning( + "Limited tf.compat.v2.summary API due to missing TensorBoard " + "installation.") + +# Lazy-load estimator. +_estimator_module = "tensorflow_estimator.python.estimator.api._v2.estimator" +estimator = _LazyLoader("estimator", globals(), _estimator_module) +_module_dir = _module_util.get_parent_dir_for_name(_estimator_module) +if _module_dir: + _current_module.__path__ = [_module_dir] + _current_module.__path__ +setattr(_current_module, "estimator", estimator) + +# Lazy load Keras v2 +_tf_uses_legacy_keras = ( + _os.environ.get("TF_USE_LEGACY_KERAS", None) in ("true", "True", "1")) +setattr(_current_module, "keras", _KerasLazyLoader(globals(), mode="v2")) +if _tf_uses_legacy_keras: + _module_dir = _module_util.get_parent_dir_for_name("tf_keras.api._v2.keras") +else: + _module_dir = _module_util.get_parent_dir_for_name("keras.api._v2.keras") +_current_module.__path__ = [_module_dir] + _current_module.__path__ + + +# We would like the following to work for fully enabling 2.0 in a 1.0 install: +# +# import tensorflow.compat.v2 as tf +# tf.enable_v2_behavior() +# +# This make this one symbol available directly. +from tensorflow.python.compat.v2_compat import enable_v2_behavior # pylint: disable=g-import-not-at-top +setattr(_current_module, "enable_v2_behavior", enable_v2_behavior) + +# Add module aliases +_losses = _KerasLazyLoader( + globals(), submodule="losses", name="losses", mode="v2") +_metrics = _KerasLazyLoader( + globals(), submodule="metrics", name="metrics", mode="v2") +_optimizers = _KerasLazyLoader( + globals(), submodule="optimizers", name="optimizers", mode="v2") +_initializers = _KerasLazyLoader( + globals(), submodule="initializers", name="initializers", mode="v2") +setattr(_current_module, "losses", _losses) +setattr(_current_module, "metrics", _metrics) +setattr(_current_module, "optimizers", _optimizers) +setattr(_current_module, "initializers", _initializers) + +# Explicitly import lazy-loaded modules to support autocompletion. +# pylint: disable=g-import-not-at-top +if _typing.TYPE_CHECKING: + from tensorflow_estimator.python.estimator.api._v2 import estimator as estimator +# pylint: enable=g-import-not-at-top diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/compat/v2/compat/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/compat/v2/compat/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..cb0d3fe4d154a776dae088bb83eee5f8a7b4cdf8 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/compat/v2/compat/__init__.py @@ -0,0 +1,22 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.compat namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.compat import v1 +from tensorflow._api.v2.compat.v2.compat import v2 +from tensorflow.python.compat.compat import forward_compatibility_horizon # line: 125 +from tensorflow.python.compat.compat import forward_compatible # line: 65 +from tensorflow.python.framework.tensor_shape import dimension_at_index # line: 139 +from tensorflow.python.framework.tensor_shape import dimension_value # line: 103 +from tensorflow.python.util.compat import as_bytes # line: 121 +from tensorflow.python.util.compat import as_str # line: 122 +from tensorflow.python.util.compat import as_str_any # line: 125 +from tensorflow.python.util.compat import as_text # line: 120 +from tensorflow.python.util.compat import bytes_or_text_types # line: 216 +from tensorflow.python.util.compat import complex_types # line: 212 +from tensorflow.python.util.compat import integral_types # line: 208 +from tensorflow.python.util.compat import path_to_str # line: 145 +from tensorflow.python.util.compat import real_types # line: 210 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/config/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/config/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62a58f1ca0d491a4fe837dcd2cab79e632efe604 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/config/__init__.py @@ -0,0 +1,27 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.config namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.config import experimental +from tensorflow._api.v2.compat.v2.config import optimizer +from tensorflow._api.v2.compat.v2.config import threading +from tensorflow.python.eager.context import LogicalDevice # line: 290 +from tensorflow.python.eager.context import LogicalDeviceConfiguration # line: 308 +from tensorflow.python.eager.context import PhysicalDevice # line: 345 +from tensorflow.python.eager.polymorphic_function.eager_function_run import experimental_functions_run_eagerly # line: 108 +from tensorflow.python.eager.polymorphic_function.eager_function_run import experimental_run_functions_eagerly # line: 82 +from tensorflow.python.eager.polymorphic_function.eager_function_run import functions_run_eagerly # line: 25 +from tensorflow.python.eager.polymorphic_function.eager_function_run import run_functions_eagerly # line: 31 +from tensorflow.python.eager.remote import connect_to_cluster as experimental_connect_to_cluster # line: 76 +from tensorflow.python.eager.remote import connect_to_remote_host as experimental_connect_to_host # line: 37 +from tensorflow.python.framework.config import get_logical_device_configuration # line: 802 +from tensorflow.python.framework.config import get_soft_device_placement # line: 257 +from tensorflow.python.framework.config import get_visible_devices # line: 500 +from tensorflow.python.framework.config import list_logical_devices # line: 461 +from tensorflow.python.framework.config import list_physical_devices # line: 424 +from tensorflow.python.framework.config import set_logical_device_configuration # line: 843 +from tensorflow.python.framework.config import set_soft_device_placement # line: 283 +from tensorflow.python.framework.config import set_visible_devices # line: 533 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/config/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/config/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..47b2375fa234f413b58109b5e20c4303269866b2 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/config/experimental/__init__.py @@ -0,0 +1,30 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.config.experimental namespace +""" + +import sys as _sys + +from tensorflow.python.eager.context import LogicalDeviceConfiguration as VirtualDeviceConfiguration # line: 308 +from tensorflow.python.framework.config import disable_mlir_bridge # line: 926 +from tensorflow.python.framework.config import enable_mlir_bridge # line: 915 +from tensorflow.python.framework.config import enable_op_determinism # line: 932 +from tensorflow.python.framework.config import enable_tensor_float_32_execution # line: 46 +from tensorflow.python.framework.config import get_device_details # line: 757 +from tensorflow.python.framework.config import get_device_policy # line: 312 +from tensorflow.python.framework.config import get_memory_growth # line: 700 +from tensorflow.python.framework.config import get_memory_info # line: 571 +from tensorflow.python.framework.config import get_memory_usage # line: 664 +from tensorflow.python.framework.config import get_synchronous_execution # line: 386 +from tensorflow.python.framework.config import get_logical_device_configuration as get_virtual_device_configuration # line: 802 +from tensorflow.python.framework.config import get_visible_devices # line: 500 +from tensorflow.python.framework.config import list_logical_devices # line: 461 +from tensorflow.python.framework.config import list_physical_devices # line: 424 +from tensorflow.python.framework.config import reset_memory_stats # line: 620 +from tensorflow.python.framework.config import set_device_policy # line: 340 +from tensorflow.python.framework.config import set_memory_growth # line: 729 +from tensorflow.python.framework.config import set_synchronous_execution # line: 399 +from tensorflow.python.framework.config import set_logical_device_configuration as set_virtual_device_configuration # line: 843 +from tensorflow.python.framework.config import set_visible_devices # line: 533 +from tensorflow.python.framework.config import tensor_float_32_execution_enabled # line: 27 +from tensorflow.python.training.server_lib import ClusterDeviceFilters # line: 495 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/config/optimizer/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/config/optimizer/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..99ac9b167e6467f647d0bf99079ec8048399c91f --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/config/optimizer/__init__.py @@ -0,0 +1,11 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.config.optimizer namespace +""" + +import sys as _sys + +from tensorflow.python.framework.config import get_optimizer_experimental_options as get_experimental_options # line: 198 +from tensorflow.python.framework.config import get_optimizer_jit as get_jit # line: 158 +from tensorflow.python.framework.config import set_optimizer_experimental_options as set_experimental_options # line: 214 +from tensorflow.python.framework.config import set_optimizer_jit as set_jit # line: 172 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/config/threading/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/config/threading/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e912751472b5ee8cecd9df43957afe403ac6c083 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/config/threading/__init__.py @@ -0,0 +1,11 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.config.threading namespace +""" + +import sys as _sys + +from tensorflow.python.framework.config import get_inter_op_parallelism_threads # line: 132 +from tensorflow.python.framework.config import get_intra_op_parallelism_threads # line: 104 +from tensorflow.python.framework.config import set_inter_op_parallelism_threads # line: 145 +from tensorflow.python.framework.config import set_intra_op_parallelism_threads # line: 118 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/data/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/data/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..522c2df35cf05ebe090f307c229e73de0b6d605a --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/data/__init__.py @@ -0,0 +1,21 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.data namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.data import experimental +from tensorflow.python.data.ops.dataset_ops import AUTOTUNE # line: 102 +from tensorflow.python.data.ops.dataset_ops import DatasetV2 as Dataset # line: 135 +from tensorflow.python.data.ops.dataset_ops import DatasetSpec # line: 4542 +from tensorflow.python.data.ops.dataset_ops import INFINITE as INFINITE_CARDINALITY # line: 112 +from tensorflow.python.data.ops.dataset_ops import NumpyIterator # line: 4707 +from tensorflow.python.data.ops.dataset_ops import UNKNOWN as UNKNOWN_CARDINALITY # line: 113 +from tensorflow.python.data.ops.iterator_ops import IteratorBase as Iterator # line: 557 +from tensorflow.python.data.ops.iterator_ops import IteratorSpec # line: 913 +from tensorflow.python.data.ops.options import Options # line: 493 +from tensorflow.python.data.ops.options import ThreadingOptions # line: 449 +from tensorflow.python.data.ops.readers import FixedLengthRecordDatasetV2 as FixedLengthRecordDataset # line: 569 +from tensorflow.python.data.ops.readers import TFRecordDatasetV2 as TFRecordDataset # line: 386 +from tensorflow.python.data.ops.readers import TextLineDatasetV2 as TextLineDataset # line: 171 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/data/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/data/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8fabbe16bf25538ee3d60c41975e0ea3ab8e611f --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/data/experimental/__init__.py @@ -0,0 +1,67 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.data.experimental namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.data.experimental import service +from tensorflow.python.data.experimental.ops.batching import dense_to_ragged_batch # line: 30 +from tensorflow.python.data.experimental.ops.batching import dense_to_sparse_batch # line: 94 +from tensorflow.python.data.experimental.ops.batching import map_and_batch # line: 210 +from tensorflow.python.data.experimental.ops.batching import unbatch # line: 269 +from tensorflow.python.data.experimental.ops.cardinality import INFINITE as INFINITE_CARDINALITY # line: 26 +from tensorflow.python.data.experimental.ops.cardinality import UNKNOWN as UNKNOWN_CARDINALITY # line: 28 +from tensorflow.python.data.experimental.ops.cardinality import assert_cardinality # line: 67 +from tensorflow.python.data.experimental.ops.cardinality import cardinality # line: 33 +from tensorflow.python.data.experimental.ops.counter import CounterV2 as Counter # line: 23 +from tensorflow.python.data.experimental.ops.distribute import SHARD_HINT # line: 31 +from tensorflow.python.data.experimental.ops.enumerate_ops import enumerate_dataset # line: 21 +from tensorflow.python.data.experimental.ops.error_ops import ignore_errors # line: 20 +from tensorflow.python.data.experimental.ops.from_list import from_list # line: 75 +from tensorflow.python.data.experimental.ops.get_single_element import get_single_element # line: 22 +from tensorflow.python.data.experimental.ops.grouping import Reducer # line: 388 +from tensorflow.python.data.experimental.ops.grouping import bucket_by_sequence_length # line: 112 +from tensorflow.python.data.experimental.ops.grouping import group_by_reducer # line: 28 +from tensorflow.python.data.experimental.ops.grouping import group_by_window # line: 59 +from tensorflow.python.data.experimental.ops.interleave_ops import choose_from_datasets_v2 as choose_from_datasets # line: 175 +from tensorflow.python.data.experimental.ops.interleave_ops import parallel_interleave # line: 28 +from tensorflow.python.data.experimental.ops.interleave_ops import sample_from_datasets_v2 as sample_from_datasets # line: 91 +from tensorflow.python.data.experimental.ops.io import load # line: 108 +from tensorflow.python.data.experimental.ops.io import save # line: 26 +from tensorflow.python.data.experimental.ops.iterator_ops import CheckpointInputPipelineHook # line: 105 +from tensorflow.python.data.experimental.ops.iterator_ops import make_saveable_from_iterator # line: 43 +from tensorflow.python.data.experimental.ops.lookup_ops import DatasetInitializer # line: 54 +from tensorflow.python.data.experimental.ops.lookup_ops import index_table_from_dataset # line: 190 +from tensorflow.python.data.experimental.ops.lookup_ops import table_from_dataset # line: 102 +from tensorflow.python.data.experimental.ops.pad_to_cardinality import pad_to_cardinality # line: 26 +from tensorflow.python.data.experimental.ops.parsing_ops import parse_example_dataset # line: 105 +from tensorflow.python.data.experimental.ops.prefetching_ops import copy_to_device # line: 65 +from tensorflow.python.data.experimental.ops.prefetching_ops import prefetch_to_device # line: 33 +from tensorflow.python.data.experimental.ops.random_access import at # line: 22 +from tensorflow.python.data.experimental.ops.random_ops import RandomDatasetV2 as RandomDataset # line: 27 +from tensorflow.python.data.experimental.ops.readers import CsvDatasetV2 as CsvDataset # line: 668 +from tensorflow.python.data.experimental.ops.readers import SqlDatasetV2 as SqlDataset # line: 1156 +from tensorflow.python.data.experimental.ops.readers import make_batched_features_dataset_v2 as make_batched_features_dataset # line: 916 +from tensorflow.python.data.experimental.ops.readers import make_csv_dataset_v2 as make_csv_dataset # line: 326 +from tensorflow.python.data.experimental.ops.resampling import rejection_resample # line: 21 +from tensorflow.python.data.experimental.ops.scan_ops import scan # line: 21 +from tensorflow.python.data.experimental.ops.shuffle_ops import shuffle_and_repeat # line: 62 +from tensorflow.python.data.experimental.ops.snapshot import snapshot # line: 190 +from tensorflow.python.data.experimental.ops.take_while_ops import take_while # line: 21 +from tensorflow.python.data.experimental.ops.unique import unique # line: 21 +from tensorflow.python.data.experimental.ops.writers import TFRecordWriter # line: 27 +from tensorflow.python.data.ops.dataset_ops import AUTOTUNE # line: 104 +from tensorflow.python.data.ops.dataset_ops import from_variant # line: 4514 +from tensorflow.python.data.ops.dataset_ops import get_structure # line: 4349 +from tensorflow.python.data.ops.dataset_ops import to_variant # line: 4529 +from tensorflow.python.data.ops.debug_mode import enable_debug_mode # line: 24 +from tensorflow.python.data.ops.iterator_ops import get_next_as_optional # line: 999 +from tensorflow.python.data.ops.optional_ops import Optional # line: 31 +from tensorflow.python.data.ops.options import AutoShardPolicy # line: 88 +from tensorflow.python.data.ops.options import AutotuneAlgorithm # line: 30 +from tensorflow.python.data.ops.options import AutotuneOptions # line: 193 +from tensorflow.python.data.ops.options import DistributeOptions # line: 262 +from tensorflow.python.data.ops.options import ExternalStatePolicy # line: 155 +from tensorflow.python.data.ops.options import OptimizationOptions # line: 304 +from tensorflow.python.data.ops.options import ThreadingOptions # line: 449 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/data/experimental/service/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/data/experimental/service/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..40450071641553532311f453e8900bd584061343 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/data/experimental/service/__init__.py @@ -0,0 +1,16 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.data.experimental.service namespace +""" + +import sys as _sys + +from tensorflow.python.data.experimental.ops.data_service_ops import CrossTrainerCache # line: 117 +from tensorflow.python.data.experimental.ops.data_service_ops import ShardingPolicy # line: 46 +from tensorflow.python.data.experimental.ops.data_service_ops import distribute # line: 531 +from tensorflow.python.data.experimental.ops.data_service_ops import from_dataset_id # line: 1045 +from tensorflow.python.data.experimental.ops.data_service_ops import register_dataset # line: 839 +from tensorflow.python.data.experimental.service.server_lib import DispatchServer # line: 130 +from tensorflow.python.data.experimental.service.server_lib import DispatcherConfig # line: 44 +from tensorflow.python.data.experimental.service.server_lib import WorkerConfig # line: 292 +from tensorflow.python.data.experimental.service.server_lib import WorkerServer # line: 348 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/debugging/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/debugging/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..daccbba7444e0b6a95b515299a418ec2a847e611 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/debugging/__init__.py @@ -0,0 +1,39 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.debugging namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.debugging import experimental +from tensorflow.python.ops.gen_array_ops import check_numerics # line: 950 +from tensorflow.python.debug.lib.check_numerics_callback import disable_check_numerics # line: 445 +from tensorflow.python.debug.lib.check_numerics_callback import enable_check_numerics # line: 336 +from tensorflow.python.eager.context import get_log_device_placement # line: 2520 +from tensorflow.python.eager.context import set_log_device_placement # line: 2530 +from tensorflow.python.ops.check_ops import assert_equal_v2 as assert_equal # line: 762 +from tensorflow.python.ops.check_ops import assert_greater_v2 as assert_greater # line: 978 +from tensorflow.python.ops.check_ops import assert_greater_equal_v2 as assert_greater_equal # line: 996 +from tensorflow.python.ops.check_ops import assert_integer_v2 as assert_integer # line: 1427 +from tensorflow.python.ops.check_ops import assert_less_v2 as assert_less # line: 942 +from tensorflow.python.ops.check_ops import assert_less_equal_v2 as assert_less_equal # line: 959 +from tensorflow.python.ops.check_ops import assert_near_v2 as assert_near # line: 803 +from tensorflow.python.ops.check_ops import assert_negative_v2 as assert_negative # line: 543 +from tensorflow.python.ops.check_ops import assert_non_negative_v2 as assert_non_negative # line: 650 +from tensorflow.python.ops.check_ops import assert_non_positive_v2 as assert_non_positive # line: 706 +from tensorflow.python.ops.check_ops import assert_none_equal_v2 as assert_none_equal # line: 783 +from tensorflow.python.ops.check_ops import assert_positive_v2 as assert_positive # line: 597 +from tensorflow.python.ops.check_ops import assert_proper_iterable # line: 511 +from tensorflow.python.ops.check_ops import assert_rank_v2 as assert_rank # line: 1064 +from tensorflow.python.ops.check_ops import assert_rank_at_least_v2 as assert_rank_at_least # line: 1162 +from tensorflow.python.ops.check_ops import assert_rank_in_v2 as assert_rank_in # line: 1329 +from tensorflow.python.ops.check_ops import assert_same_float_dtype # line: 2118 +from tensorflow.python.ops.check_ops import assert_scalar_v2 as assert_scalar # line: 2153 +from tensorflow.python.ops.check_ops import assert_shapes_v2 as assert_shapes # line: 1611 +from tensorflow.python.ops.check_ops import assert_type_v2 as assert_type # line: 1487 +from tensorflow.python.ops.check_ops import is_numeric_tensor # line: 1951 +from tensorflow.python.ops.control_flow_assert import Assert # line: 62 +from tensorflow.python.ops.numerics import verify_tensor_all_finite_v2 as assert_all_finite # line: 50 +from tensorflow.python.util.traceback_utils import disable_traceback_filtering # line: 76 +from tensorflow.python.util.traceback_utils import enable_traceback_filtering # line: 51 +from tensorflow.python.util.traceback_utils import is_traceback_filtering_enabled # line: 32 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/debugging/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/debugging/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..027fca471e864d65283389ff5742ad6af93e34eb --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/debugging/experimental/__init__.py @@ -0,0 +1,9 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.debugging.experimental namespace +""" + +import sys as _sys + +from tensorflow.python.debug.lib.dumping_callback import disable_dump_debug_info # line: 863 +from tensorflow.python.debug.lib.dumping_callback import enable_dump_debug_info # line: 672 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/distribute/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/distribute/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..61702232cabe31b17b1ab5d57b6273a889d06f80 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/distribute/__init__.py @@ -0,0 +1,36 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.distribute namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.distribute import cluster_resolver +from tensorflow._api.v2.compat.v2.distribute import coordinator +from tensorflow._api.v2.compat.v2.distribute import experimental +from tensorflow.python.distribute.collective_all_reduce_strategy import CollectiveAllReduceStrategy as MultiWorkerMirroredStrategy # line: 56 +from tensorflow.python.distribute.cross_device_ops import CrossDeviceOps # line: 251 +from tensorflow.python.distribute.cross_device_ops import HierarchicalCopyAllReduce # line: 996 +from tensorflow.python.distribute.cross_device_ops import NcclAllReduce # line: 959 +from tensorflow.python.distribute.cross_device_ops import ReductionToOneDevice # line: 581 +from tensorflow.python.distribute.distribute_lib import InputContext # line: 841 +from tensorflow.python.distribute.distribute_lib import InputOptions # line: 1015 +from tensorflow.python.distribute.distribute_lib import InputReplicationMode # line: 824 +from tensorflow.python.distribute.distribute_lib import ReplicaContext # line: 3677 +from tensorflow.python.distribute.distribute_lib import RunOptions # line: 980 +from tensorflow.python.distribute.distribute_lib import Strategy # line: 2033 +from tensorflow.python.distribute.distribute_lib import StrategyExtendedV2 as StrategyExtended # line: 2401 +from tensorflow.python.distribute.distribute_lib import experimental_set_strategy # line: 584 +from tensorflow.python.distribute.distribute_lib import get_replica_context # line: 454 +from tensorflow.python.distribute.distribute_lib import get_strategy # line: 543 +from tensorflow.python.distribute.distribute_lib import has_strategy # line: 563 +from tensorflow.python.distribute.distribute_lib import in_cross_replica_context # line: 518 +from tensorflow.python.distribute.mirrored_strategy import MirroredStrategy # line: 199 +from tensorflow.python.distribute.one_device_strategy import OneDeviceStrategy # line: 38 +from tensorflow.python.distribute.parameter_server_strategy_v2 import ParameterServerStrategyV2 as ParameterServerStrategy # line: 72 +from tensorflow.python.distribute.reduce_util import ReduceOp # line: 23 +from tensorflow.python.distribute.tpu_strategy import TPUStrategyV2 as TPUStrategy # line: 242 +from tensorflow.python.training.server_lib import Server # line: 94 +from tensorflow.python.types.distribute import DistributedDatasetInterface as DistributedDataset # line: 307 +from tensorflow.python.types.distribute import DistributedIteratorInterface as DistributedIterator # line: 196 +from tensorflow.python.types.distribute import DistributedValues # line: 62 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/distribute/cluster_resolver/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/distribute/cluster_resolver/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5e2c448e26130bec18027e6193802a70203571c0 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/distribute/cluster_resolver/__init__.py @@ -0,0 +1,15 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.distribute.cluster_resolver namespace +""" + +import sys as _sys + +from tensorflow.python.distribute.cluster_resolver.cluster_resolver import ClusterResolver # line: 55 +from tensorflow.python.distribute.cluster_resolver.cluster_resolver import SimpleClusterResolver # line: 288 +from tensorflow.python.distribute.cluster_resolver.cluster_resolver import UnionClusterResolver as UnionResolver # line: 418 +from tensorflow.python.distribute.cluster_resolver.gce_cluster_resolver import GCEClusterResolver # line: 30 +from tensorflow.python.distribute.cluster_resolver.kubernetes_cluster_resolver import KubernetesClusterResolver # line: 23 +from tensorflow.python.distribute.cluster_resolver.slurm_cluster_resolver import SlurmClusterResolver # line: 163 +from tensorflow.python.distribute.cluster_resolver.tfconfig_cluster_resolver import TFConfigClusterResolver # line: 47 +from tensorflow.python.distribute.cluster_resolver.tpu_cluster_resolver import TPUClusterResolver # line: 24 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/distribute/coordinator/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/distribute/coordinator/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bc20621cc409c281e2e4d4042af36724d380c0b0 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/distribute/coordinator/__init__.py @@ -0,0 +1,11 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.distribute.coordinator namespace +""" + +import sys as _sys + +from tensorflow.python.distribute.coordinator.cluster_coordinator import ClusterCoordinator # line: 1397 +from tensorflow.python.distribute.coordinator.coordinator_context import get_current_worker_index as experimental_get_current_worker_index # line: 81 +from tensorflow.python.distribute.coordinator.remote_value import RemoteValue # line: 53 +from tensorflow.python.distribute.coordinator.values import PerWorkerValues as PerWorkerValue # line: 152 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/distribute/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/distribute/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..604ab5939c8533793728b4aaef5b861b4e1a1a43 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/distribute/experimental/__init__.py @@ -0,0 +1,22 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.distribute.experimental namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.distribute.experimental import coordinator +from tensorflow._api.v2.compat.v2.distribute.experimental import partitioners +from tensorflow._api.v2.compat.v2.distribute.experimental import rpc +from tensorflow.python.distribute.central_storage_strategy import CentralStorageStrategy # line: 23 +from tensorflow.python.distribute.collective_all_reduce_strategy import _CollectiveAllReduceStrategyExperimental as MultiWorkerMirroredStrategy # line: 229 +from tensorflow.python.distribute.collective_util import CommunicationImplementation as CollectiveCommunication # line: 26 +from tensorflow.python.distribute.collective_util import Hints as CollectiveHints # line: 168 +from tensorflow.python.distribute.collective_util import CommunicationImplementation # line: 26 +from tensorflow.python.distribute.collective_util import _OptionsExported as CommunicationOptions # line: 50 +from tensorflow.python.distribute.distribute_lib import ValueContext # line: 914 +from tensorflow.python.distribute.failure_handling.failure_handling import PreemptionCheckpointHandler # line: 336 +from tensorflow.python.distribute.failure_handling.failure_handling import TerminationConfig # line: 74 +from tensorflow.python.distribute.failure_handling.preemption_watcher import PreemptionWatcher # line: 44 +from tensorflow.python.distribute.parameter_server_strategy_v2 import ParameterServerStrategyV2 as ParameterServerStrategy # line: 72 +from tensorflow.python.distribute.tpu_strategy import TPUStrategy # line: 667 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/distribute/experimental/coordinator/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/distribute/experimental/coordinator/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f9512c26846e5de071be7322332141cc8d767684 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/distribute/experimental/coordinator/__init__.py @@ -0,0 +1,10 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.distribute.experimental.coordinator namespace +""" + +import sys as _sys + +from tensorflow.python.distribute.coordinator.cluster_coordinator import ClusterCoordinator # line: 1397 +from tensorflow.python.distribute.coordinator.remote_value import RemoteValue # line: 53 +from tensorflow.python.distribute.coordinator.values import PerWorkerValues # line: 152 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/distribute/experimental/partitioners/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/distribute/experimental/partitioners/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b6c0bb99b12e22643a8f05a75f5068c7bd140d30 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/distribute/experimental/partitioners/__init__.py @@ -0,0 +1,11 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.distribute.experimental.partitioners namespace +""" + +import sys as _sys + +from tensorflow.python.distribute.sharded_variable import FixedShardsPartitioner # line: 83 +from tensorflow.python.distribute.sharded_variable import MaxSizePartitioner # line: 175 +from tensorflow.python.distribute.sharded_variable import MinSizePartitioner # line: 114 +from tensorflow.python.distribute.sharded_variable import Partitioner # line: 46 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/distribute/experimental/rpc/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/distribute/experimental/rpc/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..edd2fea388bb5f3fbb3eb4720d1974c9c37872ba --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/distribute/experimental/rpc/__init__.py @@ -0,0 +1,9 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.distribute.experimental.rpc namespace +""" + +import sys as _sys + +from tensorflow.python.distribute.experimental.rpc.rpc_ops import Client # line: 117 +from tensorflow.python.distribute.experimental.rpc.rpc_ops import Server # line: 50 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/dtypes/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/dtypes/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..745fa03d7768d714028996e1c28cdd435e5501cd --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/dtypes/__init__.py @@ -0,0 +1,39 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.dtypes namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.dtypes import experimental +from tensorflow.python.framework.dtypes import DType # line: 51 +from tensorflow.python.framework.dtypes import QUANTIZED_DTYPES # line: 771 +from tensorflow.python.framework.dtypes import as_dtype # line: 793 +from tensorflow.python.framework.dtypes import bfloat16 # line: 450 +from tensorflow.python.framework.dtypes import bool # line: 414 +from tensorflow.python.framework.dtypes import complex128 # line: 401 +from tensorflow.python.framework.dtypes import complex64 # line: 394 +from tensorflow.python.framework.dtypes import double # line: 388 +from tensorflow.python.framework.dtypes import float16 # line: 373 +from tensorflow.python.framework.dtypes import float32 # line: 380 +from tensorflow.python.framework.dtypes import float64 # line: 386 +from tensorflow.python.framework.dtypes import half # line: 374 +from tensorflow.python.framework.dtypes import int16 # line: 354 +from tensorflow.python.framework.dtypes import int32 # line: 360 +from tensorflow.python.framework.dtypes import int64 # line: 366 +from tensorflow.python.framework.dtypes import int8 # line: 348 +from tensorflow.python.framework.dtypes import qint16 # line: 426 +from tensorflow.python.framework.dtypes import qint32 # line: 432 +from tensorflow.python.framework.dtypes import qint8 # line: 420 +from tensorflow.python.framework.dtypes import quint16 # line: 444 +from tensorflow.python.framework.dtypes import quint8 # line: 438 +from tensorflow.python.framework.dtypes import resource # line: 312 +from tensorflow.python.framework.dtypes import string # line: 408 +from tensorflow.python.framework.dtypes import uint16 # line: 330 +from tensorflow.python.framework.dtypes import uint32 # line: 336 +from tensorflow.python.framework.dtypes import uint64 # line: 342 +from tensorflow.python.framework.dtypes import uint8 # line: 324 +from tensorflow.python.framework.dtypes import variant # line: 318 +from tensorflow.python.ops.math_ops import cast # line: 944 +from tensorflow.python.ops.math_ops import complex # line: 699 +from tensorflow.python.ops.math_ops import saturate_cast # line: 1028 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/dtypes/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/dtypes/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d17307b985646f250a5485fd51b6551ddf5bf643 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/dtypes/experimental/__init__.py @@ -0,0 +1,11 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.dtypes.experimental namespace +""" + +import sys as _sys + +from tensorflow.python.framework.dtypes import float8_e4m3fn # line: 465 +from tensorflow.python.framework.dtypes import float8_e5m2 # line: 456 +from tensorflow.python.framework.dtypes import int4 # line: 471 +from tensorflow.python.framework.dtypes import uint4 # line: 477 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/errors/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/errors/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..33c6ebfcd059d3966167a016a340fd15603c7278 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/errors/__init__.py @@ -0,0 +1,42 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.errors namespace +""" + +import sys as _sys + +from tensorflow.python.framework.errors_impl import ABORTED # line: 214 +from tensorflow.python.framework.errors_impl import ALREADY_EXISTS # line: 201 +from tensorflow.python.framework.errors_impl import AbortedError # line: 401 +from tensorflow.python.framework.errors_impl import AlreadyExistsError # line: 318 +from tensorflow.python.framework.errors_impl import CANCELLED # line: 189 +from tensorflow.python.framework.errors_impl import CancelledError # line: 227 +from tensorflow.python.framework.errors_impl import DATA_LOSS # line: 224 +from tensorflow.python.framework.errors_impl import DEADLINE_EXCEEDED # line: 196 +from tensorflow.python.framework.errors_impl import DataLossError # line: 480 +from tensorflow.python.framework.errors_impl import DeadlineExceededError # line: 290 +from tensorflow.python.framework.errors_impl import FAILED_PRECONDITION # line: 211 +from tensorflow.python.framework.errors_impl import FailedPreconditionError # line: 383 +from tensorflow.python.framework.errors_impl import INTERNAL # line: 220 +from tensorflow.python.framework.errors_impl import INVALID_ARGUMENT # line: 193 +from tensorflow.python.framework.errors_impl import InternalError # line: 454 +from tensorflow.python.framework.errors_impl import InvalidArgumentError # line: 270 +from tensorflow.python.framework.errors_impl import NOT_FOUND # line: 199 +from tensorflow.python.framework.errors_impl import NotFoundError # line: 303 +from tensorflow.python.framework.errors_impl import OK # line: 187 +from tensorflow.python.framework.errors_impl import OUT_OF_RANGE # line: 216 +from tensorflow.python.framework.errors_impl import OpError # line: 57 +from tensorflow.python.framework.errors_impl import OperatorNotAllowedInGraphError # line: 34 +from tensorflow.python.framework.errors_impl import OutOfRangeError # line: 417 +from tensorflow.python.framework.errors_impl import PERMISSION_DENIED # line: 203 +from tensorflow.python.framework.errors_impl import PermissionDeniedError # line: 338 +from tensorflow.python.framework.errors_impl import RESOURCE_EXHAUSTED # line: 208 +from tensorflow.python.framework.errors_impl import ResourceExhaustedError # line: 367 +from tensorflow.python.framework.errors_impl import UNAUTHENTICATED # line: 206 +from tensorflow.python.framework.errors_impl import UNAVAILABLE # line: 222 +from tensorflow.python.framework.errors_impl import UNIMPLEMENTED # line: 218 +from tensorflow.python.framework.errors_impl import UNKNOWN # line: 191 +from tensorflow.python.framework.errors_impl import UnauthenticatedError # line: 354 +from tensorflow.python.framework.errors_impl import UnavailableError # line: 467 +from tensorflow.python.framework.errors_impl import UnimplementedError # line: 437 +from tensorflow.python.framework.errors_impl import UnknownError # line: 254 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9184d1416bcc29e4ff0fd7b11c6229e4c60cc072 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/experimental/__init__.py @@ -0,0 +1,34 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.experimental namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.experimental import dlpack +from tensorflow._api.v2.compat.v2.experimental import dtensor +from tensorflow._api.v2.compat.v2.experimental import extension_type +from tensorflow._api.v2.compat.v2.experimental import numpy +from tensorflow._api.v2.compat.v2.experimental import tensorrt +from tensorflow.python.data.ops.optional_ops import Optional # line: 31 +from tensorflow.python.eager.context import async_clear_error # line: 2836 +from tensorflow.python.eager.context import async_scope # line: 2772 +from tensorflow.python.eager.context import function_executor_type # line: 2621 +from tensorflow.python.framework.dtypes import float8_e4m3fn # line: 465 +from tensorflow.python.framework.dtypes import float8_e5m2 # line: 456 +from tensorflow.python.framework.dtypes import int4 # line: 471 +from tensorflow.python.framework.dtypes import uint4 # line: 477 +from tensorflow.python.framework.extension_type import BatchableExtensionType # line: 831 +from tensorflow.python.framework.extension_type import ExtensionType # line: 99 +from tensorflow.python.framework.extension_type import ExtensionTypeBatchEncoder # line: 651 +from tensorflow.python.framework.extension_type import ExtensionTypeSpec # line: 419 +from tensorflow.python.framework.load_library import register_filesystem_plugin # line: 199 +from tensorflow.python.framework.strict_mode import enable_strict_mode # line: 22 +from tensorflow.python.ops.ragged.dynamic_ragged_shape import DynamicRaggedShape # line: 167 +from tensorflow.python.ops.ragged.row_partition import RowPartition # line: 56 +from tensorflow.python.ops.structured.structured_tensor import StructuredTensor # line: 53 +from tensorflow.python.util.dispatch import dispatch_for_api # line: 334 +from tensorflow.python.util.dispatch import dispatch_for_binary_elementwise_apis # line: 878 +from tensorflow.python.util.dispatch import dispatch_for_binary_elementwise_assert_apis # line: 936 +from tensorflow.python.util.dispatch import dispatch_for_unary_elementwise_apis # line: 811 +from tensorflow.python.util.dispatch import unregister_dispatch_for # line: 553 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/experimental/dlpack/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/experimental/dlpack/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..94b291e4e199347097bef6912c61ee24fb114370 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/experimental/dlpack/__init__.py @@ -0,0 +1,9 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.experimental.dlpack namespace +""" + +import sys as _sys + +from tensorflow.python.dlpack.dlpack import from_dlpack # line: 44 +from tensorflow.python.dlpack.dlpack import to_dlpack # line: 22 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/experimental/dtensor/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/experimental/dtensor/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9d24d5df1af9228736b5d99928d0ded8a12e537e --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/experimental/dtensor/__init__.py @@ -0,0 +1,51 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.experimental.dtensor namespace +""" + +import sys as _sys + +from tensorflow.dtensor.python.accelerator_util import initialize_accelerator_system # line: 114 +from tensorflow.dtensor.python.accelerator_util import initialize_accelerator_system as initialize_multi_client # line: 114 +from tensorflow.dtensor.python.accelerator_util import initialize_accelerator_system as initialize_tpu_system # line: 114 +from tensorflow.dtensor.python.accelerator_util import shutdown_accelerator_system # line: 268 +from tensorflow.dtensor.python.accelerator_util import shutdown_accelerator_system as shutdown_tpu_system # line: 268 +from tensorflow.dtensor.python.api import reset_dtensor_device as _reset_dtensor_device # line: 505 +from tensorflow.dtensor.python.api import call_with_layout # line: 37 +from tensorflow.dtensor.python.api import check_layout # line: 395 +from tensorflow.dtensor.python.api import copy_to_mesh # line: 167 +from tensorflow.dtensor.python.api import default_mesh # line: 89 +from tensorflow.dtensor.python.api import device_name # line: 131 +from tensorflow.dtensor.python.api import fetch_layout # line: 379 +from tensorflow.dtensor.python.api import get_default_mesh # line: 115 +from tensorflow.dtensor.python.api import is_dtensor # line: 147 +from tensorflow.dtensor.python.api import pack # line: 191 +from tensorflow.dtensor.python.api import relayout # line: 411 +from tensorflow.dtensor.python.api import relayout_like # line: 452 +from tensorflow.dtensor.python.api import run_on # line: 67 +from tensorflow.dtensor.python.api import unpack # line: 342 +from tensorflow.dtensor.python.config import client_id # line: 86 +from tensorflow.dtensor.python.config import full_job_name # line: 117 +from tensorflow.dtensor.python.config import heartbeat_enabled # line: 168 +from tensorflow.dtensor.python.config import job_name # line: 108 +from tensorflow.dtensor.python.config import jobs # line: 148 +from tensorflow.dtensor.python.config import local_devices # line: 46 +from tensorflow.dtensor.python.config import num_clients # line: 100 +from tensorflow.dtensor.python.config import num_global_devices # line: 80 +from tensorflow.dtensor.python.config import num_local_devices # line: 68 +from tensorflow.dtensor.python.config import preferred_device_type # line: 192 +from tensorflow.dtensor.python.d_checkpoint import DTensorCheckpoint # line: 411 +from tensorflow.dtensor.python.d_variable import DVariable # line: 143 +from tensorflow.dtensor.python.input_util import DTensorDataset # line: 384 +from tensorflow.dtensor.python.layout import Layout # line: 351 +from tensorflow.dtensor.python.layout import MATCH # line: 39 +from tensorflow.dtensor.python.layout import Mesh # line: 53 +from tensorflow.dtensor.python.layout import UNSHARDED # line: 36 +from tensorflow.dtensor.python.mesh_util import barrier # line: 243 +from tensorflow.dtensor.python.mesh_util import create_distributed_mesh # line: 138 +from tensorflow.dtensor.python.mesh_util import create_mesh # line: 70 +from tensorflow.dtensor.python.save_restore import enable_save_as_bf16 # line: 83 +from tensorflow.dtensor.python.save_restore import name_based_restore # line: 100 +from tensorflow.dtensor.python.save_restore import name_based_save # line: 176 +from tensorflow.dtensor.python.save_restore import sharded_save # line: 34 +from tensorflow.dtensor.python.tpu_util import create_tpu_mesh # line: 578 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/experimental/extension_type/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/experimental/extension_type/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..070fcf42ed4902381a6d0d5b105b29d572bbe61e --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/experimental/extension_type/__init__.py @@ -0,0 +1,8 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.experimental.extension_type namespace +""" + +import sys as _sys + +from tensorflow.python.framework.extension_type import as_dict # line: 332 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/experimental/numpy/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/experimental/numpy/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..97da9eb7645364f17fd6ed416a34c735a57d20a0 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/experimental/numpy/__init__.py @@ -0,0 +1,236 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.experimental.numpy namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.experimental.numpy import random +from tensorflow.python.framework.tensor import Tensor as ndarray # line: 139 +from tensorflow.python.ops.numpy_ops.np_array_ops import all # line: 420 +from tensorflow.python.ops.numpy_ops.np_array_ops import amax # line: 672 +from tensorflow.python.ops.numpy_ops.np_array_ops import amin # line: 689 +from tensorflow.python.ops.numpy_ops.np_array_ops import any # line: 427 +from tensorflow.python.ops.numpy_ops.np_array_ops import arange # line: 259 +from tensorflow.python.ops.numpy_ops.np_array_ops import around # line: 820 +from tensorflow.python.ops.numpy_ops.np_array_ops import array # line: 217 +from tensorflow.python.ops.numpy_ops.np_array_ops import asanyarray # line: 246 +from tensorflow.python.ops.numpy_ops.np_array_ops import asarray # line: 234 +from tensorflow.python.ops.numpy_ops.np_array_ops import ascontiguousarray # line: 252 +from tensorflow.python.ops.numpy_ops.np_array_ops import atleast_1d # line: 1293 +from tensorflow.python.ops.numpy_ops.np_array_ops import atleast_2d # line: 1299 +from tensorflow.python.ops.numpy_ops.np_array_ops import atleast_3d # line: 1305 +from tensorflow.python.ops.numpy_ops.np_array_ops import broadcast_arrays # line: 1567 +from tensorflow.python.ops.numpy_ops.np_array_ops import broadcast_to # line: 1192 +from tensorflow.python.ops.numpy_ops.np_array_ops import compress # line: 434 +from tensorflow.python.ops.numpy_ops.np_array_ops import copy # line: 465 +from tensorflow.python.ops.numpy_ops.np_array_ops import cumprod # line: 483 +from tensorflow.python.ops.numpy_ops.np_array_ops import cumsum # line: 500 +from tensorflow.python.ops.numpy_ops.np_array_ops import diag # line: 305 +from tensorflow.python.ops.numpy_ops.np_array_ops import diag_indices # line: 1338 +from tensorflow.python.ops.numpy_ops.np_array_ops import diagflat # line: 389 +from tensorflow.python.ops.numpy_ops.np_array_ops import diagonal # line: 347 +from tensorflow.python.ops.numpy_ops.np_array_ops import dsplit # line: 1187 +from tensorflow.python.ops.numpy_ops.np_array_ops import dstack # line: 1241 +from tensorflow.python.ops.numpy_ops.np_array_ops import empty # line: 53 +from tensorflow.python.ops.numpy_ops.np_array_ops import empty_like # line: 59 +from tensorflow.python.ops.numpy_ops.np_array_ops import expand_dims # line: 875 +from tensorflow.python.ops.numpy_ops.np_array_ops import eye # line: 98 +from tensorflow.python.ops.numpy_ops.np_array_ops import flatten # line: 889 +from tensorflow.python.ops.numpy_ops.np_array_ops import flip # line: 1433 +from tensorflow.python.ops.numpy_ops.np_array_ops import fliplr # line: 1452 +from tensorflow.python.ops.numpy_ops.np_array_ops import flipud # line: 1446 +from tensorflow.python.ops.numpy_ops.np_array_ops import full # line: 136 +from tensorflow.python.ops.numpy_ops.np_array_ops import full_like # line: 148 +from tensorflow.python.ops.numpy_ops.np_array_ops import hsplit # line: 1184 +from tensorflow.python.ops.numpy_ops.np_array_ops import hstack # line: 1214 +from tensorflow.python.ops.numpy_ops.np_array_ops import identity # line: 130 +from tensorflow.python.ops.numpy_ops.np_array_ops import imag # line: 517 +from tensorflow.python.ops.numpy_ops.np_array_ops import isscalar # line: 1114 +from tensorflow.python.ops.numpy_ops.np_array_ops import ix_ # line: 1534 +from tensorflow.python.ops.numpy_ops.np_array_ops import max # line: 1667 +from tensorflow.python.ops.numpy_ops.np_array_ops import mean # line: 657 +from tensorflow.python.ops.numpy_ops.np_array_ops import min # line: 1673 +from tensorflow.python.ops.numpy_ops.np_array_ops import moveaxis # line: 953 +from tensorflow.python.ops.numpy_ops.np_array_ops import ndim # line: 1107 +from tensorflow.python.ops.numpy_ops.np_array_ops import newaxis # line: 48 +from tensorflow.python.ops.numpy_ops.np_array_ops import nonzero # line: 1324 +from tensorflow.python.ops.numpy_ops.np_array_ops import ones # line: 83 +from tensorflow.python.ops.numpy_ops.np_array_ops import ones_like # line: 91 +from tensorflow.python.ops.numpy_ops.np_array_ops import pad # line: 1018 +from tensorflow.python.ops.numpy_ops.np_array_ops import prod # line: 644 +from tensorflow.python.ops.numpy_ops.np_array_ops import ravel # line: 772 +from tensorflow.python.ops.numpy_ops.np_array_ops import real # line: 779 +from tensorflow.python.ops.numpy_ops.np_array_ops import repeat # line: 788 +from tensorflow.python.ops.numpy_ops.np_array_ops import reshape # line: 843 +from tensorflow.python.ops.numpy_ops.np_array_ops import roll # line: 1458 +from tensorflow.python.ops.numpy_ops.np_array_ops import rot90 # line: 1472 +from tensorflow.python.ops.numpy_ops.np_array_ops import round # line: 1679 +from tensorflow.python.ops.numpy_ops.np_array_ops import select # line: 1077 +from tensorflow.python.ops.numpy_ops.np_array_ops import shape # line: 1095 +from tensorflow.python.ops.numpy_ops.np_array_ops import sign # line: 1580 +from tensorflow.python.ops.numpy_ops.np_array_ops import size # line: 615 +from tensorflow.python.ops.numpy_ops.np_array_ops import split # line: 1152 +from tensorflow.python.ops.numpy_ops.np_array_ops import squeeze # line: 882 +from tensorflow.python.ops.numpy_ops.np_array_ops import stack # line: 1198 +from tensorflow.python.ops.numpy_ops.np_array_ops import std # line: 759 +from tensorflow.python.ops.numpy_ops.np_array_ops import sum # line: 631 +from tensorflow.python.ops.numpy_ops.np_array_ops import swapaxes # line: 914 +from tensorflow.python.ops.numpy_ops.np_array_ops import take # line: 1036 +from tensorflow.python.ops.numpy_ops.np_array_ops import take_along_axis # line: 1602 +from tensorflow.python.ops.numpy_ops.np_array_ops import transpose # line: 905 +from tensorflow.python.ops.numpy_ops.np_array_ops import tri # line: 1353 +from tensorflow.python.ops.numpy_ops.np_array_ops import tril # line: 1383 +from tensorflow.python.ops.numpy_ops.np_array_ops import triu # line: 1408 +from tensorflow.python.ops.numpy_ops.np_array_ops import vander # line: 1493 +from tensorflow.python.ops.numpy_ops.np_array_ops import var # line: 706 +from tensorflow.python.ops.numpy_ops.np_array_ops import vsplit # line: 1181 +from tensorflow.python.ops.numpy_ops.np_array_ops import vstack # line: 1230 +from tensorflow.python.ops.numpy_ops.np_array_ops import where # line: 1064 +from tensorflow.python.ops.numpy_ops.np_array_ops import zeros # line: 65 +from tensorflow.python.ops.numpy_ops.np_array_ops import zeros_like # line: 74 +from tensorflow.python.ops.numpy_ops.np_config import enable_numpy_behavior as experimental_enable_numpy_behavior # line: 25 +from tensorflow.python.ops.numpy_ops.np_dtypes import bool_ # line: 27 +from tensorflow.python.ops.numpy_ops.np_dtypes import complex128 # line: 35 +from tensorflow.python.ops.numpy_ops.np_dtypes import complex64 # line: 39 +from tensorflow.python.ops.numpy_ops.np_dtypes import complex_ # line: 31 +from tensorflow.python.ops.numpy_ops.np_dtypes import float16 # line: 47 +from tensorflow.python.ops.numpy_ops.np_dtypes import float32 # line: 51 +from tensorflow.python.ops.numpy_ops.np_dtypes import float64 # line: 55 +from tensorflow.python.ops.numpy_ops.np_dtypes import float_ # line: 43 +from tensorflow.python.ops.numpy_ops.np_dtypes import iinfo # line: 113 +from tensorflow.python.ops.numpy_ops.np_dtypes import inexact # line: 59 +from tensorflow.python.ops.numpy_ops.np_dtypes import int16 # line: 67 +from tensorflow.python.ops.numpy_ops.np_dtypes import int32 # line: 71 +from tensorflow.python.ops.numpy_ops.np_dtypes import int64 # line: 75 +from tensorflow.python.ops.numpy_ops.np_dtypes import int8 # line: 79 +from tensorflow.python.ops.numpy_ops.np_dtypes import int_ # line: 63 +from tensorflow.python.ops.numpy_ops.np_dtypes import issubdtype # line: 118 +from tensorflow.python.ops.numpy_ops.np_dtypes import object_ # line: 83 +from tensorflow.python.ops.numpy_ops.np_dtypes import string_ # line: 87 +from tensorflow.python.ops.numpy_ops.np_dtypes import uint16 # line: 91 +from tensorflow.python.ops.numpy_ops.np_dtypes import uint32 # line: 95 +from tensorflow.python.ops.numpy_ops.np_dtypes import uint64 # line: 99 +from tensorflow.python.ops.numpy_ops.np_dtypes import uint8 # line: 103 +from tensorflow.python.ops.numpy_ops.np_dtypes import unicode_ # line: 107 +from tensorflow.python.ops.numpy_ops.np_math_ops import abs # line: 698 +from tensorflow.python.ops.numpy_ops.np_math_ops import absolute # line: 704 +from tensorflow.python.ops.numpy_ops.np_math_ops import add # line: 90 +from tensorflow.python.ops.numpy_ops.np_math_ops import allclose # line: 542 +from tensorflow.python.ops.numpy_ops.np_math_ops import angle # line: 852 +from tensorflow.python.ops.numpy_ops.np_math_ops import append # line: 1417 +from tensorflow.python.ops.numpy_ops.np_math_ops import arccos # line: 799 +from tensorflow.python.ops.numpy_ops.np_math_ops import arccosh # line: 817 +from tensorflow.python.ops.numpy_ops.np_math_ops import arcsin # line: 793 +from tensorflow.python.ops.numpy_ops.np_math_ops import arcsinh # line: 811 +from tensorflow.python.ops.numpy_ops.np_math_ops import arctan # line: 805 +from tensorflow.python.ops.numpy_ops.np_math_ops import arctan2 # line: 402 +from tensorflow.python.ops.numpy_ops.np_math_ops import arctanh # line: 823 +from tensorflow.python.ops.numpy_ops.np_math_ops import argmax # line: 1405 +from tensorflow.python.ops.numpy_ops.np_math_ops import argmin # line: 1411 +from tensorflow.python.ops.numpy_ops.np_math_ops import argsort # line: 1340 +from tensorflow.python.ops.numpy_ops.np_math_ops import array_equal # line: 1155 +from tensorflow.python.ops.numpy_ops.np_math_ops import average # line: 1426 +from tensorflow.python.ops.numpy_ops.np_math_ops import bitwise_and # line: 630 +from tensorflow.python.ops.numpy_ops.np_math_ops import bitwise_not # line: 648 +from tensorflow.python.ops.numpy_ops.np_math_ops import bitwise_or # line: 636 +from tensorflow.python.ops.numpy_ops.np_math_ops import bitwise_xor # line: 642 +from tensorflow.python.ops.numpy_ops.np_math_ops import cbrt # line: 868 +from tensorflow.python.ops.numpy_ops.np_math_ops import ceil # line: 716 +from tensorflow.python.ops.numpy_ops.np_math_ops import clip # line: 222 +from tensorflow.python.ops.numpy_ops.np_math_ops import concatenate # line: 1298 +from tensorflow.python.ops.numpy_ops.np_math_ops import conj # line: 728 +from tensorflow.python.ops.numpy_ops.np_math_ops import conjugate # line: 879 +from tensorflow.python.ops.numpy_ops.np_math_ops import cos # line: 763 +from tensorflow.python.ops.numpy_ops.np_math_ops import cosh # line: 781 +from tensorflow.python.ops.numpy_ops.np_math_ops import count_nonzero # line: 1334 +from tensorflow.python.ops.numpy_ops.np_math_ops import cross # line: 289 +from tensorflow.python.ops.numpy_ops.np_math_ops import deg2rad # line: 829 +from tensorflow.python.ops.numpy_ops.np_math_ops import diff # line: 1054 +from tensorflow.python.ops.numpy_ops.np_math_ops import divide # line: 144 +from tensorflow.python.ops.numpy_ops.np_math_ops import divmod # line: 182 +from tensorflow.python.ops.numpy_ops.np_math_ops import dot # line: 60 +from tensorflow.python.ops.numpy_ops.np_math_ops import e # line: 51 +from tensorflow.python.ops.numpy_ops.np_math_ops import einsum # line: 1543 +from tensorflow.python.ops.numpy_ops.np_math_ops import equal # line: 1119 +from tensorflow.python.ops.numpy_ops.np_math_ops import exp # line: 686 +from tensorflow.python.ops.numpy_ops.np_math_ops import exp2 # line: 885 +from tensorflow.python.ops.numpy_ops.np_math_ops import expm1 # line: 894 +from tensorflow.python.ops.numpy_ops.np_math_ops import fabs # line: 710 +from tensorflow.python.ops.numpy_ops.np_math_ops import fix # line: 900 +from tensorflow.python.ops.numpy_ops.np_math_ops import float_power # line: 396 +from tensorflow.python.ops.numpy_ops.np_math_ops import floor # line: 722 +from tensorflow.python.ops.numpy_ops.np_math_ops import floor_divide # line: 150 +from tensorflow.python.ops.numpy_ops.np_math_ops import gcd # line: 588 +from tensorflow.python.ops.numpy_ops.np_math_ops import geomspace # line: 1259 +from tensorflow.python.ops.numpy_ops.np_math_ops import greater # line: 1131 +from tensorflow.python.ops.numpy_ops.np_math_ops import greater_equal # line: 1137 +from tensorflow.python.ops.numpy_ops.np_math_ops import heaviside # line: 414 +from tensorflow.python.ops.numpy_ops.np_math_ops import hypot # line: 430 +from tensorflow.python.ops.numpy_ops.np_math_ops import inf # line: 55 +from tensorflow.python.ops.numpy_ops.np_math_ops import inner # line: 273 +from tensorflow.python.ops.numpy_ops.np_math_ops import isclose # line: 524 +from tensorflow.python.ops.numpy_ops.np_math_ops import iscomplex # line: 909 +from tensorflow.python.ops.numpy_ops.np_math_ops import iscomplexobj # line: 921 +from tensorflow.python.ops.numpy_ops.np_math_ops import isfinite # line: 982 +from tensorflow.python.ops.numpy_ops.np_math_ops import isinf # line: 988 +from tensorflow.python.ops.numpy_ops.np_math_ops import isnan # line: 934 +from tensorflow.python.ops.numpy_ops.np_math_ops import isneginf # line: 996 +from tensorflow.python.ops.numpy_ops.np_math_ops import isposinf # line: 1004 +from tensorflow.python.ops.numpy_ops.np_math_ops import isreal # line: 915 +from tensorflow.python.ops.numpy_ops.np_math_ops import isrealobj # line: 928 +from tensorflow.python.ops.numpy_ops.np_math_ops import kron # line: 436 +from tensorflow.python.ops.numpy_ops.np_math_ops import lcm # line: 595 +from tensorflow.python.ops.numpy_ops.np_math_ops import less # line: 1143 +from tensorflow.python.ops.numpy_ops.np_math_ops import less_equal # line: 1149 +from tensorflow.python.ops.numpy_ops.np_math_ops import linspace # line: 1205 +from tensorflow.python.ops.numpy_ops.np_math_ops import log # line: 680 +from tensorflow.python.ops.numpy_ops.np_math_ops import log10 # line: 1018 +from tensorflow.python.ops.numpy_ops.np_math_ops import log1p # line: 1024 +from tensorflow.python.ops.numpy_ops.np_math_ops import log2 # line: 1012 +from tensorflow.python.ops.numpy_ops.np_math_ops import logaddexp # line: 482 +from tensorflow.python.ops.numpy_ops.np_math_ops import logaddexp2 # line: 494 +from tensorflow.python.ops.numpy_ops.np_math_ops import logical_and # line: 1180 +from tensorflow.python.ops.numpy_ops.np_math_ops import logical_not # line: 1198 +from tensorflow.python.ops.numpy_ops.np_math_ops import logical_or # line: 1186 +from tensorflow.python.ops.numpy_ops.np_math_ops import logical_xor # line: 1192 +from tensorflow.python.ops.numpy_ops.np_math_ops import logspace # line: 1246 +from tensorflow.python.ops.numpy_ops.np_math_ops import matmul # line: 236 +from tensorflow.python.ops.numpy_ops.np_math_ops import maximum # line: 188 +from tensorflow.python.ops.numpy_ops.np_math_ops import meshgrid # line: 1514 +from tensorflow.python.ops.numpy_ops.np_math_ops import minimum # line: 210 +from tensorflow.python.ops.numpy_ops.np_math_ops import mod # line: 163 +from tensorflow.python.ops.numpy_ops.np_math_ops import multiply # line: 108 +from tensorflow.python.ops.numpy_ops.np_math_ops import nanmean # line: 965 +from tensorflow.python.ops.numpy_ops.np_math_ops import nanprod # line: 960 +from tensorflow.python.ops.numpy_ops.np_math_ops import nansum # line: 957 +from tensorflow.python.ops.numpy_ops.np_math_ops import negative # line: 734 +from tensorflow.python.ops.numpy_ops.np_math_ops import nextafter # line: 408 +from tensorflow.python.ops.numpy_ops.np_math_ops import not_equal # line: 1125 +from tensorflow.python.ops.numpy_ops.np_math_ops import outer # line: 472 +from tensorflow.python.ops.numpy_ops.np_math_ops import pi # line: 47 +from tensorflow.python.ops.numpy_ops.np_math_ops import polyval # line: 506 +from tensorflow.python.ops.numpy_ops.np_math_ops import positive # line: 1030 +from tensorflow.python.ops.numpy_ops.np_math_ops import power # line: 390 +from tensorflow.python.ops.numpy_ops.np_math_ops import ptp # line: 1290 +from tensorflow.python.ops.numpy_ops.np_math_ops import rad2deg # line: 838 +from tensorflow.python.ops.numpy_ops.np_math_ops import reciprocal # line: 740 +from tensorflow.python.ops.numpy_ops.np_math_ops import remainder # line: 176 +from tensorflow.python.ops.numpy_ops.np_math_ops import signbit # line: 746 +from tensorflow.python.ops.numpy_ops.np_math_ops import sin # line: 757 +from tensorflow.python.ops.numpy_ops.np_math_ops import sinc # line: 1036 +from tensorflow.python.ops.numpy_ops.np_math_ops import sinh # line: 775 +from tensorflow.python.ops.numpy_ops.np_math_ops import sort # line: 1375 +from tensorflow.python.ops.numpy_ops.np_math_ops import sqrt # line: 692 +from tensorflow.python.ops.numpy_ops.np_math_ops import square # line: 1048 +from tensorflow.python.ops.numpy_ops.np_math_ops import subtract # line: 102 +from tensorflow.python.ops.numpy_ops.np_math_ops import tan # line: 769 +from tensorflow.python.ops.numpy_ops.np_math_ops import tanh # line: 787 +from tensorflow.python.ops.numpy_ops.np_math_ops import tensordot # line: 267 +from tensorflow.python.ops.numpy_ops.np_math_ops import tile # line: 1313 +from tensorflow.python.ops.numpy_ops.np_math_ops import trace # line: 1494 +from tensorflow.python.ops.numpy_ops.np_math_ops import true_divide # line: 120 +from tensorflow.python.ops.numpy_ops.np_math_ops import vdot # line: 379 +from tensorflow.python.ops.numpy_ops.np_utils import finfo # line: 486 +from tensorflow.python.ops.numpy_ops.np_utils import promote_types # line: 564 +from tensorflow.python.ops.numpy_ops.np_utils import result_type # line: 518 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/experimental/numpy/random/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/experimental/numpy/random/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5685f57e5a34b4f331a102216729bf8f07e0ebee --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/experimental/numpy/random/__init__.py @@ -0,0 +1,15 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.experimental.numpy.random namespace +""" + +import sys as _sys + +from tensorflow.python.ops.numpy_ops.np_random import poisson # line: 94 +from tensorflow.python.ops.numpy_ops.np_random import rand # line: 110 +from tensorflow.python.ops.numpy_ops.np_random import randint # line: 116 +from tensorflow.python.ops.numpy_ops.np_random import randn # line: 53 +from tensorflow.python.ops.numpy_ops.np_random import random # line: 104 +from tensorflow.python.ops.numpy_ops.np_random import seed # line: 33 +from tensorflow.python.ops.numpy_ops.np_random import standard_normal # line: 69 +from tensorflow.python.ops.numpy_ops.np_random import uniform # line: 81 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/experimental/tensorrt/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/experimental/tensorrt/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3e715f32cff77d294e77c175d04a19c41ec580cc --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/experimental/tensorrt/__init__.py @@ -0,0 +1,9 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.experimental.tensorrt namespace +""" + +import sys as _sys + +from tensorflow.python.compiler.tensorrt.trt_convert import TrtConversionParams as ConversionParams # line: 135 +from tensorflow.python.compiler.tensorrt.trt_convert import TrtGraphConverterV2 as Converter # line: 1076 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/feature_column/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/feature_column/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..04ca485d32ef9d80ca1fdb6f864272c444dbde00 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/feature_column/__init__.py @@ -0,0 +1,24 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.feature_column namespace +""" + +import sys as _sys + +from tensorflow.python.feature_column.feature_column_v2 import bucketized_column # line: 1124 +from tensorflow.python.feature_column.feature_column_v2 import categorical_column_with_hash_bucket # line: 1211 +from tensorflow.python.feature_column.feature_column_v2 import categorical_column_with_identity # line: 1648 +from tensorflow.python.feature_column.feature_column_v2 import categorical_column_with_vocabulary_file_v2 as categorical_column_with_vocabulary_file # line: 1391 +from tensorflow.python.feature_column.feature_column_v2 import categorical_column_with_vocabulary_list # line: 1529 +from tensorflow.python.feature_column.feature_column_v2 import crossed_column # line: 1849 +from tensorflow.python.feature_column.feature_column_v2 import embedding_column # line: 535 +from tensorflow.python.feature_column.feature_column_v2 import indicator_column # line: 1726 +from tensorflow.python.feature_column.feature_column_v2 import make_parse_example_spec_v2 as make_parse_example_spec # line: 470 +from tensorflow.python.feature_column.feature_column_v2 import numeric_column # line: 1024 +from tensorflow.python.feature_column.feature_column_v2 import shared_embedding_columns_v2 as shared_embeddings # line: 845 +from tensorflow.python.feature_column.feature_column_v2 import weighted_categorical_column # line: 1771 +from tensorflow.python.feature_column.sequence_feature_column import sequence_categorical_column_with_hash_bucket # line: 153 +from tensorflow.python.feature_column.sequence_feature_column import sequence_categorical_column_with_identity # line: 103 +from tensorflow.python.feature_column.sequence_feature_column import sequence_categorical_column_with_vocabulary_file # line: 200 +from tensorflow.python.feature_column.sequence_feature_column import sequence_categorical_column_with_vocabulary_list # line: 270 +from tensorflow.python.feature_column.sequence_feature_column import sequence_numeric_column # line: 337 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/graph_util/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/graph_util/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4563a0266e7ab61d454007c7f8cb7ca7de8bcf4a --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/graph_util/__init__.py @@ -0,0 +1,8 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.graph_util namespace +""" + +import sys as _sys + +from tensorflow.python.framework.importer import import_graph_def # line: 354 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/image/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/image/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fe87a77d1782ca84511ca7355570d527b0cf9a7d --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/image/__init__.py @@ -0,0 +1,78 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.image namespace +""" + +import sys as _sys + +from tensorflow.python.ops.gen_image_ops import hsv_to_rgb # line: 2271 +from tensorflow.python.ops.gen_image_ops import rgb_to_hsv # line: 3276 +from tensorflow.python.ops.array_ops import extract_image_patches_v2 as extract_patches # line: 6416 +from tensorflow.python.ops.image_ops_impl import ResizeMethod # line: 1441 +from tensorflow.python.ops.image_ops_impl import adjust_brightness # line: 2198 +from tensorflow.python.ops.image_ops_impl import adjust_contrast # line: 2251 +from tensorflow.python.ops.image_ops_impl import adjust_gamma # line: 2310 +from tensorflow.python.ops.image_ops_impl import adjust_hue # line: 2734 +from tensorflow.python.ops.image_ops_impl import adjust_jpeg_quality # line: 2920 +from tensorflow.python.ops.image_ops_impl import adjust_saturation # line: 3100 +from tensorflow.python.ops.image_ops_impl import central_crop # line: 857 +from tensorflow.python.ops.image_ops_impl import combined_non_max_suppression # line: 5127 +from tensorflow.python.ops.image_ops_impl import convert_image_dtype # line: 2376 +from tensorflow.python.ops.image_ops_impl import crop_and_resize_v2 as crop_and_resize # line: 4822 +from tensorflow.python.ops.image_ops_impl import crop_to_bounding_box # line: 1168 +from tensorflow.python.ops.image_ops_impl import decode_and_crop_jpeg # line: 3191 +from tensorflow.python.ops.image_ops_impl import decode_bmp # line: 3197 +from tensorflow.python.ops.image_ops_impl import decode_gif # line: 3202 +from tensorflow.python.ops.image_ops_impl import decode_image # line: 3260 +from tensorflow.python.ops.image_ops_impl import decode_jpeg # line: 3207 +from tensorflow.python.ops.image_ops_impl import decode_png # line: 3212 +from tensorflow.python.ops.image_ops_impl import draw_bounding_boxes_v2 as draw_bounding_boxes # line: 5785 +from tensorflow.python.ops.image_ops_impl import encode_jpeg # line: 3218 +from tensorflow.python.ops.image_ops_impl import encode_png # line: 3230 +from tensorflow.python.ops.image_ops_impl import extract_glimpse_v2 as extract_glimpse # line: 5040 +from tensorflow.python.ops.image_ops_impl import extract_jpeg_shape # line: 3223 +from tensorflow.python.ops.image_ops_impl import flip_left_right # line: 546 +from tensorflow.python.ops.image_ops_impl import flip_up_down # line: 581 +from tensorflow.python.ops.image_ops_impl import generate_bounding_box_proposals # line: 5893 +from tensorflow.python.ops.image_ops_impl import grayscale_to_rgb # line: 2597 +from tensorflow.python.ops.image_ops_impl import image_gradients # line: 4604 +from tensorflow.python.ops.image_ops_impl import is_jpeg # line: 3155 +from tensorflow.python.ops.image_ops_impl import non_max_suppression # line: 3775 +from tensorflow.python.ops.image_ops_impl import non_max_suppression_with_overlaps as non_max_suppression_overlaps # line: 3918 +from tensorflow.python.ops.image_ops_impl import non_max_suppression_padded # line: 5395 +from tensorflow.python.ops.image_ops_impl import non_max_suppression_with_scores # line: 3828 +from tensorflow.python.ops.image_ops_impl import pad_to_bounding_box # line: 1004 +from tensorflow.python.ops.image_ops_impl import per_image_standardization # line: 1956 +from tensorflow.python.ops.image_ops_impl import psnr # line: 4159 +from tensorflow.python.ops.image_ops_impl import random_brightness # line: 2015 +from tensorflow.python.ops.image_ops_impl import random_contrast # line: 2105 +from tensorflow.python.ops.image_ops_impl import random_flip_left_right # line: 382 +from tensorflow.python.ops.image_ops_impl import random_flip_up_down # line: 335 +from tensorflow.python.ops.image_ops_impl import random_hue # line: 2634 +from tensorflow.python.ops.image_ops_impl import random_jpeg_quality # line: 2810 +from tensorflow.python.ops.image_ops_impl import random_saturation # line: 2998 +from tensorflow.python.ops.image_ops_impl import resize_images_v2 as resize # line: 1618 +from tensorflow.python.ops.image_ops_impl import resize_image_with_crop_or_pad as resize_with_crop_or_pad # line: 1275 +from tensorflow.python.ops.image_ops_impl import resize_image_with_pad_v2 as resize_with_pad # line: 1915 +from tensorflow.python.ops.image_ops_impl import rgb_to_grayscale # line: 2561 +from tensorflow.python.ops.image_ops_impl import rgb_to_yiq # line: 3972 +from tensorflow.python.ops.image_ops_impl import rgb_to_yuv # line: 4035 +from tensorflow.python.ops.image_ops_impl import rot90 # line: 658 +from tensorflow.python.ops.image_ops_impl import sample_distorted_bounding_box_v2 as sample_distorted_bounding_box # line: 3401 +from tensorflow.python.ops.image_ops_impl import sobel_edges # line: 4678 +from tensorflow.python.ops.image_ops_impl import ssim # line: 4377 +from tensorflow.python.ops.image_ops_impl import ssim_multiscale # line: 4475 +from tensorflow.python.ops.image_ops_impl import stateless_random_brightness # line: 2058 +from tensorflow.python.ops.image_ops_impl import stateless_random_contrast # line: 2151 +from tensorflow.python.ops.image_ops_impl import stateless_random_flip_left_right # line: 430 +from tensorflow.python.ops.image_ops_impl import stateless_random_flip_up_down # line: 461 +from tensorflow.python.ops.image_ops_impl import stateless_random_hue # line: 2683 +from tensorflow.python.ops.image_ops_impl import stateless_random_jpeg_quality # line: 2864 +from tensorflow.python.ops.image_ops_impl import stateless_random_saturation # line: 3050 +from tensorflow.python.ops.image_ops_impl import stateless_sample_distorted_bounding_box # line: 3527 +from tensorflow.python.ops.image_ops_impl import total_variation # line: 3329 +from tensorflow.python.ops.image_ops_impl import transpose # line: 787 +from tensorflow.python.ops.image_ops_impl import yiq_to_rgb # line: 4006 +from tensorflow.python.ops.image_ops_impl import yuv_to_rgb # line: 4065 +from tensorflow.python.ops.random_crop_ops import random_crop # line: 30 +from tensorflow.python.ops.random_crop_ops import stateless_random_crop # line: 85 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/io/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/io/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..37f3426d7ed101468d0b7f1b8610e96e6843ccd8 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/io/__init__.py @@ -0,0 +1,47 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.io namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.io import gfile +from tensorflow.python.ops.gen_decode_proto_ops import decode_proto_v2 as decode_proto # line: 31 +from tensorflow.python.ops.gen_encode_proto_ops import encode_proto # line: 27 +from tensorflow.python.ops.gen_io_ops import matching_files # line: 391 +from tensorflow.python.ops.gen_io_ops import write_file # line: 2269 +from tensorflow.python.ops.gen_parsing_ops import decode_compressed # line: 144 +from tensorflow.python.ops.gen_parsing_ops import parse_tensor # line: 2135 +from tensorflow.python.ops.gen_string_ops import decode_base64 # line: 182 +from tensorflow.python.ops.gen_string_ops import encode_base64 # line: 269 +from tensorflow.python.framework.graph_io import write_graph # line: 28 +from tensorflow.python.lib.io.tf_record import TFRecordOptions # line: 35 +from tensorflow.python.lib.io.tf_record import TFRecordWriter # line: 211 +from tensorflow.python.ops.image_ops_impl import decode_and_crop_jpeg # line: 3191 +from tensorflow.python.ops.image_ops_impl import decode_bmp # line: 3197 +from tensorflow.python.ops.image_ops_impl import decode_gif # line: 3202 +from tensorflow.python.ops.image_ops_impl import decode_image # line: 3260 +from tensorflow.python.ops.image_ops_impl import decode_jpeg # line: 3207 +from tensorflow.python.ops.image_ops_impl import decode_png # line: 3212 +from tensorflow.python.ops.image_ops_impl import encode_jpeg # line: 3218 +from tensorflow.python.ops.image_ops_impl import encode_png # line: 3230 +from tensorflow.python.ops.image_ops_impl import extract_jpeg_shape # line: 3223 +from tensorflow.python.ops.image_ops_impl import is_jpeg # line: 3155 +from tensorflow.python.ops.io_ops import read_file # line: 97 +from tensorflow.python.ops.io_ops import serialize_tensor # line: 137 +from tensorflow.python.ops.parsing_config import FixedLenFeature # line: 298 +from tensorflow.python.ops.parsing_config import FixedLenSequenceFeature # line: 318 +from tensorflow.python.ops.parsing_config import RaggedFeature # line: 54 +from tensorflow.python.ops.parsing_config import SparseFeature # line: 223 +from tensorflow.python.ops.parsing_config import VarLenFeature # line: 44 +from tensorflow.python.ops.parsing_ops import decode_csv_v2 as decode_csv # line: 1073 +from tensorflow.python.ops.parsing_ops import decode_json_example # line: 1152 +from tensorflow.python.ops.parsing_ops import decode_raw # line: 843 +from tensorflow.python.ops.parsing_ops import parse_example_v2 as parse_example # line: 77 +from tensorflow.python.ops.parsing_ops import parse_sequence_example # line: 452 +from tensorflow.python.ops.parsing_ops import parse_single_example_v2 as parse_single_example # line: 410 +from tensorflow.python.ops.parsing_ops import parse_single_sequence_example # line: 696 +from tensorflow.python.ops.sparse_ops import deserialize_many_sparse # line: 2356 +from tensorflow.python.ops.sparse_ops import serialize_many_sparse_v2 as serialize_many_sparse # line: 2254 +from tensorflow.python.ops.sparse_ops import serialize_sparse_v2 as serialize_sparse # line: 2197 +from tensorflow.python.training.input import match_filenames_once # line: 56 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/io/gfile/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/io/gfile/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4b1002208d271902ed287a4257c76fa848edb1f2 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/io/gfile/__init__.py @@ -0,0 +1,22 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.io.gfile namespace +""" + +import sys as _sys + +from tensorflow.python.lib.io.file_io import copy_v2 as copy # line: 516 +from tensorflow.python.lib.io.file_io import file_exists_v2 as exists # line: 249 +from tensorflow.python.lib.io.file_io import get_registered_schemes # line: 980 +from tensorflow.python.lib.io.file_io import get_matching_files_v2 as glob # line: 385 +from tensorflow.python.lib.io.file_io import is_directory_v2 as isdir # line: 692 +from tensorflow.python.lib.io.file_io import join # line: 781 +from tensorflow.python.lib.io.file_io import list_directory_v2 as listdir # line: 751 +from tensorflow.python.lib.io.file_io import recursive_create_dir_v2 as makedirs # line: 501 +from tensorflow.python.lib.io.file_io import create_dir_v2 as mkdir # line: 470 +from tensorflow.python.lib.io.file_io import delete_file_v2 as remove # line: 318 +from tensorflow.python.lib.io.file_io import rename_v2 as rename # line: 609 +from tensorflow.python.lib.io.file_io import delete_recursively_v2 as rmtree # line: 666 +from tensorflow.python.lib.io.file_io import stat_v2 as stat # line: 911 +from tensorflow.python.lib.io.file_io import walk_v2 as walk # line: 837 +from tensorflow.python.platform.gfile import GFile # line: 36 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/linalg/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/linalg/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fa3ca6858e1d8f82e9b2c0dcee68d13304bc9dfd --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/linalg/__init__.py @@ -0,0 +1,76 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.linalg namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.linalg import experimental +from tensorflow.python.ops.gen_array_ops import matrix_band_part as band_part # line: 4879 +from tensorflow.python.ops.gen_array_ops import diag as tensor_diag # line: 1949 +from tensorflow.python.ops.gen_linalg_ops import cholesky # line: 766 +from tensorflow.python.ops.gen_linalg_ops import matrix_determinant as det # line: 1370 +from tensorflow.python.ops.gen_linalg_ops import matrix_inverse as inv # line: 1516 +from tensorflow.python.ops.gen_linalg_ops import lu # line: 1252 +from tensorflow.python.ops.gen_linalg_ops import qr # line: 2150 +from tensorflow.python.ops.gen_linalg_ops import matrix_solve as solve # line: 1694 +from tensorflow.python.ops.gen_linalg_ops import matrix_square_root as sqrtm # line: 1913 +from tensorflow.python.ops.gen_math_ops import cross # line: 2651 +from tensorflow.python.ops.array_ops import matrix_diag as diag # line: 2322 +from tensorflow.python.ops.array_ops import matrix_diag_part as diag_part # line: 2491 +from tensorflow.python.ops.array_ops import matrix_transpose # line: 2242 +from tensorflow.python.ops.array_ops import matrix_set_diag as set_diag # line: 2679 +from tensorflow.python.ops.array_ops import tensor_diag_part # line: 2634 +from tensorflow.python.ops.clip_ops import global_norm # line: 235 +from tensorflow.python.ops.linalg.linalg_impl import adjoint # line: 102 +from tensorflow.python.ops.linalg.linalg_impl import banded_triangular_solve # line: 350 +from tensorflow.python.ops.linalg.linalg_impl import eigh_tridiagonal # line: 1232 +from tensorflow.python.ops.linalg.linalg_impl import matrix_exponential as expm # line: 232 +from tensorflow.python.ops.linalg.linalg_impl import logdet # line: 68 +from tensorflow.python.ops.linalg.linalg_impl import logm # line: 54 +from tensorflow.python.ops.linalg.linalg_impl import lu_matrix_inverse # line: 1035 +from tensorflow.python.ops.linalg.linalg_impl import lu_reconstruct # line: 1100 +from tensorflow.python.ops.linalg.linalg_impl import lu_solve # line: 937 +from tensorflow.python.ops.linalg.linalg_impl import matrix_rank # line: 768 +from tensorflow.python.ops.linalg.linalg_impl import pinv # line: 807 +from tensorflow.python.ops.linalg.linalg_impl import slogdet # line: 44 +from tensorflow.python.ops.linalg.linalg_impl import tridiagonal_matmul # line: 670 +from tensorflow.python.ops.linalg.linalg_impl import tridiagonal_solve # line: 446 +from tensorflow.python.ops.linalg.linear_operator import LinearOperator # line: 91 +from tensorflow.python.ops.linalg.linear_operator_adjoint import LinearOperatorAdjoint # line: 28 +from tensorflow.python.ops.linalg.linear_operator_block_diag import LinearOperatorBlockDiag # line: 34 +from tensorflow.python.ops.linalg.linear_operator_block_lower_triangular import LinearOperatorBlockLowerTriangular # line: 39 +from tensorflow.python.ops.linalg.linear_operator_circulant import LinearOperatorCirculant # line: 740 +from tensorflow.python.ops.linalg.linear_operator_circulant import LinearOperatorCirculant2D # line: 1035 +from tensorflow.python.ops.linalg.linear_operator_circulant import LinearOperatorCirculant3D # line: 1264 +from tensorflow.python.ops.linalg.linear_operator_composition import LinearOperatorComposition # line: 35 +from tensorflow.python.ops.linalg.linear_operator_diag import LinearOperatorDiag # line: 32 +from tensorflow.python.ops.linalg.linear_operator_full_matrix import LinearOperatorFullMatrix # line: 29 +from tensorflow.python.ops.linalg.linear_operator_householder import LinearOperatorHouseholder # line: 32 +from tensorflow.python.ops.linalg.linear_operator_identity import LinearOperatorIdentity # line: 101 +from tensorflow.python.ops.linalg.linear_operator_identity import LinearOperatorScaledIdentity # line: 538 +from tensorflow.python.ops.linalg.linear_operator_inversion import LinearOperatorInversion # line: 25 +from tensorflow.python.ops.linalg.linear_operator_kronecker import LinearOperatorKronecker # line: 60 +from tensorflow.python.ops.linalg.linear_operator_low_rank_update import LinearOperatorLowRankUpdate # line: 35 +from tensorflow.python.ops.linalg.linear_operator_lower_triangular import LinearOperatorLowerTriangular # line: 31 +from tensorflow.python.ops.linalg.linear_operator_permutation import LinearOperatorPermutation # line: 35 +from tensorflow.python.ops.linalg.linear_operator_toeplitz import LinearOperatorToeplitz # line: 33 +from tensorflow.python.ops.linalg.linear_operator_tridiag import LinearOperatorTridiag # line: 39 +from tensorflow.python.ops.linalg.linear_operator_zeros import LinearOperatorZeros # line: 39 +from tensorflow.python.ops.linalg_ops import cholesky_solve # line: 147 +from tensorflow.python.ops.linalg_ops import eig # line: 382 +from tensorflow.python.ops.linalg_ops import self_adjoint_eig as eigh # line: 441 +from tensorflow.python.ops.linalg_ops import eigvals # line: 414 +from tensorflow.python.ops.linalg_ops import self_adjoint_eigvals as eigvalsh # line: 465 +from tensorflow.python.ops.linalg_ops import eye # line: 196 +from tensorflow.python.ops.linalg_ops import matrix_solve_ls as lstsq # line: 244 +from tensorflow.python.ops.linalg_ops import norm_v2 as norm # line: 561 +from tensorflow.python.ops.linalg_ops import svd # line: 489 +from tensorflow.python.ops.linalg_ops import matrix_triangular_solve as triangular_solve # line: 84 +from tensorflow.python.ops.math_ops import matmul # line: 3617 +from tensorflow.python.ops.math_ops import matvec # line: 3846 +from tensorflow.python.ops.math_ops import tensordot # line: 5152 +from tensorflow.python.ops.math_ops import trace # line: 3573 +from tensorflow.python.ops.nn_impl import l2_normalize # line: 540 +from tensorflow.python.ops.nn_impl import normalize # line: 487 +from tensorflow.python.ops.special_math_ops import einsum # line: 618 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/linalg/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/linalg/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..07230e4ec118e2fe89f8c47ef1ebd82d438299e0 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/linalg/experimental/__init__.py @@ -0,0 +1,8 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.linalg.experimental namespace +""" + +import sys as _sys + +from tensorflow.python.ops.linalg.sparse.conjugate_gradient import conjugate_gradient # line: 30 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/lite/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/lite/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..627b6732f6672566107824ca8f23cb0e381afff0 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/lite/__init__.py @@ -0,0 +1,14 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.lite namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.lite import experimental +from tensorflow.lite.python.convert import OpsSet # line: 169 +from tensorflow.lite.python.interpreter import Interpreter # line: 348 +from tensorflow.lite.python.lite import Optimize # line: 100 +from tensorflow.lite.python.lite import RepresentativeDataset # line: 160 +from tensorflow.lite.python.lite import TFLiteConverterV2 as TFLiteConverter # line: 1915 +from tensorflow.lite.python.lite import TargetSpec # line: 184 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/lite/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/lite/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..eba353df1766ee44be0704e9715a0c5e121fa350 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/lite/experimental/__init__.py @@ -0,0 +1,13 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.lite.experimental namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.lite.experimental import authoring +from tensorflow.lite.python.analyzer import ModelAnalyzer as Analyzer # line: 35 +from tensorflow.lite.python.interpreter import OpResolverType # line: 303 +from tensorflow.lite.python.interpreter import load_delegate # line: 125 +from tensorflow.lite.tools.optimize.debugging.python.debugger import QuantizationDebugOptions # line: 56 +from tensorflow.lite.tools.optimize.debugging.python.debugger import QuantizationDebugger # line: 120 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/lite/experimental/authoring/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/lite/experimental/authoring/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9ab1119e08d20c12ae992ae4e2e34f6568a1541a --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/lite/experimental/authoring/__init__.py @@ -0,0 +1,8 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.lite.experimental.authoring namespace +""" + +import sys as _sys + +from tensorflow.lite.python.authoring.authoring import compatible # line: 265 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/lookup/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/lookup/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bb55cdad83de372fb4e3f4a755aa7c35d1986f4d --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/lookup/__init__.py @@ -0,0 +1,13 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.lookup namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.lookup import experimental +from tensorflow.python.ops.lookup_ops import KeyValueTensorInitializer # line: 519 +from tensorflow.python.ops.lookup_ops import StaticHashTable # line: 281 +from tensorflow.python.ops.lookup_ops import StaticVocabularyTable # line: 1188 +from tensorflow.python.ops.lookup_ops import TextFileIndex # line: 587 +from tensorflow.python.ops.lookup_ops import TextFileInitializer # line: 607 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/lookup/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/lookup/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1f3366bd1230a95f2a66ffb086f8d7aa3be7add3 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/lookup/experimental/__init__.py @@ -0,0 +1,9 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.lookup.experimental namespace +""" + +import sys as _sys + +from tensorflow.python.ops.lookup_ops import DenseHashTable # line: 2108 +from tensorflow.python.ops.lookup_ops import MutableHashTable # line: 1796 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/math/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/math/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..afea648baa72b24a06c1713840a5c33bb41008d9 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/math/__init__.py @@ -0,0 +1,139 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.math namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.math import special +from tensorflow.python.ops.gen_array_ops import invert_permutation # line: 4592 +from tensorflow.python.ops.gen_math_ops import acosh # line: 231 +from tensorflow.python.ops.gen_math_ops import asin # line: 991 +from tensorflow.python.ops.gen_math_ops import asinh # line: 1091 +from tensorflow.python.ops.gen_math_ops import atan # line: 1184 +from tensorflow.python.ops.gen_math_ops import atan2 # line: 1284 +from tensorflow.python.ops.gen_math_ops import atanh # line: 1383 +from tensorflow.python.ops.gen_math_ops import betainc # line: 1787 +from tensorflow.python.ops.gen_math_ops import cos # line: 2464 +from tensorflow.python.ops.gen_math_ops import cosh # line: 2558 +from tensorflow.python.ops.gen_math_ops import digamma # line: 3161 +from tensorflow.python.ops.gen_math_ops import erf # line: 3454 +from tensorflow.python.ops.gen_math_ops import erfc # line: 3546 +from tensorflow.python.ops.gen_math_ops import expm1 # line: 3847 +from tensorflow.python.ops.gen_math_ops import floor_mod as floormod # line: 4092 +from tensorflow.python.ops.gen_math_ops import greater # line: 4186 +from tensorflow.python.ops.gen_math_ops import greater_equal # line: 4287 +from tensorflow.python.ops.gen_math_ops import igamma # line: 4480 +from tensorflow.python.ops.gen_math_ops import igammac # line: 4639 +from tensorflow.python.ops.gen_math_ops import is_finite # line: 4935 +from tensorflow.python.ops.gen_math_ops import is_inf # line: 5031 +from tensorflow.python.ops.gen_math_ops import is_nan # line: 5127 +from tensorflow.python.ops.gen_math_ops import less # line: 5223 +from tensorflow.python.ops.gen_math_ops import less_equal # line: 5324 +from tensorflow.python.ops.gen_math_ops import lgamma # line: 5425 +from tensorflow.python.ops.gen_math_ops import log # line: 5595 +from tensorflow.python.ops.gen_math_ops import log1p # line: 5689 +from tensorflow.python.ops.gen_math_ops import logical_and # line: 5779 +from tensorflow.python.ops.gen_math_ops import logical_not # line: 5918 +from tensorflow.python.ops.gen_math_ops import logical_or # line: 6005 +from tensorflow.python.ops.gen_math_ops import maximum # line: 6310 +from tensorflow.python.ops.gen_math_ops import minimum # line: 6566 +from tensorflow.python.ops.gen_math_ops import floor_mod as mod # line: 4092 +from tensorflow.python.ops.gen_math_ops import neg as negative # line: 6913 +from tensorflow.python.ops.gen_math_ops import next_after as nextafter # line: 6999 +from tensorflow.python.ops.gen_math_ops import polygamma # line: 7167 +from tensorflow.python.ops.gen_math_ops import reciprocal # line: 8159 +from tensorflow.python.ops.gen_math_ops import rint # line: 8656 +from tensorflow.python.ops.gen_math_ops import segment_max # line: 8930 +from tensorflow.python.ops.gen_math_ops import segment_mean # line: 9164 +from tensorflow.python.ops.gen_math_ops import segment_min # line: 9289 +from tensorflow.python.ops.gen_math_ops import segment_prod # line: 9523 +from tensorflow.python.ops.gen_math_ops import segment_sum # line: 9749 +from tensorflow.python.ops.gen_math_ops import sin # line: 10299 +from tensorflow.python.ops.gen_math_ops import sinh # line: 10392 +from tensorflow.python.ops.gen_math_ops import square # line: 11962 +from tensorflow.python.ops.gen_math_ops import squared_difference # line: 12051 +from tensorflow.python.ops.gen_math_ops import tan # line: 12352 +from tensorflow.python.ops.gen_math_ops import tanh # line: 12446 +from tensorflow.python.ops.gen_math_ops import unsorted_segment_max # line: 12789 +from tensorflow.python.ops.gen_math_ops import unsorted_segment_min # line: 12927 +from tensorflow.python.ops.gen_math_ops import unsorted_segment_prod # line: 13061 +from tensorflow.python.ops.gen_math_ops import unsorted_segment_sum # line: 13195 +from tensorflow.python.ops.gen_math_ops import xlogy # line: 13444 +from tensorflow.python.ops.gen_math_ops import zeta # line: 13530 +from tensorflow.python.ops.gen_nn_ops import softsign # line: 12232 +from tensorflow.python.ops.bincount_ops import bincount # line: 29 +from tensorflow.python.ops.check_ops import is_non_decreasing # line: 1986 +from tensorflow.python.ops.check_ops import is_strictly_increasing # line: 2028 +from tensorflow.python.ops.confusion_matrix import confusion_matrix # line: 92 +from tensorflow.python.ops.math_ops import abs # line: 365 +from tensorflow.python.ops.math_ops import accumulate_n # line: 4161 +from tensorflow.python.ops.math_ops import acos # line: 5747 +from tensorflow.python.ops.math_ops import add # line: 4020 +from tensorflow.python.ops.math_ops import add_n # line: 4101 +from tensorflow.python.ops.math_ops import angle # line: 869 +from tensorflow.python.ops.math_ops import argmax_v2 as argmax # line: 268 +from tensorflow.python.ops.math_ops import argmin_v2 as argmin # line: 322 +from tensorflow.python.ops.math_ops import ceil # line: 5577 +from tensorflow.python.ops.math_ops import conj # line: 4534 +from tensorflow.python.ops.math_ops import count_nonzero_v2 as count_nonzero # line: 2570 +from tensorflow.python.ops.math_ops import cumprod # line: 4424 +from tensorflow.python.ops.math_ops import cumsum # line: 4352 +from tensorflow.python.ops.math_ops import cumulative_logsumexp # line: 4478 +from tensorflow.python.ops.math_ops import divide # line: 446 +from tensorflow.python.ops.math_ops import div_no_nan as divide_no_nan # line: 1696 +from tensorflow.python.ops.math_ops import equal # line: 2003 +from tensorflow.python.ops.math_ops import erfcinv # line: 5547 +from tensorflow.python.ops.math_ops import erfinv # line: 5512 +from tensorflow.python.ops.math_ops import exp # line: 5644 +from tensorflow.python.ops.math_ops import floor # line: 5778 +from tensorflow.python.ops.math_ops import floordiv # line: 1804 +from tensorflow.python.ops.math_ops import imag # line: 835 +from tensorflow.python.ops.math_ops import log_sigmoid # line: 4307 +from tensorflow.python.ops.math_ops import logical_xor # line: 1904 +from tensorflow.python.ops.math_ops import multiply # line: 481 +from tensorflow.python.ops.math_ops import multiply_no_nan # line: 1751 +from tensorflow.python.ops.math_ops import ndtri # line: 5531 +from tensorflow.python.ops.math_ops import not_equal # line: 2040 +from tensorflow.python.ops.math_ops import polyval # line: 5334 +from tensorflow.python.ops.math_ops import pow # line: 669 +from tensorflow.python.ops.math_ops import real # line: 794 +from tensorflow.python.ops.math_ops import reciprocal_no_nan # line: 5406 +from tensorflow.python.ops.math_ops import reduce_all # line: 3306 +from tensorflow.python.ops.math_ops import reduce_any # line: 3412 +from tensorflow.python.ops.math_ops import reduce_euclidean_norm # line: 2447 +from tensorflow.python.ops.math_ops import reduce_logsumexp # line: 3517 +from tensorflow.python.ops.math_ops import reduce_max # line: 3187 +from tensorflow.python.ops.math_ops import reduce_mean # line: 2713 +from tensorflow.python.ops.math_ops import reduce_min # line: 3059 +from tensorflow.python.ops.math_ops import reduce_prod # line: 2887 +from tensorflow.python.ops.math_ops import reduce_std # line: 2836 +from tensorflow.python.ops.math_ops import reduce_sum # line: 2369 +from tensorflow.python.ops.math_ops import reduce_variance # line: 2773 +from tensorflow.python.ops.math_ops import round # line: 914 +from tensorflow.python.ops.math_ops import rsqrt # line: 5722 +from tensorflow.python.ops.math_ops import scalar_mul_v2 as scalar_mul # line: 660 +from tensorflow.python.ops.math_ops import sigmoid # line: 4254 +from tensorflow.python.ops.math_ops import sign # line: 747 +from tensorflow.python.ops.math_ops import sobol_sample # line: 5697 +from tensorflow.python.ops.math_ops import softplus # line: 634 +from tensorflow.python.ops.math_ops import sqrt # line: 5605 +from tensorflow.python.ops.math_ops import subtract # line: 545 +from tensorflow.python.ops.math_ops import truediv # line: 1630 +from tensorflow.python.ops.math_ops import unsorted_segment_mean # line: 4657 +from tensorflow.python.ops.math_ops import unsorted_segment_sqrt_n # line: 4712 +from tensorflow.python.ops.math_ops import xdivy # line: 5440 +from tensorflow.python.ops.math_ops import xlog1py # line: 5474 +from tensorflow.python.ops.nn_impl import l2_normalize # line: 540 +from tensorflow.python.ops.nn_impl import zero_fraction # line: 620 +from tensorflow.python.ops.nn_ops import approx_max_k # line: 5882 +from tensorflow.python.ops.nn_ops import approx_min_k # line: 5945 +from tensorflow.python.ops.nn_ops import in_top_k_v2 as in_top_k # line: 6567 +from tensorflow.python.ops.nn_ops import log_softmax_v2 as log_softmax # line: 3955 +from tensorflow.python.ops.nn_ops import softmax_v2 as softmax # line: 3869 +from tensorflow.python.ops.nn_ops import top_k # line: 5815 +from tensorflow.python.ops.special_math_ops import bessel_i0 # line: 253 +from tensorflow.python.ops.special_math_ops import bessel_i0e # line: 282 +from tensorflow.python.ops.special_math_ops import bessel_i1 # line: 309 +from tensorflow.python.ops.special_math_ops import bessel_i1e # line: 338 +from tensorflow.python.ops.special_math_ops import lbeta # line: 45 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/math/special/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/math/special/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f90e74566d849fe62d8b2dd68c8ade4a890d56c4 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/math/special/__init__.py @@ -0,0 +1,24 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.math.special namespace +""" + +import sys as _sys + +from tensorflow.python.ops.special_math_ops import bessel_i0 # line: 253 +from tensorflow.python.ops.special_math_ops import bessel_i0e # line: 282 +from tensorflow.python.ops.special_math_ops import bessel_i1 # line: 309 +from tensorflow.python.ops.special_math_ops import bessel_i1e # line: 338 +from tensorflow.python.ops.special_math_ops import bessel_j0 # line: 477 +from tensorflow.python.ops.special_math_ops import bessel_j1 # line: 504 +from tensorflow.python.ops.special_math_ops import bessel_k0 # line: 365 +from tensorflow.python.ops.special_math_ops import bessel_k0e # line: 394 +from tensorflow.python.ops.special_math_ops import bessel_k1 # line: 421 +from tensorflow.python.ops.special_math_ops import bessel_k1e # line: 450 +from tensorflow.python.ops.special_math_ops import bessel_y0 # line: 531 +from tensorflow.python.ops.special_math_ops import bessel_y1 # line: 558 +from tensorflow.python.ops.special_math_ops import dawsn # line: 101 +from tensorflow.python.ops.special_math_ops import expint # line: 132 +from tensorflow.python.ops.special_math_ops import fresnel_cos # line: 162 +from tensorflow.python.ops.special_math_ops import fresnel_sin # line: 193 +from tensorflow.python.ops.special_math_ops import spence # line: 223 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/mlir/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/mlir/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4f6575e39364955831a77ff2140cd77cf5851df8 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/mlir/__init__.py @@ -0,0 +1,8 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.mlir namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.mlir import experimental diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/mlir/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/mlir/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7ded7e7a94c56a4b895a5afb4a57299715c2d629 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/mlir/experimental/__init__.py @@ -0,0 +1,14 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.mlir.experimental namespace +""" + +import sys as _sys + +from tensorflow.python.compiler.mlir.mlir import convert_function # line: 48 +from tensorflow.python.compiler.mlir.mlir import convert_graph_def # line: 21 +from tensorflow.python.compiler.mlir.mlir import convert_saved_model # line: 95 +from tensorflow.python.compiler.mlir.mlir import convert_saved_model_v1 # line: 115 +from tensorflow.python.compiler.mlir.mlir import run_pass_pipeline # line: 152 +from tensorflow.python.compiler.mlir.mlir import tflite_to_tosa_bytecode # line: 181 +from tensorflow.python.compiler.mlir.mlir import experimental_write_bytecode as write_bytecode # line: 170 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/nest/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/nest/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c829f8ac1920d3cf8ce03d31a156fef83658a062 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/nest/__init__.py @@ -0,0 +1,12 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.nest namespace +""" + +import sys as _sys + +from tensorflow.python.util.nest import assert_same_structure # line: 301 +from tensorflow.python.util.nest import flatten # line: 201 +from tensorflow.python.util.nest import is_nested # line: 166 +from tensorflow.python.util.nest import map_structure # line: 545 +from tensorflow.python.util.nest import pack_sequence_as # line: 426 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/nn/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/nn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d43b3ee2c934ebb42a36ce979ef8ccbc22b6ed8c --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/nn/__init__.py @@ -0,0 +1,97 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.nn namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.nn import experimental +from tensorflow.python.ops.gen_math_ops import tanh # line: 12446 +from tensorflow.python.ops.gen_nn_ops import elu # line: 3783 +from tensorflow.python.ops.gen_nn_ops import l2_loss # line: 5717 +from tensorflow.python.ops.gen_nn_ops import lrn as local_response_normalization # line: 5806 +from tensorflow.python.ops.gen_nn_ops import lrn # line: 5806 +from tensorflow.python.ops.gen_nn_ops import relu # line: 11562 +from tensorflow.python.ops.gen_nn_ops import selu # line: 11829 +from tensorflow.python.ops.gen_nn_ops import softsign # line: 12232 +from tensorflow.python.keras.layers.rnn_cell_wrapper_v2 import DeviceWrapper as RNNCellDeviceWrapper # line: 123 +from tensorflow.python.keras.layers.rnn_cell_wrapper_v2 import DropoutWrapper as RNNCellDropoutWrapper # line: 95 +from tensorflow.python.keras.layers.rnn_cell_wrapper_v2 import ResidualWrapper as RNNCellResidualWrapper # line: 111 +from tensorflow.python.ops.array_ops import depth_to_space_v2 as depth_to_space # line: 4069 +from tensorflow.python.ops.array_ops import space_to_batch_v2 as space_to_batch # line: 4031 +from tensorflow.python.ops.array_ops import space_to_depth_v2 as space_to_depth # line: 4050 +from tensorflow.python.ops.candidate_sampling_ops import all_candidate_sampler # line: 430 +from tensorflow.python.ops.candidate_sampling_ops import compute_accidental_hits # line: 466 +from tensorflow.python.ops.candidate_sampling_ops import fixed_unigram_candidate_sampler # line: 306 +from tensorflow.python.ops.candidate_sampling_ops import learned_unigram_candidate_sampler # line: 212 +from tensorflow.python.ops.ctc_ops import collapse_repeated # line: 1175 +from tensorflow.python.ops.ctc_ops import ctc_beam_search_decoder_v2 as ctc_beam_search_decoder # line: 449 +from tensorflow.python.ops.ctc_ops import ctc_greedy_decoder # line: 300 +from tensorflow.python.ops.ctc_ops import ctc_loss_v3 as ctc_loss # line: 886 +from tensorflow.python.ops.ctc_ops import ctc_unique_labels # line: 1273 +from tensorflow.python.ops.embedding_ops import embedding_lookup_v2 as embedding_lookup # line: 371 +from tensorflow.python.ops.embedding_ops import embedding_lookup_sparse_v2 as embedding_lookup_sparse # line: 575 +from tensorflow.python.ops.embedding_ops import safe_embedding_lookup_sparse_v2 as safe_embedding_lookup_sparse # line: 734 +from tensorflow.python.ops.math_ops import sigmoid # line: 4254 +from tensorflow.python.ops.math_ops import softplus # line: 634 +from tensorflow.python.ops.nn_impl import batch_norm_with_global_normalization_v2 as batch_norm_with_global_normalization # line: 1649 +from tensorflow.python.ops.nn_impl import batch_normalization # line: 1420 +from tensorflow.python.ops.nn_impl import depthwise_conv2d_v2 as depthwise_conv2d # line: 792 +from tensorflow.python.ops.nn_impl import l2_normalize # line: 540 +from tensorflow.python.ops.nn_impl import log_poisson_loss # line: 43 +from tensorflow.python.ops.nn_impl import moments_v2 as moments # line: 1281 +from tensorflow.python.ops.nn_impl import nce_loss_v2 as nce_loss # line: 1900 +from tensorflow.python.ops.nn_impl import normalize_moments # line: 1182 +from tensorflow.python.ops.nn_impl import sampled_softmax_loss_v2 as sampled_softmax_loss # line: 2117 +from tensorflow.python.ops.nn_impl import separable_conv2d_v2 as separable_conv2d # line: 1001 +from tensorflow.python.ops.nn_impl import sigmoid_cross_entropy_with_logits_v2 as sigmoid_cross_entropy_with_logits # line: 150 +from tensorflow.python.ops.nn_impl import swish as silu # line: 430 +from tensorflow.python.ops.nn_impl import sufficient_statistics_v2 as sufficient_statistics # line: 1152 +from tensorflow.python.ops.nn_impl import swish # line: 430 +from tensorflow.python.ops.nn_impl import weighted_cross_entropy_with_logits_v2 as weighted_cross_entropy_with_logits # line: 249 +from tensorflow.python.ops.nn_impl import weighted_moments_v2 as weighted_moments # line: 1395 +from tensorflow.python.ops.nn_impl import zero_fraction # line: 620 +from tensorflow.python.ops.nn_impl_distribute import compute_average_loss # line: 70 +from tensorflow.python.ops.nn_impl_distribute import scale_regularization_loss # line: 27 +from tensorflow.python.ops.nn_ops import approx_max_k # line: 5882 +from tensorflow.python.ops.nn_ops import approx_min_k # line: 5945 +from tensorflow.python.ops.nn_ops import atrous_conv2d # line: 1790 +from tensorflow.python.ops.nn_ops import atrous_conv2d_transpose # line: 2814 +from tensorflow.python.ops.nn_ops import avg_pool_v2 as avg_pool # line: 4463 +from tensorflow.python.ops.nn_ops import avg_pool1d # line: 4616 +from tensorflow.python.ops.nn_ops import avg_pool2d # line: 4575 +from tensorflow.python.ops.nn_ops import avg_pool3d # line: 4663 +from tensorflow.python.ops.nn_ops import bias_add # line: 3516 +from tensorflow.python.ops.nn_ops import conv1d_v2 as conv1d # line: 2099 +from tensorflow.python.ops.nn_ops import conv1d_transpose # line: 2169 +from tensorflow.python.ops.nn_ops import conv2d_v2 as conv2d # line: 2260 +from tensorflow.python.ops.nn_ops import conv2d_transpose_v2 as conv2d_transpose # line: 2692 +from tensorflow.python.ops.nn_ops import conv3d_v2 as conv3d # line: 3239 +from tensorflow.python.ops.nn_ops import conv3d_transpose_v2 as conv3d_transpose # line: 3347 +from tensorflow.python.ops.nn_ops import conv_transpose # line: 3428 +from tensorflow.python.ops.nn_ops import convolution_v2 as convolution # line: 1176 +from tensorflow.python.ops.nn_ops import crelu_v2 as crelu # line: 3623 +from tensorflow.python.ops.nn_ops import depthwise_conv2d_native_backprop_filter as depthwise_conv2d_backprop_filter # line: 3126 +from tensorflow.python.ops.nn_ops import depthwise_conv2d_native_backprop_input as depthwise_conv2d_backprop_input # line: 3054 +from tensorflow.python.ops.nn_ops import dilation2d_v2 as dilation2d # line: 482 +from tensorflow.python.ops.nn_ops import dropout_v2 as dropout # line: 5425 +from tensorflow.python.ops.nn_ops import erosion2d_v2 as erosion2d # line: 6459 +from tensorflow.python.ops.nn_ops import fractional_avg_pool_v2 as fractional_avg_pool # line: 6321 +from tensorflow.python.ops.nn_ops import fractional_max_pool_v2 as fractional_max_pool # line: 6141 +from tensorflow.python.ops.nn_ops import gelu # line: 3702 +from tensorflow.python.ops.nn_ops import in_top_k_v2 as in_top_k # line: 6567 +from tensorflow.python.ops.nn_ops import isotonic_regression # line: 6617 +from tensorflow.python.ops.nn_ops import leaky_relu # line: 3667 +from tensorflow.python.ops.nn_ops import log_softmax_v2 as log_softmax # line: 3955 +from tensorflow.python.ops.nn_ops import max_pool_v2 as max_pool # line: 4705 +from tensorflow.python.ops.nn_ops import max_pool1d # line: 4911 +from tensorflow.python.ops.nn_ops import max_pool2d # line: 4971 +from tensorflow.python.ops.nn_ops import max_pool3d # line: 5084 +from tensorflow.python.ops.nn_ops import max_pool_with_argmax_v2 as max_pool_with_argmax # line: 5128 +from tensorflow.python.ops.nn_ops import pool_v2 as pool # line: 1689 +from tensorflow.python.ops.nn_ops import relu6 # line: 3630 +from tensorflow.python.ops.nn_ops import softmax_v2 as softmax # line: 3869 +from tensorflow.python.ops.nn_ops import softmax_cross_entropy_with_logits_v2 as softmax_cross_entropy_with_logits # line: 3989 +from tensorflow.python.ops.nn_ops import sparse_softmax_cross_entropy_with_logits_v2 as sparse_softmax_cross_entropy_with_logits # line: 4402 +from tensorflow.python.ops.nn_ops import top_k # line: 5815 +from tensorflow.python.ops.nn_ops import with_space_to_batch # line: 572 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/nn/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/nn/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..47fa94d259f19d723898910f486905ac0faf5708 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/nn/experimental/__init__.py @@ -0,0 +1,9 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.nn.experimental namespace +""" + +import sys as _sys + +from tensorflow.python.ops.nn_ops import general_dropout # line: 5664 +from tensorflow.python.ops.nn_ops import stateless_dropout # line: 5520 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/profiler/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/profiler/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..976dcfe68a814a35f27073e66fa1c05e71434f04 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/profiler/__init__.py @@ -0,0 +1,8 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.profiler namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.profiler import experimental diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/profiler/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/profiler/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ad1438eeca4dc56dd401e7f852aaa7116c51896c --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/profiler/experimental/__init__.py @@ -0,0 +1,14 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.profiler.experimental namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.profiler.experimental import client +from tensorflow._api.v2.compat.v2.profiler.experimental import server +from tensorflow.python.profiler.profiler_v2 import Profile # line: 183 +from tensorflow.python.profiler.profiler_v2 import ProfilerOptions # line: 45 +from tensorflow.python.profiler.profiler_v2 import start # line: 80 +from tensorflow.python.profiler.profiler_v2 import stop # line: 129 +from tensorflow.python.profiler.trace import Trace # line: 27 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/profiler/experimental/client/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/profiler/experimental/client/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7948c300b88a45b6a34b1f753dbb310d79aabd33 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/profiler/experimental/client/__init__.py @@ -0,0 +1,9 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.profiler.experimental.client namespace +""" + +import sys as _sys + +from tensorflow.python.profiler.profiler_client import monitor # line: 134 +from tensorflow.python.profiler.profiler_client import trace # line: 25 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/profiler/experimental/server/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/profiler/experimental/server/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..790c00223c2bd2f43ff546735432431d96f67319 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/profiler/experimental/server/__init__.py @@ -0,0 +1,8 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.profiler.experimental.server namespace +""" + +import sys as _sys + +from tensorflow.python.profiler.profiler_v2 import start_server as start # line: 168 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/quantization/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/quantization/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..77af0f6a756df9488fc8656009e99d9dec3b7fc9 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/quantization/__init__.py @@ -0,0 +1,19 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.quantization namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.quantization import experimental +from tensorflow.python.ops.gen_array_ops import fake_quant_with_min_max_args # line: 2698 +from tensorflow.python.ops.gen_array_ops import fake_quant_with_min_max_args_gradient # line: 2867 +from tensorflow.python.ops.gen_array_ops import fake_quant_with_min_max_vars # line: 3003 +from tensorflow.python.ops.gen_array_ops import fake_quant_with_min_max_vars_gradient # line: 3145 +from tensorflow.python.ops.gen_array_ops import fake_quant_with_min_max_vars_per_channel # line: 3276 +from tensorflow.python.ops.gen_array_ops import fake_quant_with_min_max_vars_per_channel_gradient # line: 3423 +from tensorflow.python.ops.gen_array_ops import quantized_concat # line: 8202 +from tensorflow.python.ops.array_ops import dequantize # line: 6139 +from tensorflow.python.ops.array_ops import quantize # line: 6100 +from tensorflow.python.ops.array_ops import quantize_and_dequantize # line: 6176 +from tensorflow.python.ops.array_ops import quantize_and_dequantize_v2 # line: 6243 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/quantization/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/quantization/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..267d4981e8bcc0b3f894cc33fc1e0c236254a4af --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/quantization/experimental/__init__.py @@ -0,0 +1,13 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.quantization.experimental namespace +""" + +import sys as _sys + +from tensorflow.compiler.mlir.quantization.tensorflow.python.quantize_model import _QuantizationComponentSpec as QuantizationComponentSpec # line: 58 +from tensorflow.compiler.mlir.quantization.tensorflow.python.quantize_model import _QuantizationMethod as QuantizationMethod # line: 54 +from tensorflow.compiler.mlir.quantization.tensorflow.python.quantize_model import _QuantizationOptions as QuantizationOptions # line: 50 +from tensorflow.compiler.mlir.quantization.tensorflow.python.quantize_model import _UnitWiseQuantizationSpec as UnitWiseQuantizationSpec # line: 62 +from tensorflow.compiler.mlir.quantization.tensorflow.python.quantize_model import quantize as quantize_saved_model # line: 1467 +from tensorflow.compiler.mlir.quantization.tensorflow.python.representative_dataset import TfRecordRepresentativeDatasetSaver # line: 78 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/queue/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/queue/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ddd979996fbf7408213917cccdd9b6ff4b35d50f --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/queue/__init__.py @@ -0,0 +1,12 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.queue namespace +""" + +import sys as _sys + +from tensorflow.python.ops.data_flow_ops import FIFOQueue # line: 712 +from tensorflow.python.ops.data_flow_ops import PaddingFIFOQueue # line: 848 +from tensorflow.python.ops.data_flow_ops import PriorityQueue # line: 924 +from tensorflow.python.ops.data_flow_ops import QueueBase # line: 115 +from tensorflow.python.ops.data_flow_ops import RandomShuffleQueue # line: 622 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/ragged/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/ragged/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..748ef1c0f48cce3ca8ea24176f26b1227b77a4e7 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/ragged/__init__.py @@ -0,0 +1,17 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.ragged namespace +""" + +import sys as _sys + +from tensorflow.python.ops.ragged.ragged_array_ops import boolean_mask # line: 49 +from tensorflow.python.ops.ragged.ragged_array_ops import cross # line: 741 +from tensorflow.python.ops.ragged.ragged_array_ops import cross_hashed # line: 768 +from tensorflow.python.ops.ragged.ragged_array_ops import stack_dynamic_partitions # line: 575 +from tensorflow.python.ops.ragged.ragged_concat_ops import stack # line: 73 +from tensorflow.python.ops.ragged.ragged_factory_ops import constant # line: 35 +from tensorflow.python.ops.ragged.ragged_functional_ops import map_flat_values # line: 25 +from tensorflow.python.ops.ragged.ragged_math_ops import range # line: 44 +from tensorflow.python.ops.ragged.segment_id_ops import row_splits_to_segment_ids # line: 31 +from tensorflow.python.ops.ragged.segment_id_ops import segment_ids_to_row_splits # line: 75 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/random/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/random/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..84f891c6060cb748c28b6742f725231b1ee760a9 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/random/__init__.py @@ -0,0 +1,36 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.random namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.random import experimental +from tensorflow.python.framework.random_seed import set_seed # line: 210 +from tensorflow.python.ops.candidate_sampling_ops import all_candidate_sampler # line: 430 +from tensorflow.python.ops.candidate_sampling_ops import fixed_unigram_candidate_sampler # line: 306 +from tensorflow.python.ops.candidate_sampling_ops import learned_unigram_candidate_sampler # line: 212 +from tensorflow.python.ops.candidate_sampling_ops import log_uniform_candidate_sampler # line: 116 +from tensorflow.python.ops.candidate_sampling_ops import uniform_candidate_sampler # line: 27 +from tensorflow.python.ops.random_ops import categorical # line: 394 +from tensorflow.python.ops.random_ops import random_gamma as gamma # line: 451 +from tensorflow.python.ops.random_ops import random_normal as normal # line: 39 +from tensorflow.python.ops.random_ops import random_poisson_v2 as poisson # line: 586 +from tensorflow.python.ops.random_ops import random_shuffle as shuffle # line: 326 +from tensorflow.python.ops.random_ops import truncated_normal # line: 155 +from tensorflow.python.ops.random_ops import random_uniform as uniform # line: 211 +from tensorflow.python.ops.random_ops_util import Algorithm # line: 30 +from tensorflow.python.ops.stateful_random_ops import Generator # line: 220 +from tensorflow.python.ops.stateful_random_ops import create_rng_state # line: 174 +from tensorflow.python.ops.stateful_random_ops import get_global_generator # line: 975 +from tensorflow.python.ops.stateful_random_ops import set_global_generator # line: 1000 +from tensorflow.python.ops.stateless_random_ops import fold_in # line: 93 +from tensorflow.python.ops.stateless_random_ops import split # line: 51 +from tensorflow.python.ops.stateless_random_ops import stateless_random_binomial as stateless_binomial # line: 411 +from tensorflow.python.ops.stateless_random_ops import stateless_categorical # line: 793 +from tensorflow.python.ops.stateless_random_ops import stateless_random_gamma as stateless_gamma # line: 481 +from tensorflow.python.ops.stateless_random_ops import stateless_random_normal as stateless_normal # line: 644 +from tensorflow.python.ops.stateless_random_ops import stateless_parameterized_truncated_normal # line: 851 +from tensorflow.python.ops.stateless_random_ops import stateless_random_poisson as stateless_poisson # line: 584 +from tensorflow.python.ops.stateless_random_ops import stateless_truncated_normal # line: 695 +from tensorflow.python.ops.stateless_random_ops import stateless_random_uniform as stateless_uniform # line: 274 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/random/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/random/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8941fae2111531b4998ca26a4321f32e39a0b5ea --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/random/experimental/__init__.py @@ -0,0 +1,16 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.random.experimental namespace +""" + +import sys as _sys + +from tensorflow.python.ops.random_ops_util import Algorithm # line: 30 +from tensorflow.python.ops.stateful_random_ops import Generator # line: 220 +from tensorflow.python.ops.stateful_random_ops import create_rng_state # line: 174 +from tensorflow.python.ops.stateful_random_ops import get_global_generator # line: 975 +from tensorflow.python.ops.stateful_random_ops import set_global_generator # line: 1000 +from tensorflow.python.ops.stateless_random_ops import index_shuffle # line: 135 +from tensorflow.python.ops.stateless_random_ops import fold_in as stateless_fold_in # line: 93 +from tensorflow.python.ops.stateless_random_ops import stateless_shuffle # line: 226 +from tensorflow.python.ops.stateless_random_ops import split as stateless_split # line: 51 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/raw_ops/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/raw_ops/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5e650c4b2247cad3d39b71e2c6ce5fa7a74699a5 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/raw_ops/__init__.py @@ -0,0 +1,1422 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.raw_ops namespace +""" + +import sys as _sys + +from tensorflow.python.ops.gen_array_ops import BatchMatrixBandPart # line: 68 +from tensorflow.python.ops.gen_array_ops import BatchMatrixDiag # line: 126 +from tensorflow.python.ops.gen_array_ops import BatchMatrixDiagPart # line: 182 +from tensorflow.python.ops.gen_array_ops import BatchMatrixSetDiag # line: 239 +from tensorflow.python.ops.gen_array_ops import BatchToSpace # line: 319 +from tensorflow.python.ops.gen_array_ops import BatchToSpaceND # line: 533 +from tensorflow.python.ops.gen_array_ops import Bitcast # line: 677 +from tensorflow.python.ops.gen_array_ops import BroadcastArgs # line: 739 +from tensorflow.python.ops.gen_array_ops import BroadcastGradientArgs # line: 807 +from tensorflow.python.ops.gen_array_ops import BroadcastTo # line: 928 +from tensorflow.python.ops.gen_array_ops import CheckNumerics # line: 1041 +from tensorflow.python.ops.gen_array_ops import CheckNumericsV2 # line: 1107 +from tensorflow.python.ops.gen_array_ops import Concat # line: 1174 +from tensorflow.python.ops.gen_array_ops import ConcatOffset # line: 1255 +from tensorflow.python.ops.gen_array_ops import ConcatV2 # line: 1328 +from tensorflow.python.ops.gen_array_ops import ConjugateTranspose # line: 1397 +from tensorflow.python.ops.gen_array_ops import Const # line: 1458 +from tensorflow.python.ops.gen_array_ops import DebugGradientIdentity # line: 1519 +from tensorflow.python.ops.gen_array_ops import DebugGradientRefIdentity # line: 1567 +from tensorflow.python.ops.gen_array_ops import DeepCopy # line: 1613 +from tensorflow.python.ops.gen_array_ops import DepthToSpace # line: 1771 +from tensorflow.python.ops.gen_array_ops import Dequantize # line: 1914 +from tensorflow.python.ops.gen_array_ops import Diag # line: 2032 +from tensorflow.python.ops.gen_array_ops import DiagPart # line: 2109 +from tensorflow.python.ops.gen_array_ops import EditDistance # line: 2204 +from tensorflow.python.ops.gen_array_ops import Empty # line: 2279 +from tensorflow.python.ops.gen_array_ops import EnsureShape # line: 2345 +from tensorflow.python.ops.gen_array_ops import ExpandDims # line: 2439 +from tensorflow.python.ops.gen_array_ops import ExtractImagePatches # line: 2532 +from tensorflow.python.ops.gen_array_ops import ExtractVolumePatches # line: 2667 +from tensorflow.python.ops.gen_array_ops import FakeQuantWithMinMaxArgs # line: 2834 +from tensorflow.python.ops.gen_array_ops import FakeQuantWithMinMaxArgsGradient # line: 2969 +from tensorflow.python.ops.gen_array_ops import FakeQuantWithMinMaxVars # line: 3113 +from tensorflow.python.ops.gen_array_ops import FakeQuantWithMinMaxVarsGradient # line: 3247 +from tensorflow.python.ops.gen_array_ops import FakeQuantWithMinMaxVarsPerChannel # line: 3391 +from tensorflow.python.ops.gen_array_ops import FakeQuantWithMinMaxVarsPerChannelGradient # line: 3530 +from tensorflow.python.ops.gen_array_ops import Fill # line: 3625 +from tensorflow.python.ops.gen_array_ops import Fingerprint # line: 3716 +from tensorflow.python.ops.gen_array_ops import Gather # line: 3810 +from tensorflow.python.ops.gen_array_ops import GatherNd # line: 3980 +from tensorflow.python.ops.gen_array_ops import GatherV2 # line: 4083 +from tensorflow.python.ops.gen_array_ops import GuaranteeConst # line: 4152 +from tensorflow.python.ops.gen_array_ops import Identity # line: 4208 +from tensorflow.python.ops.gen_array_ops import IdentityN # line: 4304 +from tensorflow.python.ops.gen_array_ops import ImmutableConst # line: 4374 +from tensorflow.python.ops.gen_array_ops import InplaceAdd # line: 4439 +from tensorflow.python.ops.gen_array_ops import InplaceSub # line: 4503 +from tensorflow.python.ops.gen_array_ops import InplaceUpdate # line: 4570 +from tensorflow.python.ops.gen_array_ops import InvertPermutation # line: 4672 +from tensorflow.python.ops.gen_array_ops import ListDiff # line: 4766 +from tensorflow.python.ops.gen_array_ops import LowerBound # line: 4854 +from tensorflow.python.ops.gen_array_ops import MatrixBandPart # line: 4991 +from tensorflow.python.ops.gen_array_ops import MatrixDiag # line: 5077 +from tensorflow.python.ops.gen_array_ops import MatrixDiagPart # line: 5162 +from tensorflow.python.ops.gen_array_ops import MatrixDiagPartV2 # line: 5296 +from tensorflow.python.ops.gen_array_ops import MatrixDiagPartV3 # line: 5475 +from tensorflow.python.ops.gen_array_ops import MatrixDiagV2 # line: 5643 +from tensorflow.python.ops.gen_array_ops import MatrixDiagV3 # line: 5851 +from tensorflow.python.ops.gen_array_ops import MatrixSetDiag # line: 5929 +from tensorflow.python.ops.gen_array_ops import MatrixSetDiagV2 # line: 6066 +from tensorflow.python.ops.gen_array_ops import MatrixSetDiagV3 # line: 6249 +from tensorflow.python.ops.gen_array_ops import MirrorPad # line: 6348 +from tensorflow.python.ops.gen_array_ops import MirrorPadGrad # line: 6433 +from tensorflow.python.ops.gen_array_ops import OneHot # line: 6595 +from tensorflow.python.ops.gen_array_ops import OnesLike # line: 6658 +from tensorflow.python.ops.gen_array_ops import Pack # line: 6747 +from tensorflow.python.ops.gen_array_ops import Pad # line: 6837 +from tensorflow.python.ops.gen_array_ops import PadV2 # line: 6924 +from tensorflow.python.ops.gen_array_ops import ParallelConcat # line: 7011 +from tensorflow.python.ops.gen_array_ops import Placeholder # line: 7085 +from tensorflow.python.ops.gen_array_ops import PlaceholderV2 # line: 7154 +from tensorflow.python.ops.gen_array_ops import PlaceholderWithDefault # line: 7215 +from tensorflow.python.ops.gen_array_ops import PreventGradient # line: 7288 +from tensorflow.python.ops.gen_array_ops import QuantizeAndDequantize # line: 7378 +from tensorflow.python.ops.gen_array_ops import QuantizeAndDequantizeV2 # line: 7567 +from tensorflow.python.ops.gen_array_ops import QuantizeAndDequantizeV3 # line: 7680 +from tensorflow.python.ops.gen_array_ops import QuantizeAndDequantizeV4 # line: 7820 +from tensorflow.python.ops.gen_array_ops import QuantizeAndDequantizeV4Grad # line: 7922 +from tensorflow.python.ops.gen_array_ops import QuantizeV2 # line: 8159 +from tensorflow.python.ops.gen_array_ops import QuantizedConcat # line: 8310 +from tensorflow.python.ops.gen_array_ops import QuantizedInstanceNorm # line: 8450 +from tensorflow.python.ops.gen_array_ops import QuantizedReshape # line: 8543 +from tensorflow.python.ops.gen_array_ops import Rank # line: 8616 +from tensorflow.python.ops.gen_array_ops import RefIdentity # line: 8660 +from tensorflow.python.ops.gen_array_ops import Reshape # line: 8770 +from tensorflow.python.ops.gen_array_ops import ResourceStridedSliceAssign # line: 8864 +from tensorflow.python.ops.gen_array_ops import Reverse # line: 8985 +from tensorflow.python.ops.gen_array_ops import ReverseSequence # line: 9113 +from tensorflow.python.ops.gen_array_ops import ReverseV2 # line: 9253 +from tensorflow.python.ops.gen_array_ops import ScatterNd # line: 9434 +from tensorflow.python.ops.gen_array_ops import ScatterNdNonAliasingAdd # line: 9537 +from tensorflow.python.ops.gen_array_ops import Shape # line: 9611 +from tensorflow.python.ops.gen_array_ops import ShapeN # line: 9682 +from tensorflow.python.ops.gen_array_ops import Size # line: 9761 +from tensorflow.python.ops.gen_array_ops import Slice # line: 9837 +from tensorflow.python.ops.gen_array_ops import Snapshot # line: 9895 +from tensorflow.python.ops.gen_array_ops import SpaceToBatch # line: 10051 +from tensorflow.python.ops.gen_array_ops import SpaceToBatchND # line: 10267 +from tensorflow.python.ops.gen_array_ops import SpaceToDepth # line: 10422 +from tensorflow.python.ops.gen_array_ops import Split # line: 10490 +from tensorflow.python.ops.gen_array_ops import SplitV # line: 10559 +from tensorflow.python.ops.gen_array_ops import Squeeze # line: 10648 +from tensorflow.python.ops.gen_array_ops import StopGradient # line: 10769 +from tensorflow.python.ops.gen_array_ops import StridedSlice # line: 10985 +from tensorflow.python.ops.gen_array_ops import StridedSliceAssign # line: 11090 +from tensorflow.python.ops.gen_array_ops import StridedSliceGrad # line: 11186 +from tensorflow.python.ops.gen_array_ops import TensorScatterAdd # line: 11358 +from tensorflow.python.ops.gen_array_ops import TensorScatterMax # line: 11464 +from tensorflow.python.ops.gen_array_ops import TensorScatterMin # line: 11559 +from tensorflow.python.ops.gen_array_ops import TensorScatterSub # line: 11718 +from tensorflow.python.ops.gen_array_ops import TensorScatterUpdate # line: 11820 +from tensorflow.python.ops.gen_array_ops import TensorStridedSliceUpdate # line: 11928 +from tensorflow.python.ops.gen_array_ops import Tile # line: 12064 +from tensorflow.python.ops.gen_array_ops import TileGrad # line: 12127 +from tensorflow.python.ops.gen_array_ops import Transpose # line: 12190 +from tensorflow.python.ops.gen_array_ops import Unique # line: 12284 +from tensorflow.python.ops.gen_array_ops import UniqueV2 # line: 12406 +from tensorflow.python.ops.gen_array_ops import UniqueWithCounts # line: 12499 +from tensorflow.python.ops.gen_array_ops import UniqueWithCountsV2 # line: 12626 +from tensorflow.python.ops.gen_array_ops import Unpack # line: 12708 +from tensorflow.python.ops.gen_array_ops import UnravelIndex # line: 12820 +from tensorflow.python.ops.gen_array_ops import UpperBound # line: 12906 +from tensorflow.python.ops.gen_array_ops import Where # line: 13026 +from tensorflow.python.ops.gen_array_ops import ZerosLike # line: 13082 +from tensorflow.python.ops.gen_audio_ops import AudioSpectrogram # line: 108 +from tensorflow.python.ops.gen_audio_ops import DecodeWav # line: 237 +from tensorflow.python.ops.gen_audio_ops import EncodeWav # line: 338 +from tensorflow.python.ops.gen_audio_ops import Mfcc # line: 443 +from tensorflow.python.ops.gen_batch_ops import Batch # line: 171 +from tensorflow.python.ops.gen_batch_ops import BatchFunction # line: 429 +from tensorflow.python.ops.gen_batch_ops import Unbatch # line: 579 +from tensorflow.python.ops.gen_batch_ops import UnbatchGrad # line: 676 +from tensorflow.python.ops.gen_bitwise_ops import BitwiseAnd # line: 113 +from tensorflow.python.ops.gen_bitwise_ops import BitwiseOr # line: 219 +from tensorflow.python.ops.gen_bitwise_ops import BitwiseXor # line: 325 +from tensorflow.python.ops.gen_bitwise_ops import Invert # line: 450 +from tensorflow.python.ops.gen_bitwise_ops import LeftShift # line: 566 +from tensorflow.python.ops.gen_bitwise_ops import PopulationCount # line: 631 +from tensorflow.python.ops.gen_bitwise_ops import RightShift # line: 749 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesAggregateStats # line: 85 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesBucketize # line: 167 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesCalculateBestFeatureSplit # line: 289 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesCalculateBestFeatureSplitV2 # line: 413 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesCalculateBestGainsPerFeature # line: 536 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesCenterBias # line: 623 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesCreateEnsemble # line: 684 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesCreateQuantileStreamResource # line: 747 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesDeserializeEnsemble # line: 808 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesEnsembleResourceHandleOp # line: 873 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesExampleDebugOutputs # line: 956 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesFlushQuantileSummaries # line: 1031 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesGetEnsembleStates # line: 1099 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesMakeQuantileSummaries # line: 1169 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesMakeStatsSummary # line: 1260 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesPredict # line: 1347 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesQuantileStreamResourceAddSummaries # line: 1416 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesQuantileStreamResourceDeserialize # line: 1480 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesQuantileStreamResourceFlush # line: 1551 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesQuantileStreamResourceGetBucketBoundaries # line: 1619 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesQuantileStreamResourceHandleOp # line: 1685 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesSerializeEnsemble # line: 1755 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesSparseAggregateStats # line: 1857 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesSparseCalculateBestFeatureSplit # line: 1980 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesTrainingPredict # line: 2088 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesUpdateEnsemble # line: 2228 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesUpdateEnsembleV2 # line: 2441 +from tensorflow.python.ops.gen_boosted_trees_ops import IsBoostedTreesEnsembleInitialized # line: 2574 +from tensorflow.python.ops.gen_boosted_trees_ops import IsBoostedTreesQuantileStreamResourceInitialized # line: 2634 +from tensorflow.python.ops.gen_candidate_sampling_ops import AllCandidateSampler # line: 113 +from tensorflow.python.ops.gen_candidate_sampling_ops import ComputeAccidentalHits # line: 214 +from tensorflow.python.ops.gen_candidate_sampling_ops import FixedUnigramCandidateSampler # line: 405 +from tensorflow.python.ops.gen_candidate_sampling_ops import LearnedUnigramCandidateSampler # line: 553 +from tensorflow.python.ops.gen_candidate_sampling_ops import LogUniformCandidateSampler # line: 677 +from tensorflow.python.ops.gen_candidate_sampling_ops import ThreadUnsafeUnigramCandidateSampler # line: 802 +from tensorflow.python.ops.gen_candidate_sampling_ops import UniformCandidateSampler # line: 925 +from tensorflow.python.ops.gen_checkpoint_ops import GenerateVocabRemapping # line: 123 +from tensorflow.python.ops.gen_checkpoint_ops import LoadAndRemapMatrix # line: 264 +from tensorflow.python.ops.gen_clustering_ops import KMC2ChainInitialization # line: 72 +from tensorflow.python.ops.gen_clustering_ops import KmeansPlusPlusInitialization # line: 149 +from tensorflow.python.ops.gen_clustering_ops import NearestNeighbors # line: 225 +from tensorflow.python.ops.gen_collective_ops import CollectiveAllToAllV2 # line: 106 +from tensorflow.python.ops.gen_collective_ops import CollectiveAllToAllV3 # line: 193 +from tensorflow.python.ops.gen_collective_ops import CollectiveAssignGroupV2 # line: 265 +from tensorflow.python.ops.gen_collective_ops import CollectiveBcastRecv # line: 357 +from tensorflow.python.ops.gen_collective_ops import CollectiveBcastRecvV2 # line: 449 +from tensorflow.python.ops.gen_collective_ops import CollectiveBcastSend # line: 548 +from tensorflow.python.ops.gen_collective_ops import CollectiveBcastSendV2 # line: 637 +from tensorflow.python.ops.gen_collective_ops import CollectiveGather # line: 735 +from tensorflow.python.ops.gen_collective_ops import CollectiveGatherV2 # line: 843 +from tensorflow.python.ops.gen_collective_ops import CollectiveInitializeCommunicator # line: 935 +from tensorflow.python.ops.gen_collective_ops import CollectiveReduce # line: 1054 +from tensorflow.python.ops.gen_collective_ops import CollectiveReduceScatterV2 # line: 1194 +from tensorflow.python.ops.gen_collective_ops import CollectiveReduceV2 # line: 1333 +from tensorflow.python.ops.gen_collective_ops import CollectiveReduceV3 # line: 1431 +from tensorflow.python.ops.gen_composite_tensor_ops import CompositeTensorVariantFromComponents # line: 74 +from tensorflow.python.ops.gen_composite_tensor_ops import CompositeTensorVariantToComponents # line: 152 +from tensorflow.python.ops.gen_control_flow_ops import Abort # line: 71 +from tensorflow.python.ops.gen_control_flow_ops import ControlTrigger # line: 120 +from tensorflow.python.ops.gen_control_flow_ops import Enter # line: 196 +from tensorflow.python.ops.gen_control_flow_ops import Exit # line: 262 +from tensorflow.python.ops.gen_control_flow_ops import LoopCond # line: 320 +from tensorflow.python.ops.gen_control_flow_ops import Merge # line: 396 +from tensorflow.python.ops.gen_control_flow_ops import NextIteration # line: 457 +from tensorflow.python.ops.gen_control_flow_ops import NoOp # line: 529 +from tensorflow.python.ops.gen_control_flow_ops import RefEnter # line: 592 +from tensorflow.python.ops.gen_control_flow_ops import RefExit # line: 629 +from tensorflow.python.ops.gen_control_flow_ops import RefMerge # line: 682 +from tensorflow.python.ops.gen_control_flow_ops import RefNextIteration # line: 717 +from tensorflow.python.ops.gen_control_flow_ops import RefSelect # line: 759 +from tensorflow.python.ops.gen_control_flow_ops import RefSwitch # line: 808 +from tensorflow.python.ops.gen_control_flow_ops import Switch # line: 869 +from tensorflow.python.ops.gen_count_ops import DenseCountSparseOutput # line: 103 +from tensorflow.python.ops.gen_count_ops import RaggedCountSparseOutput # line: 211 +from tensorflow.python.ops.gen_count_ops import SparseCountSparseOutput # line: 323 +from tensorflow.python.ops.gen_ctc_ops import CTCBeamSearchDecoder # line: 107 +from tensorflow.python.ops.gen_ctc_ops import CTCGreedyDecoder # line: 212 +from tensorflow.python.ops.gen_ctc_ops import CTCLoss # line: 335 +from tensorflow.python.ops.gen_ctc_ops import CTCLossV2 # line: 463 +from tensorflow.python.ops.gen_cudnn_rnn_ops import CudnnRNN # line: 151 +from tensorflow.python.ops.gen_cudnn_rnn_ops import CudnnRNNBackprop # line: 337 +from tensorflow.python.ops.gen_cudnn_rnn_ops import CudnnRNNBackpropV2 # line: 524 +from tensorflow.python.ops.gen_cudnn_rnn_ops import CudnnRNNBackpropV3 # line: 733 +from tensorflow.python.ops.gen_cudnn_rnn_ops import CudnnRNNCanonicalToParams # line: 907 +from tensorflow.python.ops.gen_cudnn_rnn_ops import CudnnRNNCanonicalToParamsV2 # line: 1098 +from tensorflow.python.ops.gen_cudnn_rnn_ops import CudnnRNNParamsSize # line: 1267 +from tensorflow.python.ops.gen_cudnn_rnn_ops import CudnnRNNParamsToCanonical # line: 1436 +from tensorflow.python.ops.gen_cudnn_rnn_ops import CudnnRNNParamsToCanonicalV2 # line: 1620 +from tensorflow.python.ops.gen_cudnn_rnn_ops import CudnnRNNV2 # line: 1799 +from tensorflow.python.ops.gen_cudnn_rnn_ops import CudnnRNNV3 # line: 1988 +from tensorflow.python.ops.gen_data_flow_ops import AccumulatorApplyGradient # line: 52 +from tensorflow.python.ops.gen_data_flow_ops import AccumulatorNumAccumulated # line: 84 +from tensorflow.python.ops.gen_data_flow_ops import AccumulatorSetGlobalStep # line: 115 +from tensorflow.python.ops.gen_data_flow_ops import AccumulatorTakeGradient # line: 162 +from tensorflow.python.ops.gen_data_flow_ops import Barrier # line: 244 +from tensorflow.python.ops.gen_data_flow_ops import BarrierClose # line: 284 +from tensorflow.python.ops.gen_data_flow_ops import BarrierIncompleteSize # line: 316 +from tensorflow.python.ops.gen_data_flow_ops import BarrierInsertMany # line: 356 +from tensorflow.python.ops.gen_data_flow_ops import BarrierReadySize # line: 388 +from tensorflow.python.ops.gen_data_flow_ops import BarrierTakeMany # line: 472 +from tensorflow.python.ops.gen_data_flow_ops import ConditionalAccumulator # line: 540 +from tensorflow.python.ops.gen_data_flow_ops import DeleteSessionTensor # line: 577 +from tensorflow.python.ops.gen_data_flow_ops import DynamicPartition # line: 713 +from tensorflow.python.ops.gen_data_flow_ops import DynamicStitch # line: 877 +from tensorflow.python.ops.gen_data_flow_ops import FIFOQueue # line: 977 +from tensorflow.python.ops.gen_data_flow_ops import FIFOQueueV2 # line: 1066 +from tensorflow.python.ops.gen_data_flow_ops import FakeQueue # line: 1129 +from tensorflow.python.ops.gen_data_flow_ops import GetSessionHandle # line: 1175 +from tensorflow.python.ops.gen_data_flow_ops import GetSessionHandleV2 # line: 1231 +from tensorflow.python.ops.gen_data_flow_ops import GetSessionTensor # line: 1290 +from tensorflow.python.ops.gen_data_flow_ops import MapClear # line: 1363 +from tensorflow.python.ops.gen_data_flow_ops import MapIncompleteSize # line: 1460 +from tensorflow.python.ops.gen_data_flow_ops import MapPeek # line: 1567 +from tensorflow.python.ops.gen_data_flow_ops import MapSize # line: 1668 +from tensorflow.python.ops.gen_data_flow_ops import MapStage # line: 1767 +from tensorflow.python.ops.gen_data_flow_ops import MapUnstage # line: 1875 +from tensorflow.python.ops.gen_data_flow_ops import MapUnstageNoKey # line: 1990 +from tensorflow.python.ops.gen_data_flow_ops import OrderedMapClear # line: 2082 +from tensorflow.python.ops.gen_data_flow_ops import OrderedMapIncompleteSize # line: 2180 +from tensorflow.python.ops.gen_data_flow_ops import OrderedMapPeek # line: 2290 +from tensorflow.python.ops.gen_data_flow_ops import OrderedMapSize # line: 2392 +from tensorflow.python.ops.gen_data_flow_ops import OrderedMapStage # line: 2494 +from tensorflow.python.ops.gen_data_flow_ops import OrderedMapUnstage # line: 2603 +from tensorflow.python.ops.gen_data_flow_ops import OrderedMapUnstageNoKey # line: 2721 +from tensorflow.python.ops.gen_data_flow_ops import PaddingFIFOQueue # line: 2833 +from tensorflow.python.ops.gen_data_flow_ops import PaddingFIFOQueueV2 # line: 2930 +from tensorflow.python.ops.gen_data_flow_ops import ParallelDynamicStitch # line: 3084 +from tensorflow.python.ops.gen_data_flow_ops import PriorityQueue # line: 3189 +from tensorflow.python.ops.gen_data_flow_ops import PriorityQueueV2 # line: 3284 +from tensorflow.python.ops.gen_data_flow_ops import QueueClose # line: 3353 +from tensorflow.python.ops.gen_data_flow_ops import QueueCloseV2 # line: 3405 +from tensorflow.python.ops.gen_data_flow_ops import QueueDequeue # line: 3469 +from tensorflow.python.ops.gen_data_flow_ops import QueueDequeueMany # line: 3532 +from tensorflow.python.ops.gen_data_flow_ops import QueueDequeueManyV2 # line: 3611 +from tensorflow.python.ops.gen_data_flow_ops import QueueDequeueUpTo # line: 3697 +from tensorflow.python.ops.gen_data_flow_ops import QueueDequeueUpToV2 # line: 3780 +from tensorflow.python.ops.gen_data_flow_ops import QueueDequeueV2 # line: 3869 +from tensorflow.python.ops.gen_data_flow_ops import QueueEnqueue # line: 3927 +from tensorflow.python.ops.gen_data_flow_ops import QueueEnqueueMany # line: 3972 +from tensorflow.python.ops.gen_data_flow_ops import QueueEnqueueManyV2 # line: 4030 +from tensorflow.python.ops.gen_data_flow_ops import QueueEnqueueV2 # line: 4094 +from tensorflow.python.ops.gen_data_flow_ops import QueueIsClosed # line: 4140 +from tensorflow.python.ops.gen_data_flow_ops import QueueIsClosedV2 # line: 4187 +from tensorflow.python.ops.gen_data_flow_ops import QueueSize # line: 4229 +from tensorflow.python.ops.gen_data_flow_ops import QueueSizeV2 # line: 4273 +from tensorflow.python.ops.gen_data_flow_ops import RandomShuffleQueue # line: 4379 +from tensorflow.python.ops.gen_data_flow_ops import RandomShuffleQueueV2 # line: 4492 +from tensorflow.python.ops.gen_data_flow_ops import RecordInput # line: 4630 +from tensorflow.python.ops.gen_data_flow_ops import ResourceAccumulatorApplyGradient # line: 4708 +from tensorflow.python.ops.gen_data_flow_ops import ResourceAccumulatorNumAccumulated # line: 4762 +from tensorflow.python.ops.gen_data_flow_ops import ResourceAccumulatorSetGlobalStep # line: 4817 +from tensorflow.python.ops.gen_data_flow_ops import ResourceAccumulatorTakeGradient # line: 4887 +from tensorflow.python.ops.gen_data_flow_ops import ResourceConditionalAccumulator # line: 4987 +from tensorflow.python.ops.gen_data_flow_ops import SparseAccumulatorApplyGradient # line: 5059 +from tensorflow.python.ops.gen_data_flow_ops import SparseAccumulatorTakeGradient # line: 5117 +from tensorflow.python.ops.gen_data_flow_ops import SparseConditionalAccumulator # line: 5185 +from tensorflow.python.ops.gen_data_flow_ops import Stack # line: 5225 +from tensorflow.python.ops.gen_data_flow_ops import StackClose # line: 5249 +from tensorflow.python.ops.gen_data_flow_ops import StackCloseV2 # line: 5285 +from tensorflow.python.ops.gen_data_flow_ops import StackPop # line: 5328 +from tensorflow.python.ops.gen_data_flow_ops import StackPopV2 # line: 5376 +from tensorflow.python.ops.gen_data_flow_ops import StackPush # line: 5428 +from tensorflow.python.ops.gen_data_flow_ops import StackPushV2 # line: 5482 +from tensorflow.python.ops.gen_data_flow_ops import StackV2 # line: 5556 +from tensorflow.python.ops.gen_data_flow_ops import Stage # line: 5636 +from tensorflow.python.ops.gen_data_flow_ops import StageClear # line: 5718 +from tensorflow.python.ops.gen_data_flow_ops import StagePeek # line: 5821 +from tensorflow.python.ops.gen_data_flow_ops import StageSize # line: 5921 +from tensorflow.python.ops.gen_data_flow_ops import TensorArray # line: 6007 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayClose # line: 6031 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayCloseV2 # line: 6067 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayCloseV3 # line: 6114 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayConcat # line: 6172 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayConcatV2 # line: 6238 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayConcatV3 # line: 6338 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayGather # line: 6398 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayGatherV2 # line: 6457 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayGatherV3 # line: 6539 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayGrad # line: 6591 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayGradV2 # line: 6639 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayGradV3 # line: 6748 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayGradWithShape # line: 6832 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayPack # line: 6889 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayRead # line: 6928 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayReadV2 # line: 6980 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayReadV3 # line: 7046 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayScatter # line: 7097 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayScatterV2 # line: 7147 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayScatterV3 # line: 7214 +from tensorflow.python.ops.gen_data_flow_ops import TensorArraySize # line: 7260 +from tensorflow.python.ops.gen_data_flow_ops import TensorArraySizeV2 # line: 7305 +from tensorflow.python.ops.gen_data_flow_ops import TensorArraySizeV3 # line: 7363 +from tensorflow.python.ops.gen_data_flow_ops import TensorArraySplit # line: 7412 +from tensorflow.python.ops.gen_data_flow_ops import TensorArraySplitV2 # line: 7462 +from tensorflow.python.ops.gen_data_flow_ops import TensorArraySplitV3 # line: 7554 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayUnpack # line: 7604 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayV2 # line: 7679 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayV3 # line: 7815 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayWrite # line: 7882 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayWriteV2 # line: 7932 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayWriteV3 # line: 7997 +from tensorflow.python.ops.gen_data_flow_ops import Unstage # line: 8087 +from tensorflow.python.ops.gen_dataset_ops import AnonymousIterator # line: 78 +from tensorflow.python.ops.gen_dataset_ops import AnonymousIteratorV2 # line: 164 +from tensorflow.python.ops.gen_dataset_ops import AnonymousIteratorV3 # line: 242 +from tensorflow.python.ops.gen_dataset_ops import AnonymousMemoryCache # line: 312 +from tensorflow.python.ops.gen_dataset_ops import AnonymousMultiDeviceIterator # line: 397 +from tensorflow.python.ops.gen_dataset_ops import AnonymousMultiDeviceIteratorV3 # line: 491 +from tensorflow.python.ops.gen_dataset_ops import AnonymousRandomSeedGenerator # line: 570 +from tensorflow.python.ops.gen_dataset_ops import AnonymousSeedGenerator # line: 637 +from tensorflow.python.ops.gen_dataset_ops import BatchDataset # line: 720 +from tensorflow.python.ops.gen_dataset_ops import BatchDatasetV2 # line: 826 +from tensorflow.python.ops.gen_dataset_ops import CacheDataset # line: 930 +from tensorflow.python.ops.gen_dataset_ops import CacheDatasetV2 # line: 1025 +from tensorflow.python.ops.gen_dataset_ops import ConcatenateDataset # line: 1121 +from tensorflow.python.ops.gen_dataset_ops import DatasetCardinality # line: 1201 +from tensorflow.python.ops.gen_dataset_ops import DatasetToGraph # line: 1289 +from tensorflow.python.ops.gen_dataset_ops import DatasetToGraphV2 # line: 1378 +from tensorflow.python.ops.gen_dataset_ops import DatasetToSingleElement # line: 1463 +from tensorflow.python.ops.gen_dataset_ops import DeleteIterator # line: 1524 +from tensorflow.python.ops.gen_dataset_ops import DeleteMemoryCache # line: 1569 +from tensorflow.python.ops.gen_dataset_ops import DeleteMultiDeviceIterator # line: 1625 +from tensorflow.python.ops.gen_dataset_ops import DeleteRandomSeedGenerator # line: 1678 +from tensorflow.python.ops.gen_dataset_ops import DeleteSeedGenerator # line: 1724 +from tensorflow.python.ops.gen_dataset_ops import DeserializeIterator # line: 1773 +from tensorflow.python.ops.gen_dataset_ops import DummyMemoryCache # line: 1824 +from tensorflow.python.ops.gen_dataset_ops import DummySeedGenerator # line: 1876 +from tensorflow.python.ops.gen_dataset_ops import FilterByLastComponentDataset # line: 1947 +from tensorflow.python.ops.gen_dataset_ops import FilterDataset # line: 2051 +from tensorflow.python.ops.gen_dataset_ops import FinalizeDataset # line: 2147 +from tensorflow.python.ops.gen_dataset_ops import FixedLengthRecordDataset # line: 2238 +from tensorflow.python.ops.gen_dataset_ops import FixedLengthRecordDatasetV2 # line: 2318 +from tensorflow.python.ops.gen_dataset_ops import FlatMapDataset # line: 2417 +from tensorflow.python.ops.gen_dataset_ops import GeneratorDataset # line: 2529 +from tensorflow.python.ops.gen_dataset_ops import GetOptions # line: 2603 +from tensorflow.python.ops.gen_dataset_ops import InterleaveDataset # line: 2700 +from tensorflow.python.ops.gen_dataset_ops import Iterator # line: 2795 +from tensorflow.python.ops.gen_dataset_ops import IteratorFromStringHandle # line: 2887 +from tensorflow.python.ops.gen_dataset_ops import IteratorFromStringHandleV2 # line: 2977 +from tensorflow.python.ops.gen_dataset_ops import IteratorGetNext # line: 3063 +from tensorflow.python.ops.gen_dataset_ops import IteratorGetNextAsOptional # line: 3144 +from tensorflow.python.ops.gen_dataset_ops import IteratorGetNextSync # line: 3231 +from tensorflow.python.ops.gen_dataset_ops import IteratorToStringHandle # line: 3296 +from tensorflow.python.ops.gen_dataset_ops import IteratorV2 # line: 3375 +from tensorflow.python.ops.gen_dataset_ops import MakeIterator # line: 3437 +from tensorflow.python.ops.gen_dataset_ops import MapDataset # line: 3534 +from tensorflow.python.ops.gen_dataset_ops import MapDefun # line: 3658 +from tensorflow.python.ops.gen_dataset_ops import ModelDataset # line: 3767 +from tensorflow.python.ops.gen_dataset_ops import MultiDeviceIterator # line: 3879 +from tensorflow.python.ops.gen_dataset_ops import MultiDeviceIteratorFromStringHandle # line: 3975 +from tensorflow.python.ops.gen_dataset_ops import MultiDeviceIteratorGetNextFromShard # line: 4074 +from tensorflow.python.ops.gen_dataset_ops import MultiDeviceIteratorInit # line: 4148 +from tensorflow.python.ops.gen_dataset_ops import MultiDeviceIteratorToStringHandle # line: 4208 +from tensorflow.python.ops.gen_dataset_ops import OneShotIterator # line: 4314 +from tensorflow.python.ops.gen_dataset_ops import OptimizeDataset # line: 4421 +from tensorflow.python.ops.gen_dataset_ops import OptimizeDatasetV2 # line: 4538 +from tensorflow.python.ops.gen_dataset_ops import OptionsDataset # line: 4644 +from tensorflow.python.ops.gen_dataset_ops import PaddedBatchDataset # line: 4749 +from tensorflow.python.ops.gen_dataset_ops import PaddedBatchDatasetV2 # line: 4867 +from tensorflow.python.ops.gen_dataset_ops import ParallelBatchDataset # line: 4988 +from tensorflow.python.ops.gen_dataset_ops import ParallelFilterDataset # line: 5126 +from tensorflow.python.ops.gen_dataset_ops import ParallelInterleaveDatasetV2 # line: 5271 +from tensorflow.python.ops.gen_dataset_ops import ParallelInterleaveDatasetV3 # line: 5425 +from tensorflow.python.ops.gen_dataset_ops import ParallelInterleaveDatasetV4 # line: 5588 +from tensorflow.python.ops.gen_dataset_ops import ParallelMapDataset # line: 5726 +from tensorflow.python.ops.gen_dataset_ops import ParallelMapDatasetV2 # line: 5867 +from tensorflow.python.ops.gen_dataset_ops import PrefetchDataset # line: 5996 +from tensorflow.python.ops.gen_dataset_ops import RangeDataset # line: 6110 +from tensorflow.python.ops.gen_dataset_ops import ReduceDataset # line: 6230 +from tensorflow.python.ops.gen_dataset_ops import RepeatDataset # line: 6330 +from tensorflow.python.ops.gen_dataset_ops import RewriteDataset # line: 6418 +from tensorflow.python.ops.gen_dataset_ops import SerializeIterator # line: 6493 +from tensorflow.python.ops.gen_dataset_ops import ShardDataset # line: 6585 +from tensorflow.python.ops.gen_dataset_ops import ShuffleAndRepeatDataset # line: 6708 +from tensorflow.python.ops.gen_dataset_ops import ShuffleAndRepeatDatasetV2 # line: 6826 +from tensorflow.python.ops.gen_dataset_ops import ShuffleDataset # line: 6953 +from tensorflow.python.ops.gen_dataset_ops import ShuffleDatasetV2 # line: 7057 +from tensorflow.python.ops.gen_dataset_ops import ShuffleDatasetV3 # line: 7167 +from tensorflow.python.ops.gen_dataset_ops import SkipDataset # line: 7268 +from tensorflow.python.ops.gen_dataset_ops import SparseTensorSliceDataset # line: 7342 +from tensorflow.python.ops.gen_dataset_ops import TFRecordDataset # line: 7416 +from tensorflow.python.ops.gen_dataset_ops import TFRecordDatasetV2 # line: 7496 +from tensorflow.python.ops.gen_dataset_ops import TakeDataset # line: 7582 +from tensorflow.python.ops.gen_dataset_ops import TensorDataset # line: 7666 +from tensorflow.python.ops.gen_dataset_ops import TensorSliceDataset # line: 7759 +from tensorflow.python.ops.gen_dataset_ops import TextLineDataset # line: 7845 +from tensorflow.python.ops.gen_dataset_ops import UnwrapDatasetVariant # line: 7904 +from tensorflow.python.ops.gen_dataset_ops import WindowDataset # line: 8040 +from tensorflow.python.ops.gen_dataset_ops import WindowOp # line: 8129 +from tensorflow.python.ops.gen_dataset_ops import WrapDatasetVariant # line: 8194 +from tensorflow.python.ops.gen_dataset_ops import ZipDataset # line: 8282 +from tensorflow.python.ops.gen_debug_ops import Copy # line: 97 +from tensorflow.python.ops.gen_debug_ops import CopyHost # line: 194 +from tensorflow.python.ops.gen_debug_ops import DebugIdentity # line: 302 +from tensorflow.python.ops.gen_debug_ops import DebugIdentityV2 # line: 444 +from tensorflow.python.ops.gen_debug_ops import DebugIdentityV3 # line: 591 +from tensorflow.python.ops.gen_debug_ops import DebugNanCount # line: 714 +from tensorflow.python.ops.gen_debug_ops import DebugNumericSummary # line: 883 +from tensorflow.python.ops.gen_debug_ops import DebugNumericSummaryV2 # line: 1049 +from tensorflow.python.ops.gen_decode_proto_ops import DecodeProtoV2 # line: 280 +from tensorflow.python.ops.gen_encode_proto_ops import EncodeProto # line: 164 +from tensorflow.python.ops.gen_experimental_dataset_ops import AssertCardinalityDataset # line: 82 +from tensorflow.python.ops.gen_experimental_dataset_ops import AssertNextDataset # line: 180 +from tensorflow.python.ops.gen_experimental_dataset_ops import AssertPrevDataset # line: 277 +from tensorflow.python.ops.gen_experimental_dataset_ops import AutoShardDataset # line: 388 +from tensorflow.python.ops.gen_experimental_dataset_ops import BytesProducedStatsDataset # line: 479 +from tensorflow.python.ops.gen_experimental_dataset_ops import CSVDataset # line: 570 +from tensorflow.python.ops.gen_experimental_dataset_ops import CSVDatasetV2 # line: 666 +from tensorflow.python.ops.gen_experimental_dataset_ops import ChooseFastestBranchDataset # line: 785 +from tensorflow.python.ops.gen_experimental_dataset_ops import ChooseFastestDataset # line: 895 +from tensorflow.python.ops.gen_experimental_dataset_ops import CompressElement # line: 966 +from tensorflow.python.ops.gen_experimental_dataset_ops import ComputeBatchSize # line: 1020 +from tensorflow.python.ops.gen_experimental_dataset_ops import DataServiceDataset # line: 1139 +from tensorflow.python.ops.gen_experimental_dataset_ops import DataServiceDatasetV2 # line: 1295 +from tensorflow.python.ops.gen_experimental_dataset_ops import DataServiceDatasetV3 # line: 1464 +from tensorflow.python.ops.gen_experimental_dataset_ops import DataServiceDatasetV4 # line: 1637 +from tensorflow.python.ops.gen_experimental_dataset_ops import DatasetFromGraph # line: 1731 +from tensorflow.python.ops.gen_experimental_dataset_ops import DatasetToTFRecord # line: 1785 +from tensorflow.python.ops.gen_experimental_dataset_ops import DenseToSparseBatchDataset # line: 1866 +from tensorflow.python.ops.gen_experimental_dataset_ops import DirectedInterleaveDataset # line: 1971 +from tensorflow.python.ops.gen_experimental_dataset_ops import DistributedSave # line: 2046 +from tensorflow.python.ops.gen_experimental_dataset_ops import DummyIterationCounter # line: 2101 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalAssertNextDataset # line: 2175 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalAutoShardDataset # line: 2281 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalBytesProducedStatsDataset # line: 2372 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalCSVDataset # line: 2464 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalChooseFastestDataset # line: 2563 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalDatasetCardinality # line: 2639 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalDatasetToTFRecord # line: 2696 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalDenseToSparseBatchDataset # line: 2779 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalDirectedInterleaveDataset # line: 2877 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalGroupByReducerDataset # line: 3019 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalGroupByWindowDataset # line: 3142 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalIgnoreErrorsDataset # line: 3240 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalIteratorGetDevice # line: 3309 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalLMDBDataset # line: 3381 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalLatencyStatsDataset # line: 3465 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalMapAndBatchDataset # line: 3588 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalMapDataset # line: 3702 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalMatchingFilesDataset # line: 3776 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalMaxIntraOpParallelismDataset # line: 3853 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalNonSerializableDataset # line: 3937 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalParallelInterleaveDataset # line: 4051 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalParseExampleDataset # line: 4208 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalPrivateThreadPoolDataset # line: 4323 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalRandomDataset # line: 4411 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalRebatchDataset # line: 4511 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalScanDataset # line: 4615 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalSetStatsAggregatorDataset # line: 4713 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalSleepDataset # line: 4801 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalSlidingWindowDataset # line: 4899 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalSqlDataset # line: 4989 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalStatsAggregatorHandle # line: 5067 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalStatsAggregatorSummary # line: 5127 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalTakeWhileDataset # line: 5217 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalThreadPoolDataset # line: 5306 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalThreadPoolHandle # line: 5407 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalUnbatchDataset # line: 5491 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalUniqueDataset # line: 5573 +from tensorflow.python.ops.gen_experimental_dataset_ops import GetElementAtIndex # line: 5655 +from tensorflow.python.ops.gen_experimental_dataset_ops import GroupByReducerDataset # line: 5788 +from tensorflow.python.ops.gen_experimental_dataset_ops import GroupByWindowDataset # line: 5914 +from tensorflow.python.ops.gen_experimental_dataset_ops import IgnoreErrorsDataset # line: 6014 +from tensorflow.python.ops.gen_experimental_dataset_ops import InitializeTableFromDataset # line: 6076 +from tensorflow.python.ops.gen_experimental_dataset_ops import IteratorGetDevice # line: 6129 +from tensorflow.python.ops.gen_experimental_dataset_ops import LMDBDataset # line: 6212 +from tensorflow.python.ops.gen_experimental_dataset_ops import LatencyStatsDataset # line: 6294 +from tensorflow.python.ops.gen_experimental_dataset_ops import LegacyParallelInterleaveDatasetV2 # line: 6417 +from tensorflow.python.ops.gen_experimental_dataset_ops import ListDataset # line: 6518 +from tensorflow.python.ops.gen_experimental_dataset_ops import LoadDataset # line: 6616 +from tensorflow.python.ops.gen_experimental_dataset_ops import MapAndBatchDataset # line: 6749 +from tensorflow.python.ops.gen_experimental_dataset_ops import MatchingFilesDataset # line: 6825 +from tensorflow.python.ops.gen_experimental_dataset_ops import MaxIntraOpParallelismDataset # line: 6901 +from tensorflow.python.ops.gen_experimental_dataset_ops import NonSerializableDataset # line: 6984 +from tensorflow.python.ops.gen_experimental_dataset_ops import ParallelInterleaveDataset # line: 7126 +from tensorflow.python.ops.gen_experimental_dataset_ops import ParseExampleDataset # line: 7318 +from tensorflow.python.ops.gen_experimental_dataset_ops import ParseExampleDatasetV2 # line: 7557 +from tensorflow.python.ops.gen_experimental_dataset_ops import PrivateThreadPoolDataset # line: 7692 +from tensorflow.python.ops.gen_experimental_dataset_ops import RandomDataset # line: 7796 +from tensorflow.python.ops.gen_experimental_dataset_ops import RandomDatasetV2 # line: 7920 +from tensorflow.python.ops.gen_experimental_dataset_ops import RebatchDataset # line: 8028 +from tensorflow.python.ops.gen_experimental_dataset_ops import RebatchDatasetV2 # line: 8126 +from tensorflow.python.ops.gen_experimental_dataset_ops import RegisterDataset # line: 8215 +from tensorflow.python.ops.gen_experimental_dataset_ops import RegisterDatasetV2 # line: 8311 +from tensorflow.python.ops.gen_experimental_dataset_ops import SamplingDataset # line: 8409 +from tensorflow.python.ops.gen_experimental_dataset_ops import SaveDataset # line: 8486 +from tensorflow.python.ops.gen_experimental_dataset_ops import SaveDatasetV2 # line: 8585 +from tensorflow.python.ops.gen_experimental_dataset_ops import ScanDataset # line: 8707 +from tensorflow.python.ops.gen_experimental_dataset_ops import SetStatsAggregatorDataset # line: 8809 +from tensorflow.python.ops.gen_experimental_dataset_ops import SleepDataset # line: 8896 +from tensorflow.python.ops.gen_experimental_dataset_ops import SlidingWindowDataset # line: 8998 +from tensorflow.python.ops.gen_experimental_dataset_ops import SnapshotChunkDataset # line: 9093 +from tensorflow.python.ops.gen_experimental_dataset_ops import SnapshotDataset # line: 9286 +from tensorflow.python.ops.gen_experimental_dataset_ops import SnapshotDatasetReader # line: 9430 +from tensorflow.python.ops.gen_experimental_dataset_ops import SnapshotDatasetV2 # line: 9582 +from tensorflow.python.ops.gen_experimental_dataset_ops import SnapshotNestedDatasetReader # line: 9694 +from tensorflow.python.ops.gen_experimental_dataset_ops import SqlDataset # line: 9787 +from tensorflow.python.ops.gen_experimental_dataset_ops import StatsAggregatorHandle # line: 9863 +from tensorflow.python.ops.gen_experimental_dataset_ops import StatsAggregatorHandleV2 # line: 9932 +from tensorflow.python.ops.gen_experimental_dataset_ops import StatsAggregatorSetSummaryWriter # line: 9987 +from tensorflow.python.ops.gen_experimental_dataset_ops import StatsAggregatorSummary # line: 10040 +from tensorflow.python.ops.gen_experimental_dataset_ops import TakeWhileDataset # line: 10134 +from tensorflow.python.ops.gen_experimental_dataset_ops import ThreadPoolDataset # line: 10224 +from tensorflow.python.ops.gen_experimental_dataset_ops import ThreadPoolHandle # line: 10323 +from tensorflow.python.ops.gen_experimental_dataset_ops import UnbatchDataset # line: 10412 +from tensorflow.python.ops.gen_experimental_dataset_ops import UncompressElement # line: 10495 +from tensorflow.python.ops.gen_experimental_dataset_ops import UniqueDataset # line: 10582 +from tensorflow.python.ops.gen_filesystem_ops import FileSystemSetConfiguration # line: 58 +from tensorflow.python.ops.gen_functional_ops import Case # line: 110 +from tensorflow.python.ops.gen_functional_ops import DeviceIndex # line: 191 +from tensorflow.python.ops.gen_functional_ops import FakeParam # line: 260 +from tensorflow.python.ops.gen_functional_ops import For # line: 328 +from tensorflow.python.ops.gen_functional_ops import If # line: 423 +from tensorflow.python.ops.gen_functional_ops import PartitionedCall # line: 524 +from tensorflow.python.ops.gen_functional_ops import RemoteCall # line: 605 +from tensorflow.python.ops.gen_functional_ops import StatefulPartitionedCall # line: 697 +from tensorflow.python.ops.gen_functional_ops import StatelessCase # line: 814 +from tensorflow.python.ops.gen_functional_ops import StatelessIf # line: 926 +from tensorflow.python.ops.gen_functional_ops import StatelessWhile # line: 1029 +from tensorflow.python.ops.gen_functional_ops import SymbolicGradient # line: 1120 +from tensorflow.python.ops.gen_functional_ops import ToBool # line: 1194 +from tensorflow.python.ops.gen_functional_ops import While # line: 1282 +from tensorflow.python.ops.gen_image_ops import AdjustContrast # line: 70 +from tensorflow.python.ops.gen_image_ops import AdjustContrastv2 # line: 143 +from tensorflow.python.ops.gen_image_ops import AdjustHue # line: 209 +from tensorflow.python.ops.gen_image_ops import AdjustSaturation # line: 276 +from tensorflow.python.ops.gen_image_ops import CombinedNonMaxSuppression # line: 402 +from tensorflow.python.ops.gen_image_ops import CropAndResize # line: 524 +from tensorflow.python.ops.gen_image_ops import CropAndResizeGradBoxes # line: 616 +from tensorflow.python.ops.gen_image_ops import CropAndResizeGradImage # line: 710 +from tensorflow.python.ops.gen_image_ops import DecodeAndCropJpeg # line: 847 +from tensorflow.python.ops.gen_image_ops import DecodeBmp # line: 935 +from tensorflow.python.ops.gen_image_ops import DecodeGif # line: 1001 +from tensorflow.python.ops.gen_image_ops import DecodeImage # line: 1098 +from tensorflow.python.ops.gen_image_ops import DecodeJpeg # line: 1234 +from tensorflow.python.ops.gen_image_ops import DecodePng # line: 1338 +from tensorflow.python.ops.gen_image_ops import DrawBoundingBoxes # line: 1416 +from tensorflow.python.ops.gen_image_ops import DrawBoundingBoxesV2 # line: 1492 +from tensorflow.python.ops.gen_image_ops import EncodeJpeg # line: 1633 +from tensorflow.python.ops.gen_image_ops import EncodeJpegVariableQuality # line: 1722 +from tensorflow.python.ops.gen_image_ops import EncodePng # line: 1798 +from tensorflow.python.ops.gen_image_ops import ExtractGlimpse # line: 1919 +from tensorflow.python.ops.gen_image_ops import ExtractGlimpseV2 # line: 2053 +from tensorflow.python.ops.gen_image_ops import ExtractJpegShape # line: 2133 +from tensorflow.python.ops.gen_image_ops import GenerateBoundingBoxProposals # line: 2241 +from tensorflow.python.ops.gen_image_ops import HSVToRGB # line: 2341 +from tensorflow.python.ops.gen_image_ops import ImageProjectiveTransformV2 # line: 2425 +from tensorflow.python.ops.gen_image_ops import ImageProjectiveTransformV3 # line: 2521 +from tensorflow.python.ops.gen_image_ops import NonMaxSuppression # line: 2618 +from tensorflow.python.ops.gen_image_ops import NonMaxSuppressionV2 # line: 2713 +from tensorflow.python.ops.gen_image_ops import NonMaxSuppressionV3 # line: 2810 +from tensorflow.python.ops.gen_image_ops import NonMaxSuppressionV4 # line: 2926 +from tensorflow.python.ops.gen_image_ops import NonMaxSuppressionV5 # line: 3056 +from tensorflow.python.ops.gen_image_ops import NonMaxSuppressionWithOverlaps # line: 3150 +from tensorflow.python.ops.gen_image_ops import QuantizedResizeBilinear # line: 3245 +from tensorflow.python.ops.gen_image_ops import RGBToHSV # line: 3359 +from tensorflow.python.ops.gen_image_ops import RandomCrop # line: 3440 +from tensorflow.python.ops.gen_image_ops import ResizeArea # line: 3527 +from tensorflow.python.ops.gen_image_ops import ResizeBicubic # line: 3608 +from tensorflow.python.ops.gen_image_ops import ResizeBicubicGrad # line: 3693 +from tensorflow.python.ops.gen_image_ops import ResizeBilinear # line: 3778 +from tensorflow.python.ops.gen_image_ops import ResizeBilinearGrad # line: 3864 +from tensorflow.python.ops.gen_image_ops import ResizeNearestNeighbor # line: 3948 +from tensorflow.python.ops.gen_image_ops import ResizeNearestNeighborGrad # line: 4032 +from tensorflow.python.ops.gen_image_ops import SampleDistortedBoundingBox # line: 4227 +from tensorflow.python.ops.gen_image_ops import SampleDistortedBoundingBoxV2 # line: 4442 +from tensorflow.python.ops.gen_image_ops import ScaleAndTranslate # line: 4546 +from tensorflow.python.ops.gen_image_ops import ScaleAndTranslateGrad # line: 4629 +from tensorflow.python.ops.gen_image_ops import StatelessSampleDistortedBoundingBox # line: 4831 +from tensorflow.python.ops.gen_io_ops import FixedLengthRecordReader # line: 89 +from tensorflow.python.ops.gen_io_ops import FixedLengthRecordReaderV2 # line: 184 +from tensorflow.python.ops.gen_io_ops import IdentityReader # line: 263 +from tensorflow.python.ops.gen_io_ops import IdentityReaderV2 # line: 324 +from tensorflow.python.ops.gen_io_ops import LMDBReader # line: 383 +from tensorflow.python.ops.gen_io_ops import MatchingFiles # line: 460 +from tensorflow.python.ops.gen_io_ops import MergeV2Checkpoints # line: 540 +from tensorflow.python.ops.gen_io_ops import ReadFile # line: 599 +from tensorflow.python.ops.gen_io_ops import ReaderNumRecordsProduced # line: 644 +from tensorflow.python.ops.gen_io_ops import ReaderNumRecordsProducedV2 # line: 691 +from tensorflow.python.ops.gen_io_ops import ReaderNumWorkUnitsCompleted # line: 734 +from tensorflow.python.ops.gen_io_ops import ReaderNumWorkUnitsCompletedV2 # line: 779 +from tensorflow.python.ops.gen_io_ops import ReaderRead # line: 836 +from tensorflow.python.ops.gen_io_ops import ReaderReadUpTo # line: 886 +from tensorflow.python.ops.gen_io_ops import ReaderReadUpToV2 # line: 950 +from tensorflow.python.ops.gen_io_ops import ReaderReadV2 # line: 1021 +from tensorflow.python.ops.gen_io_ops import ReaderReset # line: 1056 +from tensorflow.python.ops.gen_io_ops import ReaderResetV2 # line: 1092 +from tensorflow.python.ops.gen_io_ops import ReaderRestoreState # line: 1130 +from tensorflow.python.ops.gen_io_ops import ReaderRestoreStateV2 # line: 1173 +from tensorflow.python.ops.gen_io_ops import ReaderSerializeState # line: 1216 +from tensorflow.python.ops.gen_io_ops import ReaderSerializeStateV2 # line: 1263 +from tensorflow.python.ops.gen_io_ops import Restore # line: 1354 +from tensorflow.python.ops.gen_io_ops import RestoreSlice # line: 1443 +from tensorflow.python.ops.gen_io_ops import RestoreV2 # line: 1536 +from tensorflow.python.ops.gen_io_ops import Save # line: 1599 +from tensorflow.python.ops.gen_io_ops import SaveSlices # line: 1678 +from tensorflow.python.ops.gen_io_ops import SaveV2 # line: 1739 +from tensorflow.python.ops.gen_io_ops import ShardedFilename # line: 1798 +from tensorflow.python.ops.gen_io_ops import ShardedFilespec # line: 1856 +from tensorflow.python.ops.gen_io_ops import TFRecordReader # line: 1917 +from tensorflow.python.ops.gen_io_ops import TFRecordReaderV2 # line: 1981 +from tensorflow.python.ops.gen_io_ops import TextLineReader # line: 2052 +from tensorflow.python.ops.gen_io_ops import TextLineReaderV2 # line: 2118 +from tensorflow.python.ops.gen_io_ops import WholeFileReader # line: 2185 +from tensorflow.python.ops.gen_io_ops import WholeFileReaderV2 # line: 2246 +from tensorflow.python.ops.gen_io_ops import WriteFile # line: 2332 +from tensorflow.python.ops.gen_linalg_ops import BandedTriangularSolve # line: 77 +from tensorflow.python.ops.gen_linalg_ops import BatchCholesky # line: 140 +from tensorflow.python.ops.gen_linalg_ops import BatchCholeskyGrad # line: 197 +from tensorflow.python.ops.gen_linalg_ops import BatchMatrixDeterminant # line: 254 +from tensorflow.python.ops.gen_linalg_ops import BatchMatrixInverse # line: 316 +from tensorflow.python.ops.gen_linalg_ops import BatchMatrixSolve # line: 382 +from tensorflow.python.ops.gen_linalg_ops import BatchMatrixSolveLs # line: 452 +from tensorflow.python.ops.gen_linalg_ops import BatchMatrixTriangularSolve # line: 525 +from tensorflow.python.ops.gen_linalg_ops import BatchSelfAdjointEig # line: 589 +from tensorflow.python.ops.gen_linalg_ops import BatchSelfAdjointEigV2 # line: 658 +from tensorflow.python.ops.gen_linalg_ops import BatchSvd # line: 739 +from tensorflow.python.ops.gen_linalg_ops import Cholesky # line: 845 +from tensorflow.python.ops.gen_linalg_ops import CholeskyGrad # line: 912 +from tensorflow.python.ops.gen_linalg_ops import Eig # line: 1000 +from tensorflow.python.ops.gen_linalg_ops import Einsum # line: 1146 +from tensorflow.python.ops.gen_linalg_ops import LogMatrixDeterminant # line: 1227 +from tensorflow.python.ops.gen_linalg_ops import Lu # line: 1346 +from tensorflow.python.ops.gen_linalg_ops import MatrixDeterminant # line: 1439 +from tensorflow.python.ops.gen_linalg_ops import MatrixExponential # line: 1496 +from tensorflow.python.ops.gen_linalg_ops import MatrixInverse # line: 1597 +from tensorflow.python.ops.gen_linalg_ops import MatrixLogarithm # line: 1674 +from tensorflow.python.ops.gen_linalg_ops import MatrixSolve # line: 1777 +from tensorflow.python.ops.gen_linalg_ops import MatrixSolveLs # line: 1888 +from tensorflow.python.ops.gen_linalg_ops import MatrixSquareRoot # line: 1993 +from tensorflow.python.ops.gen_linalg_ops import MatrixTriangularSolve # line: 2119 +from tensorflow.python.ops.gen_linalg_ops import Qr # line: 2242 +from tensorflow.python.ops.gen_linalg_ops import SelfAdjointEig # line: 2311 +from tensorflow.python.ops.gen_linalg_ops import SelfAdjointEigV2 # line: 2395 +from tensorflow.python.ops.gen_linalg_ops import Svd # line: 2496 +from tensorflow.python.ops.gen_linalg_ops import TridiagonalMatMul # line: 2573 +from tensorflow.python.ops.gen_linalg_ops import TridiagonalSolve # line: 2661 +from tensorflow.python.ops.gen_list_ops import EmptyTensorList # line: 81 +from tensorflow.python.ops.gen_list_ops import TensorListConcat # line: 164 +from tensorflow.python.ops.gen_list_ops import TensorListConcatLists # line: 229 +from tensorflow.python.ops.gen_list_ops import TensorListConcatV2 # line: 318 +from tensorflow.python.ops.gen_list_ops import TensorListElementShape # line: 384 +from tensorflow.python.ops.gen_list_ops import TensorListFromTensor # line: 451 +from tensorflow.python.ops.gen_list_ops import TensorListGather # line: 524 +from tensorflow.python.ops.gen_list_ops import TensorListGetItem # line: 595 +from tensorflow.python.ops.gen_list_ops import TensorListLength # line: 655 +from tensorflow.python.ops.gen_list_ops import TensorListPopBack # line: 733 +from tensorflow.python.ops.gen_list_ops import TensorListPushBack # line: 799 +from tensorflow.python.ops.gen_list_ops import TensorListPushBackBatch # line: 858 +from tensorflow.python.ops.gen_list_ops import TensorListReserve # line: 930 +from tensorflow.python.ops.gen_list_ops import TensorListResize # line: 991 +from tensorflow.python.ops.gen_list_ops import TensorListScatter # line: 1062 +from tensorflow.python.ops.gen_list_ops import TensorListScatterIntoExistingList # line: 1134 +from tensorflow.python.ops.gen_list_ops import TensorListScatterV2 # line: 1213 +from tensorflow.python.ops.gen_list_ops import TensorListSetItem # line: 1292 +from tensorflow.python.ops.gen_list_ops import TensorListSplit # line: 1367 +from tensorflow.python.ops.gen_list_ops import TensorListStack # line: 1445 +from tensorflow.python.ops.gen_logging_ops import Assert # line: 66 +from tensorflow.python.ops.gen_logging_ops import AudioSummary # line: 146 +from tensorflow.python.ops.gen_logging_ops import AudioSummaryV2 # line: 229 +from tensorflow.python.ops.gen_logging_ops import HistogramSummary # line: 299 +from tensorflow.python.ops.gen_logging_ops import ImageSummary # line: 408 +from tensorflow.python.ops.gen_logging_ops import MergeSummary # line: 484 +from tensorflow.python.ops.gen_logging_ops import Print # line: 570 +from tensorflow.python.ops.gen_logging_ops import PrintV2 # line: 640 +from tensorflow.python.ops.gen_logging_ops import ScalarSummary # line: 704 +from tensorflow.python.ops.gen_logging_ops import TensorSummary # line: 788 +from tensorflow.python.ops.gen_logging_ops import TensorSummaryV2 # line: 866 +from tensorflow.python.ops.gen_logging_ops import Timestamp # line: 960 +from tensorflow.python.ops.gen_lookup_ops import AnonymousHashTable # line: 81 +from tensorflow.python.ops.gen_lookup_ops import AnonymousMutableDenseHashTable # line: 190 +from tensorflow.python.ops.gen_lookup_ops import AnonymousMutableHashTable # line: 277 +from tensorflow.python.ops.gen_lookup_ops import AnonymousMutableHashTableOfTensors # line: 360 +from tensorflow.python.ops.gen_lookup_ops import HashTable # line: 442 +from tensorflow.python.ops.gen_lookup_ops import HashTableV2 # line: 524 +from tensorflow.python.ops.gen_lookup_ops import InitializeTable # line: 577 +from tensorflow.python.ops.gen_lookup_ops import InitializeTableFromTextFile # line: 640 +from tensorflow.python.ops.gen_lookup_ops import InitializeTableFromTextFileV2 # line: 720 +from tensorflow.python.ops.gen_lookup_ops import InitializeTableV2 # line: 784 +from tensorflow.python.ops.gen_lookup_ops import LookupTableExport # line: 841 +from tensorflow.python.ops.gen_lookup_ops import LookupTableExportV2 # line: 903 +from tensorflow.python.ops.gen_lookup_ops import LookupTableFind # line: 960 +from tensorflow.python.ops.gen_lookup_ops import LookupTableFindV2 # line: 1017 +from tensorflow.python.ops.gen_lookup_ops import LookupTableImport # line: 1062 +from tensorflow.python.ops.gen_lookup_ops import LookupTableImportV2 # line: 1107 +from tensorflow.python.ops.gen_lookup_ops import LookupTableInsert # line: 1149 +from tensorflow.python.ops.gen_lookup_ops import LookupTableInsertV2 # line: 1194 +from tensorflow.python.ops.gen_lookup_ops import LookupTableRemoveV2 # line: 1246 +from tensorflow.python.ops.gen_lookup_ops import LookupTableSize # line: 1286 +from tensorflow.python.ops.gen_lookup_ops import LookupTableSizeV2 # line: 1330 +from tensorflow.python.ops.gen_lookup_ops import MutableDenseHashTable # line: 1431 +from tensorflow.python.ops.gen_lookup_ops import MutableDenseHashTableV2 # line: 1547 +from tensorflow.python.ops.gen_lookup_ops import MutableHashTable # line: 1649 +from tensorflow.python.ops.gen_lookup_ops import MutableHashTableOfTensors # line: 1721 +from tensorflow.python.ops.gen_lookup_ops import MutableHashTableOfTensorsV2 # line: 1811 +from tensorflow.python.ops.gen_lookup_ops import MutableHashTableV2 # line: 1921 +from tensorflow.python.ops.gen_manip_ops import Roll # line: 100 +from tensorflow.python.ops.gen_map_ops import EmptyTensorMap # line: 64 +from tensorflow.python.ops.gen_map_ops import TensorMapErase # line: 130 +from tensorflow.python.ops.gen_map_ops import TensorMapHasKey # line: 193 +from tensorflow.python.ops.gen_map_ops import TensorMapInsert # line: 260 +from tensorflow.python.ops.gen_map_ops import TensorMapLookup # line: 329 +from tensorflow.python.ops.gen_map_ops import TensorMapSize # line: 388 +from tensorflow.python.ops.gen_map_ops import TensorMapStackKeys # line: 451 +from tensorflow.python.ops.gen_math_ops import Abs # line: 69 +from tensorflow.python.ops.gen_math_ops import AccumulateNV2 # line: 144 +from tensorflow.python.ops.gen_math_ops import Acos # line: 211 +from tensorflow.python.ops.gen_math_ops import Acosh # line: 302 +from tensorflow.python.ops.gen_math_ops import Add # line: 367 +from tensorflow.python.ops.gen_math_ops import AddN # line: 436 +from tensorflow.python.ops.gen_math_ops import AddV2 # line: 501 +from tensorflow.python.ops.gen_math_ops import All # line: 573 +from tensorflow.python.ops.gen_math_ops import Angle # line: 657 +from tensorflow.python.ops.gen_math_ops import Any # line: 731 +from tensorflow.python.ops.gen_math_ops import ApproximateEqual # line: 797 +from tensorflow.python.ops.gen_math_ops import ArgMax # line: 882 +from tensorflow.python.ops.gen_math_ops import ArgMin # line: 967 +from tensorflow.python.ops.gen_math_ops import Asin # line: 1070 +from tensorflow.python.ops.gen_math_ops import Asinh # line: 1163 +from tensorflow.python.ops.gen_math_ops import Atan # line: 1263 +from tensorflow.python.ops.gen_math_ops import Atan2 # line: 1361 +from tensorflow.python.ops.gen_math_ops import Atanh # line: 1457 +from tensorflow.python.ops.gen_math_ops import BatchMatMul # line: 1548 +from tensorflow.python.ops.gen_math_ops import BatchMatMulV2 # line: 1649 +from tensorflow.python.ops.gen_math_ops import BatchMatMulV3 # line: 1758 +from tensorflow.python.ops.gen_math_ops import Betainc # line: 1867 +from tensorflow.python.ops.gen_math_ops import Bincount # line: 1938 +from tensorflow.python.ops.gen_math_ops import Bucketize # line: 2016 +from tensorflow.python.ops.gen_math_ops import Cast # line: 2086 +from tensorflow.python.ops.gen_math_ops import Ceil # line: 2146 +from tensorflow.python.ops.gen_math_ops import ClipByValue # line: 2215 +from tensorflow.python.ops.gen_math_ops import Complex # line: 2294 +from tensorflow.python.ops.gen_math_ops import ComplexAbs # line: 2371 +from tensorflow.python.ops.gen_math_ops import Conj # line: 2444 +from tensorflow.python.ops.gen_math_ops import Cos # line: 2537 +from tensorflow.python.ops.gen_math_ops import Cosh # line: 2630 +from tensorflow.python.ops.gen_math_ops import Cross # line: 2722 +from tensorflow.python.ops.gen_math_ops import Cumprod # line: 2830 +from tensorflow.python.ops.gen_math_ops import Cumsum # line: 2944 +from tensorflow.python.ops.gen_math_ops import CumulativeLogsumexp # line: 3046 +from tensorflow.python.ops.gen_math_ops import DenseBincount # line: 3136 +from tensorflow.python.ops.gen_math_ops import Digamma # line: 3227 +from tensorflow.python.ops.gen_math_ops import Div # line: 3288 +from tensorflow.python.ops.gen_math_ops import DivNoNan # line: 3350 +from tensorflow.python.ops.gen_math_ops import Equal # line: 3429 +from tensorflow.python.ops.gen_math_ops import Erf # line: 3525 +from tensorflow.python.ops.gen_math_ops import Erfc # line: 3610 +from tensorflow.python.ops.gen_math_ops import Erfinv # line: 3667 +from tensorflow.python.ops.gen_math_ops import EuclideanNorm # line: 3740 +from tensorflow.python.ops.gen_math_ops import Exp # line: 3827 +from tensorflow.python.ops.gen_math_ops import Expm1 # line: 3925 +from tensorflow.python.ops.gen_math_ops import Floor # line: 3982 +from tensorflow.python.ops.gen_math_ops import FloorDiv # line: 4070 +from tensorflow.python.ops.gen_math_ops import FloorMod # line: 4164 +from tensorflow.python.ops.gen_math_ops import Greater # line: 4265 +from tensorflow.python.ops.gen_math_ops import GreaterEqual # line: 4366 +from tensorflow.python.ops.gen_math_ops import HistogramFixedWidth # line: 4455 +from tensorflow.python.ops.gen_math_ops import Igamma # line: 4559 +from tensorflow.python.ops.gen_math_ops import IgammaGradA # line: 4618 +from tensorflow.python.ops.gen_math_ops import Igammac # line: 4717 +from tensorflow.python.ops.gen_math_ops import Imag # line: 4793 +from tensorflow.python.ops.gen_math_ops import Inv # line: 4854 +from tensorflow.python.ops.gen_math_ops import InvGrad # line: 4914 +from tensorflow.python.ops.gen_math_ops import IsFinite # line: 5010 +from tensorflow.python.ops.gen_math_ops import IsInf # line: 5106 +from tensorflow.python.ops.gen_math_ops import IsNan # line: 5202 +from tensorflow.python.ops.gen_math_ops import Less # line: 5302 +from tensorflow.python.ops.gen_math_ops import LessEqual # line: 5403 +from tensorflow.python.ops.gen_math_ops import Lgamma # line: 5499 +from tensorflow.python.ops.gen_math_ops import LinSpace # line: 5573 +from tensorflow.python.ops.gen_math_ops import Log # line: 5668 +from tensorflow.python.ops.gen_math_ops import Log1p # line: 5760 +from tensorflow.python.ops.gen_math_ops import LogicalAnd # line: 5898 +from tensorflow.python.ops.gen_math_ops import LogicalNot # line: 5986 +from tensorflow.python.ops.gen_math_ops import LogicalOr # line: 6124 +from tensorflow.python.ops.gen_math_ops import MatMul # line: 6205 +from tensorflow.python.ops.gen_math_ops import Max # line: 6286 +from tensorflow.python.ops.gen_math_ops import Maximum # line: 6390 +from tensorflow.python.ops.gen_math_ops import Mean # line: 6465 +from tensorflow.python.ops.gen_math_ops import Min # line: 6542 +from tensorflow.python.ops.gen_math_ops import Minimum # line: 6649 +from tensorflow.python.ops.gen_math_ops import Mod # line: 6714 +from tensorflow.python.ops.gen_math_ops import Mul # line: 6775 +from tensorflow.python.ops.gen_math_ops import MulNoNan # line: 6836 +from tensorflow.python.ops.gen_math_ops import Ndtri # line: 6893 +from tensorflow.python.ops.gen_math_ops import Neg # line: 6978 +from tensorflow.python.ops.gen_math_ops import NextAfter # line: 7071 +from tensorflow.python.ops.gen_math_ops import NotEqual # line: 7142 +from tensorflow.python.ops.gen_math_ops import Polygamma # line: 7240 +from tensorflow.python.ops.gen_math_ops import Pow # line: 7308 +from tensorflow.python.ops.gen_math_ops import Prod # line: 7382 +from tensorflow.python.ops.gen_math_ops import QuantizeDownAndShrinkRange # line: 7486 +from tensorflow.python.ops.gen_math_ops import QuantizedAdd # line: 7574 +from tensorflow.python.ops.gen_math_ops import QuantizedMatMul # line: 7697 +from tensorflow.python.ops.gen_math_ops import QuantizedMul # line: 7799 +from tensorflow.python.ops.gen_math_ops import RaggedBincount # line: 7891 +from tensorflow.python.ops.gen_math_ops import Range # line: 7970 +from tensorflow.python.ops.gen_math_ops import Real # line: 8045 +from tensorflow.python.ops.gen_math_ops import RealDiv # line: 8137 +from tensorflow.python.ops.gen_math_ops import Reciprocal # line: 8225 +from tensorflow.python.ops.gen_math_ops import ReciprocalGrad # line: 8286 +from tensorflow.python.ops.gen_math_ops import RequantizationRange # line: 8361 +from tensorflow.python.ops.gen_math_ops import RequantizationRangePerChannel # line: 8442 +from tensorflow.python.ops.gen_math_ops import Requantize # line: 8537 +from tensorflow.python.ops.gen_math_ops import RequantizePerChannel # line: 8629 +from tensorflow.python.ops.gen_math_ops import Rint # line: 8730 +from tensorflow.python.ops.gen_math_ops import Round # line: 8790 +from tensorflow.python.ops.gen_math_ops import Rsqrt # line: 8848 +from tensorflow.python.ops.gen_math_ops import RsqrtGrad # line: 8908 +from tensorflow.python.ops.gen_math_ops import SegmentMax # line: 9029 +from tensorflow.python.ops.gen_math_ops import SegmentMaxV2 # line: 9140 +from tensorflow.python.ops.gen_math_ops import SegmentMean # line: 9266 +from tensorflow.python.ops.gen_math_ops import SegmentMin # line: 9388 +from tensorflow.python.ops.gen_math_ops import SegmentMinV2 # line: 9499 +from tensorflow.python.ops.gen_math_ops import SegmentProd # line: 9623 +from tensorflow.python.ops.gen_math_ops import SegmentProdV2 # line: 9725 +from tensorflow.python.ops.gen_math_ops import SegmentSum # line: 9848 +from tensorflow.python.ops.gen_math_ops import SegmentSumV2 # line: 9932 +from tensorflow.python.ops.gen_math_ops import Select # line: 10034 +from tensorflow.python.ops.gen_math_ops import SelectV2 # line: 10094 +from tensorflow.python.ops.gen_math_ops import Sigmoid # line: 10154 +from tensorflow.python.ops.gen_math_ops import SigmoidGrad # line: 10214 +from tensorflow.python.ops.gen_math_ops import Sign # line: 10279 +from tensorflow.python.ops.gen_math_ops import Sin # line: 10371 +from tensorflow.python.ops.gen_math_ops import Sinh # line: 10464 +from tensorflow.python.ops.gen_math_ops import SobolSample # line: 10537 +from tensorflow.python.ops.gen_math_ops import SparseBincount # line: 10627 +from tensorflow.python.ops.gen_math_ops import SparseMatMul # line: 10728 +from tensorflow.python.ops.gen_math_ops import SparseSegmentMean # line: 10821 +from tensorflow.python.ops.gen_math_ops import SparseSegmentMeanGrad # line: 10900 +from tensorflow.python.ops.gen_math_ops import SparseSegmentMeanGradV2 # line: 10987 +from tensorflow.python.ops.gen_math_ops import SparseSegmentMeanWithNumSegments # line: 11078 +from tensorflow.python.ops.gen_math_ops import SparseSegmentSqrtN # line: 11164 +from tensorflow.python.ops.gen_math_ops import SparseSegmentSqrtNGrad # line: 11243 +from tensorflow.python.ops.gen_math_ops import SparseSegmentSqrtNGradV2 # line: 11331 +from tensorflow.python.ops.gen_math_ops import SparseSegmentSqrtNWithNumSegments # line: 11424 +from tensorflow.python.ops.gen_math_ops import SparseSegmentSum # line: 11536 +from tensorflow.python.ops.gen_math_ops import SparseSegmentSumGrad # line: 11615 +from tensorflow.python.ops.gen_math_ops import SparseSegmentSumGradV2 # line: 11702 +from tensorflow.python.ops.gen_math_ops import SparseSegmentSumWithNumSegments # line: 11814 +from tensorflow.python.ops.gen_math_ops import Sqrt # line: 11881 +from tensorflow.python.ops.gen_math_ops import SqrtGrad # line: 11941 +from tensorflow.python.ops.gen_math_ops import Square # line: 12030 +from tensorflow.python.ops.gen_math_ops import SquaredDifference # line: 12119 +from tensorflow.python.ops.gen_math_ops import Sub # line: 12254 +from tensorflow.python.ops.gen_math_ops import Sum # line: 12328 +from tensorflow.python.ops.gen_math_ops import Tan # line: 12425 +from tensorflow.python.ops.gen_math_ops import Tanh # line: 12519 +from tensorflow.python.ops.gen_math_ops import TanhGrad # line: 12580 +from tensorflow.python.ops.gen_math_ops import TruncateDiv # line: 12673 +from tensorflow.python.ops.gen_math_ops import TruncateMod # line: 12765 +from tensorflow.python.ops.gen_math_ops import UnsortedSegmentMax # line: 12901 +from tensorflow.python.ops.gen_math_ops import UnsortedSegmentMin # line: 13035 +from tensorflow.python.ops.gen_math_ops import UnsortedSegmentProd # line: 13169 +from tensorflow.python.ops.gen_math_ops import UnsortedSegmentSum # line: 13304 +from tensorflow.python.ops.gen_math_ops import Xdivy # line: 13365 +from tensorflow.python.ops.gen_math_ops import Xlog1py # line: 13423 +from tensorflow.python.ops.gen_math_ops import Xlogy # line: 13508 +from tensorflow.python.ops.gen_math_ops import Zeta # line: 13600 +from tensorflow.python.ops.gen_nccl_ops import NcclAllReduce # line: 91 +from tensorflow.python.ops.gen_nccl_ops import NcclBroadcast # line: 162 +from tensorflow.python.ops.gen_nccl_ops import NcclReduce # line: 237 +from tensorflow.python.ops.gen_nn_ops import ApproxTopK # line: 167 +from tensorflow.python.ops.gen_nn_ops import AvgPool # line: 279 +from tensorflow.python.ops.gen_nn_ops import AvgPool3D # line: 388 +from tensorflow.python.ops.gen_nn_ops import AvgPool3DGrad # line: 497 +from tensorflow.python.ops.gen_nn_ops import AvgPoolGrad # line: 606 +from tensorflow.python.ops.gen_nn_ops import BatchNormWithGlobalNormalization # line: 712 +from tensorflow.python.ops.gen_nn_ops import BatchNormWithGlobalNormalizationGrad # line: 816 +from tensorflow.python.ops.gen_nn_ops import BiasAdd # line: 895 +from tensorflow.python.ops.gen_nn_ops import BiasAddGrad # line: 973 +from tensorflow.python.ops.gen_nn_ops import BiasAddV1 # line: 1040 +from tensorflow.python.ops.gen_nn_ops import Conv # line: 1218 +from tensorflow.python.ops.gen_nn_ops import Conv2D # line: 1398 +from tensorflow.python.ops.gen_nn_ops import Conv2DBackpropFilter # line: 1559 +from tensorflow.python.ops.gen_nn_ops import Conv2DBackpropFilterV2 # line: 1764 +from tensorflow.python.ops.gen_nn_ops import Conv2DBackpropInput # line: 1927 +from tensorflow.python.ops.gen_nn_ops import Conv2DBackpropInputV2 # line: 2130 +from tensorflow.python.ops.gen_nn_ops import Conv3D # line: 2266 +from tensorflow.python.ops.gen_nn_ops import Conv3DBackpropFilter # line: 2373 +from tensorflow.python.ops.gen_nn_ops import Conv3DBackpropFilterV2 # line: 2538 +from tensorflow.python.ops.gen_nn_ops import Conv3DBackpropInput # line: 2648 +from tensorflow.python.ops.gen_nn_ops import Conv3DBackpropInputV2 # line: 2772 +from tensorflow.python.ops.gen_nn_ops import DataFormatDimMap # line: 2866 +from tensorflow.python.ops.gen_nn_ops import DataFormatVecPermute # line: 2976 +from tensorflow.python.ops.gen_nn_ops import DepthwiseConv2dNative # line: 3111 +from tensorflow.python.ops.gen_nn_ops import DepthwiseConv2dNativeBackpropFilter # line: 3262 +from tensorflow.python.ops.gen_nn_ops import DepthwiseConv2dNativeBackpropInput # line: 3414 +from tensorflow.python.ops.gen_nn_ops import Dilation2D # line: 3549 +from tensorflow.python.ops.gen_nn_ops import Dilation2DBackpropFilter # line: 3649 +from tensorflow.python.ops.gen_nn_ops import Dilation2DBackpropInput # line: 3749 +from tensorflow.python.ops.gen_nn_ops import Elu # line: 3863 +from tensorflow.python.ops.gen_nn_ops import EluGrad # line: 3923 +from tensorflow.python.ops.gen_nn_ops import FractionalAvgPool # line: 4061 +from tensorflow.python.ops.gen_nn_ops import FractionalAvgPoolGrad # line: 4176 +from tensorflow.python.ops.gen_nn_ops import FractionalMaxPool # line: 4343 +from tensorflow.python.ops.gen_nn_ops import FractionalMaxPoolGrad # line: 4455 +from tensorflow.python.ops.gen_nn_ops import FusedBatchNorm # line: 4575 +from tensorflow.python.ops.gen_nn_ops import FusedBatchNormGrad # line: 4704 +from tensorflow.python.ops.gen_nn_ops import FusedBatchNormGradV2 # line: 4830 +from tensorflow.python.ops.gen_nn_ops import FusedBatchNormGradV3 # line: 4964 +from tensorflow.python.ops.gen_nn_ops import FusedBatchNormV2 # line: 5093 +from tensorflow.python.ops.gen_nn_ops import FusedBatchNormV3 # line: 5225 +from tensorflow.python.ops.gen_nn_ops import FusedPadConv2D # line: 5334 +from tensorflow.python.ops.gen_nn_ops import FusedResizeAndPadConv2D # line: 5450 +from tensorflow.python.ops.gen_nn_ops import InTopK # line: 5541 +from tensorflow.python.ops.gen_nn_ops import InTopKV2 # line: 5619 +from tensorflow.python.ops.gen_nn_ops import IsotonicRegression # line: 5694 +from tensorflow.python.ops.gen_nn_ops import L2Loss # line: 5785 +from tensorflow.python.ops.gen_nn_ops import LRN # line: 5908 +from tensorflow.python.ops.gen_nn_ops import LRNGrad # line: 6008 +from tensorflow.python.ops.gen_nn_ops import LeakyRelu # line: 6082 +from tensorflow.python.ops.gen_nn_ops import LeakyReluGrad # line: 6150 +from tensorflow.python.ops.gen_nn_ops import LogSoftmax # line: 6215 +from tensorflow.python.ops.gen_nn_ops import MaxPool # line: 6317 +from tensorflow.python.ops.gen_nn_ops import MaxPool3D # line: 6430 +from tensorflow.python.ops.gen_nn_ops import MaxPool3DGrad # line: 6543 +from tensorflow.python.ops.gen_nn_ops import MaxPool3DGradGrad # line: 6658 +from tensorflow.python.ops.gen_nn_ops import MaxPoolGrad # line: 6781 +from tensorflow.python.ops.gen_nn_ops import MaxPoolGradGrad # line: 6902 +from tensorflow.python.ops.gen_nn_ops import MaxPoolGradGradV2 # line: 7002 +from tensorflow.python.ops.gen_nn_ops import MaxPoolGradGradWithArgmax # line: 7106 +from tensorflow.python.ops.gen_nn_ops import MaxPoolGradV2 # line: 7208 +from tensorflow.python.ops.gen_nn_ops import MaxPoolGradWithArgmax # line: 7312 +from tensorflow.python.ops.gen_nn_ops import MaxPoolV2 # line: 7409 +from tensorflow.python.ops.gen_nn_ops import MaxPoolWithArgmax # line: 7530 +from tensorflow.python.ops.gen_nn_ops import NthElement # line: 7623 +from tensorflow.python.ops.gen_nn_ops import QuantizedAvgPool # line: 7722 +from tensorflow.python.ops.gen_nn_ops import QuantizedBatchNormWithGlobalNormalization # line: 7873 +from tensorflow.python.ops.gen_nn_ops import QuantizedBiasAdd # line: 7975 +from tensorflow.python.ops.gen_nn_ops import QuantizedConv2D # line: 8103 +from tensorflow.python.ops.gen_nn_ops import QuantizedConv2DAndRelu # line: 8241 +from tensorflow.python.ops.gen_nn_ops import QuantizedConv2DAndReluAndRequantize # line: 8398 +from tensorflow.python.ops.gen_nn_ops import QuantizedConv2DAndRequantize # line: 8555 +from tensorflow.python.ops.gen_nn_ops import QuantizedConv2DPerChannel # line: 8701 +from tensorflow.python.ops.gen_nn_ops import QuantizedConv2DWithBias # line: 8841 +from tensorflow.python.ops.gen_nn_ops import QuantizedConv2DWithBiasAndRelu # line: 8993 +from tensorflow.python.ops.gen_nn_ops import QuantizedConv2DWithBiasAndReluAndRequantize # line: 9156 +from tensorflow.python.ops.gen_nn_ops import QuantizedConv2DWithBiasAndRequantize # line: 9320 +from tensorflow.python.ops.gen_nn_ops import QuantizedConv2DWithBiasSignedSumAndReluAndRequantize # line: 9493 +from tensorflow.python.ops.gen_nn_ops import QuantizedConv2DWithBiasSumAndRelu # line: 9653 +from tensorflow.python.ops.gen_nn_ops import QuantizedConv2DWithBiasSumAndReluAndRequantize # line: 9825 +from tensorflow.python.ops.gen_nn_ops import QuantizedDepthwiseConv2D # line: 9976 +from tensorflow.python.ops.gen_nn_ops import QuantizedDepthwiseConv2DWithBias # line: 10115 +from tensorflow.python.ops.gen_nn_ops import QuantizedDepthwiseConv2DWithBiasAndRelu # line: 10269 +from tensorflow.python.ops.gen_nn_ops import QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize # line: 10443 +from tensorflow.python.ops.gen_nn_ops import QuantizedMatMulWithBias # line: 10599 +from tensorflow.python.ops.gen_nn_ops import QuantizedMatMulWithBiasAndDequantize # line: 10721 +from tensorflow.python.ops.gen_nn_ops import QuantizedMatMulWithBiasAndRelu # line: 10864 +from tensorflow.python.ops.gen_nn_ops import QuantizedMatMulWithBiasAndReluAndRequantize # line: 11020 +from tensorflow.python.ops.gen_nn_ops import QuantizedMatMulWithBiasAndRequantize # line: 11155 +from tensorflow.python.ops.gen_nn_ops import QuantizedMaxPool # line: 11273 +from tensorflow.python.ops.gen_nn_ops import QuantizedRelu # line: 11366 +from tensorflow.python.ops.gen_nn_ops import QuantizedRelu6 # line: 11450 +from tensorflow.python.ops.gen_nn_ops import QuantizedReluX # line: 11536 +from tensorflow.python.ops.gen_nn_ops import Relu # line: 11630 +from tensorflow.python.ops.gen_nn_ops import Relu6 # line: 11687 +from tensorflow.python.ops.gen_nn_ops import Relu6Grad # line: 11747 +from tensorflow.python.ops.gen_nn_ops import ReluGrad # line: 11808 +from tensorflow.python.ops.gen_nn_ops import Selu # line: 11900 +from tensorflow.python.ops.gen_nn_ops import SeluGrad # line: 11960 +from tensorflow.python.ops.gen_nn_ops import Softmax # line: 12022 +from tensorflow.python.ops.gen_nn_ops import SoftmaxCrossEntropyWithLogits # line: 12094 +from tensorflow.python.ops.gen_nn_ops import Softplus # line: 12152 +from tensorflow.python.ops.gen_nn_ops import SoftplusGrad # line: 12211 +from tensorflow.python.ops.gen_nn_ops import Softsign # line: 12295 +from tensorflow.python.ops.gen_nn_ops import SoftsignGrad # line: 12355 +from tensorflow.python.ops.gen_nn_ops import SparseSoftmaxCrossEntropyWithLogits # line: 12434 +from tensorflow.python.ops.gen_nn_ops import TopK # line: 12525 +from tensorflow.python.ops.gen_nn_ops import TopKV2 # line: 12624 +from tensorflow.python.ops.gen_optional_ops import OptionalFromValue # line: 63 +from tensorflow.python.ops.gen_optional_ops import OptionalGetValue # line: 132 +from tensorflow.python.ops.gen_optional_ops import OptionalHasValue # line: 196 +from tensorflow.python.ops.gen_optional_ops import OptionalNone # line: 249 +from tensorflow.python.ops.gen_parsing_ops import DecodeCSV # line: 107 +from tensorflow.python.ops.gen_parsing_ops import DecodeCompressed # line: 228 +from tensorflow.python.ops.gen_parsing_ops import DecodeJSONExample # line: 298 +from tensorflow.python.ops.gen_parsing_ops import DecodePaddedRaw # line: 370 +from tensorflow.python.ops.gen_parsing_ops import DecodeRaw # line: 445 +from tensorflow.python.ops.gen_parsing_ops import ParseExample # line: 593 +from tensorflow.python.ops.gen_parsing_ops import ParseExampleV2 # line: 793 +from tensorflow.python.ops.gen_parsing_ops import ParseSequenceExample # line: 1106 +from tensorflow.python.ops.gen_parsing_ops import ParseSequenceExampleV2 # line: 1510 +from tensorflow.python.ops.gen_parsing_ops import ParseSingleExample # line: 1767 +from tensorflow.python.ops.gen_parsing_ops import ParseSingleSequenceExample # line: 2030 +from tensorflow.python.ops.gen_parsing_ops import ParseTensor # line: 2206 +from tensorflow.python.ops.gen_parsing_ops import SerializeTensor # line: 2264 +from tensorflow.python.ops.gen_parsing_ops import StringToNumber # line: 2335 +from tensorflow.python.ops.gen_ragged_array_ops import RaggedCross # line: 141 +from tensorflow.python.ops.gen_ragged_array_ops import RaggedFillEmptyRows # line: 277 +from tensorflow.python.ops.gen_ragged_array_ops import RaggedFillEmptyRowsGrad # line: 378 +from tensorflow.python.ops.gen_ragged_array_ops import RaggedGather # line: 499 +from tensorflow.python.ops.gen_ragged_conversion_ops import RaggedTensorFromVariant # line: 113 +from tensorflow.python.ops.gen_ragged_conversion_ops import RaggedTensorToSparse # line: 202 +from tensorflow.python.ops.gen_ragged_conversion_ops import RaggedTensorToTensor # line: 339 +from tensorflow.python.ops.gen_ragged_conversion_ops import RaggedTensorToVariant # line: 442 +from tensorflow.python.ops.gen_ragged_conversion_ops import RaggedTensorToVariantGradient # line: 526 +from tensorflow.python.ops.gen_ragged_math_ops import RaggedRange # line: 102 +from tensorflow.python.ops.gen_random_index_shuffle_ops import RandomIndexShuffle # line: 118 +from tensorflow.python.ops.gen_random_ops import Multinomial # line: 90 +from tensorflow.python.ops.gen_random_ops import ParameterizedTruncatedNormal # line: 190 +from tensorflow.python.ops.gen_random_ops import RandomGamma # line: 280 +from tensorflow.python.ops.gen_random_ops import RandomGammaGrad # line: 344 +from tensorflow.python.ops.gen_random_ops import RandomPoisson # line: 415 +from tensorflow.python.ops.gen_random_ops import RandomPoissonV2 # line: 516 +from tensorflow.python.ops.gen_random_ops import RandomShuffle # line: 606 +from tensorflow.python.ops.gen_random_ops import RandomStandardNormal # line: 691 +from tensorflow.python.ops.gen_random_ops import RandomUniform # line: 778 +from tensorflow.python.ops.gen_random_ops import RandomUniformInt # line: 871 +from tensorflow.python.ops.gen_random_ops import TruncatedNormal # line: 960 +from tensorflow.python.ops.gen_resource_variable_ops import AssignAddVariableOp # line: 62 +from tensorflow.python.ops.gen_resource_variable_ops import AssignSubVariableOp # line: 113 +from tensorflow.python.ops.gen_resource_variable_ops import AssignVariableOp # line: 170 +from tensorflow.python.ops.gen_resource_variable_ops import ConsumeMutexLock # line: 226 +from tensorflow.python.ops.gen_resource_variable_ops import DestroyResourceOp # line: 282 +from tensorflow.python.ops.gen_resource_variable_ops import DisableCopyOnRead # line: 331 +from tensorflow.python.ops.gen_resource_variable_ops import MutexLock # line: 421 +from tensorflow.python.ops.gen_resource_variable_ops import MutexV2 # line: 488 +from tensorflow.python.ops.gen_resource_variable_ops import ReadVariableOp # line: 559 +from tensorflow.python.ops.gen_resource_variable_ops import ResourceGather # line: 649 +from tensorflow.python.ops.gen_resource_variable_ops import ResourceGatherNd # line: 720 +from tensorflow.python.ops.gen_resource_variable_ops import ResourceScatterAdd # line: 796 +from tensorflow.python.ops.gen_resource_variable_ops import ResourceScatterDiv # line: 869 +from tensorflow.python.ops.gen_resource_variable_ops import ResourceScatterMax # line: 942 +from tensorflow.python.ops.gen_resource_variable_ops import ResourceScatterMin # line: 1015 +from tensorflow.python.ops.gen_resource_variable_ops import ResourceScatterMul # line: 1088 +from tensorflow.python.ops.gen_resource_variable_ops import ResourceScatterSub # line: 1161 +from tensorflow.python.ops.gen_resource_variable_ops import ResourceScatterUpdate # line: 1224 +from tensorflow.python.ops.gen_resource_variable_ops import VarHandleOp # line: 1319 +from tensorflow.python.ops.gen_resource_variable_ops import VarIsInitializedOp # line: 1392 +from tensorflow.python.ops.gen_resource_variable_ops import VariableShape # line: 1461 +from tensorflow.python.ops.gen_rnn_ops import BlockLSTM # line: 136 +from tensorflow.python.ops.gen_rnn_ops import BlockLSTMGrad # line: 265 +from tensorflow.python.ops.gen_rnn_ops import BlockLSTMGradV2 # line: 385 +from tensorflow.python.ops.gen_rnn_ops import BlockLSTMV2 # line: 512 +from tensorflow.python.ops.gen_rnn_ops import GRUBlockCell # line: 638 +from tensorflow.python.ops.gen_rnn_ops import GRUBlockCellGrad # line: 797 +from tensorflow.python.ops.gen_rnn_ops import LSTMBlockCell # line: 928 +from tensorflow.python.ops.gen_rnn_ops import LSTMBlockCellGrad # line: 1040 +from tensorflow.python.ops.gen_script_ops import EagerPyFunc # line: 84 +from tensorflow.python.ops.gen_script_ops import PyFunc # line: 163 +from tensorflow.python.ops.gen_script_ops import PyFuncStateless # line: 230 +from tensorflow.python.ops.gen_sdca_ops import SdcaFprint # line: 92 +from tensorflow.python.ops.gen_sdca_ops import SdcaOptimizer # line: 366 +from tensorflow.python.ops.gen_sdca_ops import SdcaOptimizerV2 # line: 655 +from tensorflow.python.ops.gen_sdca_ops import SdcaShrinkL1 # line: 795 +from tensorflow.python.ops.gen_sendrecv_ops import Recv # line: 98 +from tensorflow.python.ops.gen_sendrecv_ops import Send # line: 181 +from tensorflow.python.ops.gen_set_ops import DenseToDenseSetOperation # line: 100 +from tensorflow.python.ops.gen_set_ops import DenseToSparseSetOperation # line: 217 +from tensorflow.python.ops.gen_set_ops import SetSize # line: 304 +from tensorflow.python.ops.gen_set_ops import SparseToSparseSetOperation # line: 437 +from tensorflow.python.ops.gen_sparse_ops import AddManySparseToTensorsMap # line: 115 +from tensorflow.python.ops.gen_sparse_ops import AddSparseToTensorsMap # line: 218 +from tensorflow.python.ops.gen_sparse_ops import DeserializeManySparse # line: 339 +from tensorflow.python.ops.gen_sparse_ops import DeserializeSparse # line: 454 +from tensorflow.python.ops.gen_sparse_ops import SerializeManySparse # line: 537 +from tensorflow.python.ops.gen_sparse_ops import SerializeSparse # line: 615 +from tensorflow.python.ops.gen_sparse_ops import SparseAdd # line: 719 +from tensorflow.python.ops.gen_sparse_ops import SparseAddGrad # line: 807 +from tensorflow.python.ops.gen_sparse_ops import SparseConcat # line: 952 +from tensorflow.python.ops.gen_sparse_ops import SparseCross # line: 1133 +from tensorflow.python.ops.gen_sparse_ops import SparseCrossHashed # line: 1293 +from tensorflow.python.ops.gen_sparse_ops import SparseCrossV2 # line: 1441 +from tensorflow.python.ops.gen_sparse_ops import SparseDenseCwiseAdd # line: 1535 +from tensorflow.python.ops.gen_sparse_ops import SparseDenseCwiseDiv # line: 1607 +from tensorflow.python.ops.gen_sparse_ops import SparseDenseCwiseMul # line: 1683 +from tensorflow.python.ops.gen_sparse_ops import SparseFillEmptyRows # line: 1800 +from tensorflow.python.ops.gen_sparse_ops import SparseFillEmptyRowsGrad # line: 1879 +from tensorflow.python.ops.gen_sparse_ops import SparseReduceMax # line: 1969 +from tensorflow.python.ops.gen_sparse_ops import SparseReduceMaxSparse # line: 2073 +from tensorflow.python.ops.gen_sparse_ops import SparseReduceSum # line: 2167 +from tensorflow.python.ops.gen_sparse_ops import SparseReduceSumSparse # line: 2271 +from tensorflow.python.ops.gen_sparse_ops import SparseReorder # line: 2358 +from tensorflow.python.ops.gen_sparse_ops import SparseReshape # line: 2445 +from tensorflow.python.ops.gen_sparse_ops import SparseSlice # line: 2539 +from tensorflow.python.ops.gen_sparse_ops import SparseSliceGrad # line: 2616 +from tensorflow.python.ops.gen_sparse_ops import SparseSoftmax # line: 2698 +from tensorflow.python.ops.gen_sparse_ops import SparseSparseMaximum # line: 2782 +from tensorflow.python.ops.gen_sparse_ops import SparseSparseMinimum # line: 2869 +from tensorflow.python.ops.gen_sparse_ops import SparseSplit # line: 2975 +from tensorflow.python.ops.gen_sparse_ops import SparseTensorDenseAdd # line: 3051 +from tensorflow.python.ops.gen_sparse_ops import SparseTensorDenseMatMul # line: 3147 +from tensorflow.python.ops.gen_sparse_ops import SparseToDense # line: 3259 +from tensorflow.python.ops.gen_sparse_ops import TakeManySparseFromTensorsMap # line: 3404 +from tensorflow.python.ops.gen_special_math_ops import BesselI0 # line: 65 +from tensorflow.python.ops.gen_special_math_ops import BesselI0e # line: 121 +from tensorflow.python.ops.gen_special_math_ops import BesselI1 # line: 177 +from tensorflow.python.ops.gen_special_math_ops import BesselI1e # line: 233 +from tensorflow.python.ops.gen_special_math_ops import BesselJ0 # line: 289 +from tensorflow.python.ops.gen_special_math_ops import BesselJ1 # line: 345 +from tensorflow.python.ops.gen_special_math_ops import BesselK0 # line: 401 +from tensorflow.python.ops.gen_special_math_ops import BesselK0e # line: 457 +from tensorflow.python.ops.gen_special_math_ops import BesselK1 # line: 513 +from tensorflow.python.ops.gen_special_math_ops import BesselK1e # line: 569 +from tensorflow.python.ops.gen_special_math_ops import BesselY0 # line: 625 +from tensorflow.python.ops.gen_special_math_ops import BesselY1 # line: 681 +from tensorflow.python.ops.gen_special_math_ops import Dawsn # line: 737 +from tensorflow.python.ops.gen_special_math_ops import Expint # line: 793 +from tensorflow.python.ops.gen_special_math_ops import FresnelCos # line: 849 +from tensorflow.python.ops.gen_special_math_ops import FresnelSin # line: 905 +from tensorflow.python.ops.gen_special_math_ops import Spence # line: 961 +from tensorflow.python.ops.gen_spectral_ops import BatchFFT # line: 63 +from tensorflow.python.ops.gen_spectral_ops import BatchFFT2D # line: 117 +from tensorflow.python.ops.gen_spectral_ops import BatchFFT3D # line: 171 +from tensorflow.python.ops.gen_spectral_ops import BatchIFFT # line: 225 +from tensorflow.python.ops.gen_spectral_ops import BatchIFFT2D # line: 279 +from tensorflow.python.ops.gen_spectral_ops import BatchIFFT3D # line: 333 +from tensorflow.python.ops.gen_spectral_ops import FFT # line: 421 +from tensorflow.python.ops.gen_spectral_ops import FFT2D # line: 510 +from tensorflow.python.ops.gen_spectral_ops import FFT3D # line: 599 +from tensorflow.python.ops.gen_spectral_ops import FFTND # line: 701 +from tensorflow.python.ops.gen_spectral_ops import IFFT # line: 792 +from tensorflow.python.ops.gen_spectral_ops import IFFT2D # line: 881 +from tensorflow.python.ops.gen_spectral_ops import IFFT3D # line: 970 +from tensorflow.python.ops.gen_spectral_ops import IFFTND # line: 1072 +from tensorflow.python.ops.gen_spectral_ops import IRFFT # line: 1154 +from tensorflow.python.ops.gen_spectral_ops import IRFFT2D # line: 1238 +from tensorflow.python.ops.gen_spectral_ops import IRFFT3D # line: 1322 +from tensorflow.python.ops.gen_spectral_ops import IRFFTND # line: 1435 +from tensorflow.python.ops.gen_spectral_ops import RFFT # line: 1518 +from tensorflow.python.ops.gen_spectral_ops import RFFT2D # line: 1600 +from tensorflow.python.ops.gen_spectral_ops import RFFT3D # line: 1682 +from tensorflow.python.ops.gen_spectral_ops import RFFTND # line: 1795 +from tensorflow.python.ops.gen_state_ops import Assign # line: 75 +from tensorflow.python.ops.gen_state_ops import AssignAdd # line: 122 +from tensorflow.python.ops.gen_state_ops import AssignSub # line: 169 +from tensorflow.python.ops.gen_state_ops import CountUpTo # line: 209 +from tensorflow.python.ops.gen_state_ops import DestroyTemporaryVariable # line: 256 +from tensorflow.python.ops.gen_state_ops import IsVariableInitialized # line: 293 +from tensorflow.python.ops.gen_state_ops import ResourceCountUpTo # line: 347 +from tensorflow.python.ops.gen_state_ops import ResourceScatterNdAdd # line: 447 +from tensorflow.python.ops.gen_state_ops import ResourceScatterNdMax # line: 514 +from tensorflow.python.ops.gen_state_ops import ResourceScatterNdMin # line: 581 +from tensorflow.python.ops.gen_state_ops import ResourceScatterNdSub # line: 682 +from tensorflow.python.ops.gen_state_ops import ResourceScatterNdUpdate # line: 786 +from tensorflow.python.ops.gen_state_ops import ScatterAdd # line: 872 +from tensorflow.python.ops.gen_state_ops import ScatterDiv # line: 942 +from tensorflow.python.ops.gen_state_ops import ScatterMax # line: 1014 +from tensorflow.python.ops.gen_state_ops import ScatterMin # line: 1086 +from tensorflow.python.ops.gen_state_ops import ScatterMul # line: 1156 +from tensorflow.python.ops.gen_state_ops import ScatterNdAdd # line: 1242 +from tensorflow.python.ops.gen_state_ops import ScatterNdMax # line: 1294 +from tensorflow.python.ops.gen_state_ops import ScatterNdMin # line: 1346 +from tensorflow.python.ops.gen_state_ops import ScatterNdSub # line: 1434 +from tensorflow.python.ops.gen_state_ops import ScatterNdUpdate # line: 1521 +from tensorflow.python.ops.gen_state_ops import ScatterSub # line: 1593 +from tensorflow.python.ops.gen_state_ops import ScatterUpdate # line: 1669 +from tensorflow.python.ops.gen_state_ops import TemporaryVariable # line: 1731 +from tensorflow.python.ops.gen_state_ops import Variable # line: 1780 +from tensorflow.python.ops.gen_state_ops import VariableV2 # line: 1838 +from tensorflow.python.ops.gen_stateful_random_ops import NonDeterministicInts # line: 74 +from tensorflow.python.ops.gen_stateful_random_ops import RngReadAndSkip # line: 141 +from tensorflow.python.ops.gen_stateful_random_ops import RngSkip # line: 198 +from tensorflow.python.ops.gen_stateful_random_ops import StatefulRandomBinomial # line: 268 +from tensorflow.python.ops.gen_stateful_random_ops import StatefulStandardNormal # line: 344 +from tensorflow.python.ops.gen_stateful_random_ops import StatefulStandardNormalV2 # line: 419 +from tensorflow.python.ops.gen_stateful_random_ops import StatefulTruncatedNormal # line: 497 +from tensorflow.python.ops.gen_stateful_random_ops import StatefulUniform # line: 574 +from tensorflow.python.ops.gen_stateful_random_ops import StatefulUniformFullInt # line: 649 +from tensorflow.python.ops.gen_stateful_random_ops import StatefulUniformInt # line: 730 +from tensorflow.python.ops.gen_stateless_random_ops import StatelessMultinomial # line: 83 +from tensorflow.python.ops.gen_stateless_random_ops import StatelessParameterizedTruncatedNormal # line: 164 +from tensorflow.python.ops.gen_stateless_random_ops import StatelessRandomBinomial # line: 249 +from tensorflow.python.ops.gen_stateless_random_ops import StatelessRandomGammaV2 # line: 326 +from tensorflow.python.ops.gen_stateless_random_ops import StatelessRandomNormal # line: 401 +from tensorflow.python.ops.gen_stateless_random_ops import StatelessRandomPoisson # line: 481 +from tensorflow.python.ops.gen_stateless_random_ops import StatelessRandomUniform # line: 559 +from tensorflow.python.ops.gen_stateless_random_ops import StatelessRandomUniformFullInt # line: 637 +from tensorflow.python.ops.gen_stateless_random_ops import StatelessRandomUniformInt # line: 713 +from tensorflow.python.ops.gen_stateless_random_ops import StatelessTruncatedNormal # line: 791 +from tensorflow.python.ops.gen_stateless_random_ops_v2 import StatelessRandomGammaV3 # line: 81 +from tensorflow.python.ops.gen_stateless_random_ops_v2 import StatelessRandomGetAlg # line: 141 +from tensorflow.python.ops.gen_stateless_random_ops_v2 import StatelessRandomGetKeyCounter # line: 207 +from tensorflow.python.ops.gen_stateless_random_ops_v2 import StatelessRandomGetKeyCounterAlg # line: 276 +from tensorflow.python.ops.gen_stateless_random_ops_v2 import StatelessRandomNormalV2 # line: 352 +from tensorflow.python.ops.gen_stateless_random_ops_v2 import StatelessRandomUniformFullIntV2 # line: 435 +from tensorflow.python.ops.gen_stateless_random_ops_v2 import StatelessRandomUniformIntV2 # line: 517 +from tensorflow.python.ops.gen_stateless_random_ops_v2 import StatelessRandomUniformV2 # line: 599 +from tensorflow.python.ops.gen_stateless_random_ops_v2 import StatelessShuffle # line: 680 +from tensorflow.python.ops.gen_stateless_random_ops_v2 import StatelessTruncatedNormalV2 # line: 760 +from tensorflow.python.ops.gen_string_ops import AsString # line: 147 +from tensorflow.python.ops.gen_string_ops import DecodeBase64 # line: 250 +from tensorflow.python.ops.gen_string_ops import EncodeBase64 # line: 345 +from tensorflow.python.ops.gen_string_ops import ReduceJoin # line: 446 +from tensorflow.python.ops.gen_string_ops import RegexFullMatch # line: 524 +from tensorflow.python.ops.gen_string_ops import RegexReplace # line: 597 +from tensorflow.python.ops.gen_string_ops import StaticRegexFullMatch # line: 666 +from tensorflow.python.ops.gen_string_ops import StaticRegexReplace # line: 738 +from tensorflow.python.ops.gen_string_ops import StringFormat # line: 822 +from tensorflow.python.ops.gen_string_ops import StringJoin # line: 908 +from tensorflow.python.ops.gen_string_ops import StringLength # line: 988 +from tensorflow.python.ops.gen_string_ops import StringLower # line: 1083 +from tensorflow.python.ops.gen_string_ops import StringNGrams # line: 1201 +from tensorflow.python.ops.gen_string_ops import StringSplit # line: 1307 +from tensorflow.python.ops.gen_string_ops import StringSplitV2 # line: 1407 +from tensorflow.python.ops.gen_string_ops import StringStrip # line: 1498 +from tensorflow.python.ops.gen_string_ops import StringToHashBucket # line: 1564 +from tensorflow.python.ops.gen_string_ops import StringToHashBucketFast # line: 1667 +from tensorflow.python.ops.gen_string_ops import StringToHashBucketStrong # line: 1788 +from tensorflow.python.ops.gen_string_ops import StringUpper # line: 1888 +from tensorflow.python.ops.gen_string_ops import Substr # line: 2044 +from tensorflow.python.ops.gen_string_ops import UnicodeDecode # line: 2176 +from tensorflow.python.ops.gen_string_ops import UnicodeDecodeWithOffsets # line: 2325 +from tensorflow.python.ops.gen_string_ops import UnicodeEncode # line: 2450 +from tensorflow.python.ops.gen_string_ops import UnicodeScript # line: 2559 +from tensorflow.python.ops.gen_string_ops import UnicodeTranscode # line: 2745 +from tensorflow.python.ops.gen_string_ops import UnsortedSegmentJoin # line: 2828 +from tensorflow.python.ops.gen_summary_ops import CloseSummaryWriter # line: 55 +from tensorflow.python.ops.gen_summary_ops import CreateSummaryDbWriter # line: 107 +from tensorflow.python.ops.gen_summary_ops import CreateSummaryFileWriter # line: 163 +from tensorflow.python.ops.gen_summary_ops import FlushSummaryWriter # line: 211 +from tensorflow.python.ops.gen_summary_ops import ImportEvent # line: 255 +from tensorflow.python.ops.gen_summary_ops import SummaryWriter # line: 317 +from tensorflow.python.ops.gen_summary_ops import WriteAudioSummary # line: 383 +from tensorflow.python.ops.gen_summary_ops import WriteGraphSummary # line: 438 +from tensorflow.python.ops.gen_summary_ops import WriteHistogramSummary # line: 491 +from tensorflow.python.ops.gen_summary_ops import WriteImageSummary # line: 554 +from tensorflow.python.ops.gen_summary_ops import WriteRawProtoSummary # line: 609 +from tensorflow.python.ops.gen_summary_ops import WriteScalarSummary # line: 662 +from tensorflow.python.ops.gen_summary_ops import WriteSummary # line: 718 +from tensorflow.python.ops.gen_sync_ops import SyncDevice # line: 57 +from tensorflow.python.ops.gen_tpu_ops import AllToAll # line: 104 +from tensorflow.python.ops.gen_tpu_ops import AssignVariableXlaConcatND # line: 228 +from tensorflow.python.ops.gen_tpu_ops import CollectivePermute # line: 313 +from tensorflow.python.ops.gen_tpu_ops import ConfigureDistributedTPU # line: 420 +from tensorflow.python.ops.gen_tpu_ops import ConfigureTPUEmbedding # line: 491 +from tensorflow.python.ops.gen_tpu_ops import CrossReplicaSum # line: 556 +from tensorflow.python.ops.gen_tpu_ops import DynamicEnqueueTPUEmbeddingArbitraryTensorBatch # line: 691 +from tensorflow.python.ops.gen_tpu_ops import DynamicEnqueueTPUEmbeddingRaggedTensorBatch # line: 847 +from tensorflow.python.ops.gen_tpu_ops import EnqueueTPUEmbeddingArbitraryTensorBatch # line: 1038 +from tensorflow.python.ops.gen_tpu_ops import EnqueueTPUEmbeddingIntegerBatch # line: 1142 +from tensorflow.python.ops.gen_tpu_ops import EnqueueTPUEmbeddingRaggedTensorBatch # line: 1311 +from tensorflow.python.ops.gen_tpu_ops import EnqueueTPUEmbeddingSparseBatch # line: 1494 +from tensorflow.python.ops.gen_tpu_ops import EnqueueTPUEmbeddingSparseTensorBatch # line: 1689 +from tensorflow.python.ops.gen_tpu_ops import InfeedDequeue # line: 1805 +from tensorflow.python.ops.gen_tpu_ops import InfeedDequeueTuple # line: 1875 +from tensorflow.python.ops.gen_tpu_ops import InfeedEnqueue # line: 1959 +from tensorflow.python.ops.gen_tpu_ops import InfeedEnqueuePrelinearizedBuffer # line: 2026 +from tensorflow.python.ops.gen_tpu_ops import InfeedEnqueueTuple # line: 2103 +from tensorflow.python.ops.gen_tpu_ops import IsTPUEmbeddingInitialized # line: 2173 +from tensorflow.python.ops.gen_tpu_ops import LoadTPUEmbeddingADAMParameters # line: 2260 +from tensorflow.python.ops.gen_tpu_ops import LoadTPUEmbeddingAdadeltaParameters # line: 2356 +from tensorflow.python.ops.gen_tpu_ops import LoadTPUEmbeddingAdagradMomentumParameters # line: 2452 +from tensorflow.python.ops.gen_tpu_ops import LoadTPUEmbeddingAdagradParameters # line: 2545 +from tensorflow.python.ops.gen_tpu_ops import LoadTPUEmbeddingCenteredRMSPropParameters # line: 2641 +from tensorflow.python.ops.gen_tpu_ops import LoadTPUEmbeddingFTRLParameters # line: 2738 +from tensorflow.python.ops.gen_tpu_ops import LoadTPUEmbeddingFrequencyEstimatorParameters # line: 2833 +from tensorflow.python.ops.gen_tpu_ops import LoadTPUEmbeddingMDLAdagradLightParameters # line: 2932 +from tensorflow.python.ops.gen_tpu_ops import LoadTPUEmbeddingMomentumParameters # line: 3026 +from tensorflow.python.ops.gen_tpu_ops import LoadTPUEmbeddingProximalAdagradParameters # line: 3118 +from tensorflow.python.ops.gen_tpu_ops import LoadTPUEmbeddingProximalYogiParameters # line: 3202 +from tensorflow.python.ops.gen_tpu_ops import LoadTPUEmbeddingRMSPropParameters # line: 3296 +from tensorflow.python.ops.gen_tpu_ops import LoadTPUEmbeddingStochasticGradientDescentParameters # line: 3387 +from tensorflow.python.ops.gen_tpu_ops import OutfeedDequeue # line: 3470 +from tensorflow.python.ops.gen_tpu_ops import OutfeedDequeueTuple # line: 3557 +from tensorflow.python.ops.gen_tpu_ops import OutfeedDequeueTupleV2 # line: 3649 +from tensorflow.python.ops.gen_tpu_ops import OutfeedDequeueV2 # line: 3728 +from tensorflow.python.ops.gen_tpu_ops import OutfeedEnqueue # line: 3778 +from tensorflow.python.ops.gen_tpu_ops import OutfeedEnqueueTuple # line: 3823 +from tensorflow.python.ops.gen_tpu_ops import Prelinearize # line: 3893 +from tensorflow.python.ops.gen_tpu_ops import PrelinearizeTuple # line: 3980 +from tensorflow.python.ops.gen_tpu_ops import ReadVariableXlaSplitND # line: 4115 +from tensorflow.python.ops.gen_tpu_ops import RecvTPUEmbeddingActivations # line: 4199 +from tensorflow.python.ops.gen_tpu_ops import RetrieveTPUEmbeddingADAMParameters # line: 4293 +from tensorflow.python.ops.gen_tpu_ops import RetrieveTPUEmbeddingAdadeltaParameters # line: 4398 +from tensorflow.python.ops.gen_tpu_ops import RetrieveTPUEmbeddingAdagradMomentumParameters # line: 4504 +from tensorflow.python.ops.gen_tpu_ops import RetrieveTPUEmbeddingAdagradParameters # line: 4608 +from tensorflow.python.ops.gen_tpu_ops import RetrieveTPUEmbeddingCenteredRMSPropParameters # line: 4715 +from tensorflow.python.ops.gen_tpu_ops import RetrieveTPUEmbeddingFTRLParameters # line: 4820 +from tensorflow.python.ops.gen_tpu_ops import RetrieveTPUEmbeddingFrequencyEstimatorParameters # line: 4925 +from tensorflow.python.ops.gen_tpu_ops import RetrieveTPUEmbeddingMDLAdagradLightParameters # line: 5032 +from tensorflow.python.ops.gen_tpu_ops import RetrieveTPUEmbeddingMomentumParameters # line: 5136 +from tensorflow.python.ops.gen_tpu_ops import RetrieveTPUEmbeddingProximalAdagradParameters # line: 5241 +from tensorflow.python.ops.gen_tpu_ops import RetrieveTPUEmbeddingProximalYogiParameters # line: 5342 +from tensorflow.python.ops.gen_tpu_ops import RetrieveTPUEmbeddingRMSPropParameters # line: 5447 +from tensorflow.python.ops.gen_tpu_ops import RetrieveTPUEmbeddingStochasticGradientDescentParameters # line: 5544 +from tensorflow.python.ops.gen_tpu_ops import SendTPUEmbeddingGradients # line: 5630 +from tensorflow.python.ops.gen_tpu_ops import ShutdownDistributedTPU # line: 5687 +from tensorflow.python.ops.gen_tpu_ops import TPUCompilationResult # line: 5741 +from tensorflow.python.ops.gen_tpu_ops import TPUEmbeddingActivations # line: 5817 +from tensorflow.python.ops.gen_tpu_ops import TPUOrdinalSelector # line: 5878 +from tensorflow.python.ops.gen_tpu_ops import TPUPartitionedCall # line: 5949 +from tensorflow.python.ops.gen_tpu_ops import TPUReplicateMetadata # line: 6101 +from tensorflow.python.ops.gen_tpu_ops import TPUReplicatedInput # line: 6247 +from tensorflow.python.ops.gen_tpu_ops import TPUReplicatedOutput # line: 6332 +from tensorflow.python.ops.gen_tpu_ops import WorkerHeartbeat # line: 6391 +from tensorflow.python.ops.gen_tpu_ops import XlaConcatND # line: 6513 +from tensorflow.python.ops.gen_tpu_ops import XlaSplitND # line: 6648 +from tensorflow.python.ops.gen_tpu_partition_ops import TPUPartitionedInput # line: 80 +from tensorflow.python.ops.gen_tpu_partition_ops import TPUPartitionedInputV2 # line: 168 +from tensorflow.python.ops.gen_tpu_partition_ops import TPUPartitionedOutput # line: 252 +from tensorflow.python.ops.gen_tpu_partition_ops import TPUPartitionedOutputV2 # line: 330 +from tensorflow.python.ops.gen_training_ops import ApplyAdaMax # line: 83 +from tensorflow.python.ops.gen_training_ops import ApplyAdadelta # line: 143 +from tensorflow.python.ops.gen_training_ops import ApplyAdagrad # line: 201 +from tensorflow.python.ops.gen_training_ops import ApplyAdagradDA # line: 260 +from tensorflow.python.ops.gen_training_ops import ApplyAdagradV2 # line: 320 +from tensorflow.python.ops.gen_training_ops import ApplyAdam # line: 394 +from tensorflow.python.ops.gen_training_ops import ApplyAddSign # line: 452 +from tensorflow.python.ops.gen_training_ops import ApplyCenteredRMSProp # line: 531 +from tensorflow.python.ops.gen_training_ops import ApplyFtrl # line: 600 +from tensorflow.python.ops.gen_training_ops import ApplyFtrlV2 # line: 673 +from tensorflow.python.ops.gen_training_ops import ApplyGradientDescent # line: 719 +from tensorflow.python.ops.gen_training_ops import ApplyMomentum # line: 784 +from tensorflow.python.ops.gen_training_ops import ApplyPowerSign # line: 842 +from tensorflow.python.ops.gen_training_ops import ApplyProximalAdagrad # line: 898 +from tensorflow.python.ops.gen_training_ops import ApplyProximalGradientDescent # line: 952 +from tensorflow.python.ops.gen_training_ops import ApplyRMSProp # line: 1020 +from tensorflow.python.ops.gen_training_ops import ResourceApplyAdaMax # line: 1087 +from tensorflow.python.ops.gen_training_ops import ResourceApplyAdadelta # line: 1164 +from tensorflow.python.ops.gen_training_ops import ResourceApplyAdagrad # line: 1238 +from tensorflow.python.ops.gen_training_ops import ResourceApplyAdagradDA # line: 1321 +from tensorflow.python.ops.gen_training_ops import ResourceApplyAdagradV2 # line: 1400 +from tensorflow.python.ops.gen_training_ops import ResourceApplyAdam # line: 1496 +from tensorflow.python.ops.gen_training_ops import ResourceApplyAdamWithAmsgrad # line: 1589 +from tensorflow.python.ops.gen_training_ops import ResourceApplyAddSign # line: 1665 +from tensorflow.python.ops.gen_training_ops import ResourceApplyCenteredRMSProp # line: 1759 +from tensorflow.python.ops.gen_training_ops import ResourceApplyFtrl # line: 1850 +from tensorflow.python.ops.gen_training_ops import ResourceApplyFtrlV2 # line: 1946 +from tensorflow.python.ops.gen_training_ops import ResourceApplyGradientDescent # line: 2013 +from tensorflow.python.ops.gen_training_ops import ResourceApplyKerasMomentum # line: 2094 +from tensorflow.python.ops.gen_training_ops import ResourceApplyMomentum # line: 2179 +from tensorflow.python.ops.gen_training_ops import ResourceApplyPowerSign # line: 2256 +from tensorflow.python.ops.gen_training_ops import ResourceApplyProximalAdagrad # line: 2330 +from tensorflow.python.ops.gen_training_ops import ResourceApplyProximalGradientDescent # line: 2403 +from tensorflow.python.ops.gen_training_ops import ResourceApplyRMSProp # line: 2486 +from tensorflow.python.ops.gen_training_ops import ResourceSparseApplyAdadelta # line: 2563 +from tensorflow.python.ops.gen_training_ops import ResourceSparseApplyAdagrad # line: 2645 +from tensorflow.python.ops.gen_training_ops import ResourceSparseApplyAdagradDA # line: 2734 +from tensorflow.python.ops.gen_training_ops import ResourceSparseApplyAdagradV2 # line: 2821 +from tensorflow.python.ops.gen_training_ops import ResourceSparseApplyCenteredRMSProp # line: 2924 +from tensorflow.python.ops.gen_training_ops import ResourceSparseApplyFtrl # line: 3022 +from tensorflow.python.ops.gen_training_ops import ResourceSparseApplyFtrlV2 # line: 3126 +from tensorflow.python.ops.gen_training_ops import ResourceSparseApplyKerasMomentum # line: 3222 +from tensorflow.python.ops.gen_training_ops import ResourceSparseApplyMomentum # line: 3315 +from tensorflow.python.ops.gen_training_ops import ResourceSparseApplyProximalAdagrad # line: 3401 +from tensorflow.python.ops.gen_training_ops import ResourceSparseApplyProximalGradientDescent # line: 3481 +from tensorflow.python.ops.gen_training_ops import ResourceSparseApplyRMSProp # line: 3570 +from tensorflow.python.ops.gen_training_ops import SparseApplyAdadelta # line: 3646 +from tensorflow.python.ops.gen_training_ops import SparseApplyAdagrad # line: 3709 +from tensorflow.python.ops.gen_training_ops import SparseApplyAdagradDA # line: 3773 +from tensorflow.python.ops.gen_training_ops import SparseApplyAdagradV2 # line: 3839 +from tensorflow.python.ops.gen_training_ops import SparseApplyCenteredRMSProp # line: 3921 +from tensorflow.python.ops.gen_training_ops import SparseApplyFtrl # line: 3997 +from tensorflow.python.ops.gen_training_ops import SparseApplyFtrlV2 # line: 4077 +from tensorflow.python.ops.gen_training_ops import SparseApplyMomentum # line: 4149 +from tensorflow.python.ops.gen_training_ops import SparseApplyProximalAdagrad # line: 4212 +from tensorflow.python.ops.gen_training_ops import SparseApplyProximalGradientDescent # line: 4273 +from tensorflow.python.ops.gen_training_ops import SparseApplyRMSProp # line: 4346 +from tensorflow.python.ops.gen_uniform_quant_ops import UniformDequantize # line: 111 +from tensorflow.python.ops.gen_uniform_quant_ops import UniformQuantize # line: 223 +from tensorflow.python.ops.gen_uniform_quant_ops import UniformQuantizedAdd # line: 432 +from tensorflow.python.ops.gen_uniform_quant_ops import UniformQuantizedClipByValue # line: 562 +from tensorflow.python.ops.gen_uniform_quant_ops import UniformQuantizedConvolution # line: 879 +from tensorflow.python.ops.gen_uniform_quant_ops import UniformQuantizedConvolutionHybrid # line: 1174 +from tensorflow.python.ops.gen_uniform_quant_ops import UniformQuantizedDot # line: 1422 +from tensorflow.python.ops.gen_uniform_quant_ops import UniformQuantizedDotHybrid # line: 1565 +from tensorflow.python.ops.gen_uniform_quant_ops import UniformRequantize # line: 1732 +from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import CSRSparseMatrixComponents # line: 84 +from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import CSRSparseMatrixToDense # line: 146 +from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import CSRSparseMatrixToSparseTensor # line: 218 +from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import DenseToCSRSparseMatrix # line: 279 +from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import SparseMatrixAdd # line: 344 +from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import SparseMatrixMatMul # line: 476 +from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import SparseMatrixMul # line: 563 +from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import SparseMatrixNNZ # line: 618 +from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import SparseMatrixOrderingAMD # line: 722 +from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import SparseMatrixSoftmax # line: 787 +from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import SparseMatrixSoftmaxGrad # line: 849 +from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import SparseMatrixSparseCholesky # line: 992 +from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import SparseMatrixSparseMatMul # line: 1162 +from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import SparseMatrixTranspose # line: 1247 +from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import SparseMatrixZeros # line: 1309 +from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import SparseTensorToCSRSparseMatrix # line: 1371 +from tensorflow.python.user_ops.ops.gen_user_ops import Fact # line: 62 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/saved_model/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/saved_model/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..729df39995f4e7b6170a368e1abaf5f17b1e60aa --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/saved_model/__init__.py @@ -0,0 +1,38 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.saved_model namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.saved_model import experimental +from tensorflow.python.saved_model.constants import ASSETS_DIRECTORY # line: 26 +from tensorflow.python.saved_model.constants import ASSETS_KEY # line: 37 +from tensorflow.python.saved_model.constants import DEBUG_DIRECTORY # line: 97 +from tensorflow.python.saved_model.constants import DEBUG_INFO_FILENAME_PB # line: 107 +from tensorflow.python.saved_model.constants import SAVED_MODEL_FILENAME_PB # line: 76 +from tensorflow.python.saved_model.constants import SAVED_MODEL_FILENAME_PBTXT # line: 88 +from tensorflow.python.saved_model.constants import SAVED_MODEL_SCHEMA_VERSION # line: 64 +from tensorflow.python.saved_model.constants import VARIABLES_DIRECTORY # line: 116 +from tensorflow.python.saved_model.constants import VARIABLES_FILENAME # line: 125 +from tensorflow.python.saved_model.load import load # line: 819 +from tensorflow.python.saved_model.load_options import LoadOptions # line: 21 +from tensorflow.python.saved_model.loader_impl import contains_saved_model # line: 254 +from tensorflow.python.saved_model.save import save # line: 1145 +from tensorflow.python.saved_model.save_options import SaveOptions # line: 92 +from tensorflow.python.saved_model.signature_constants import CLASSIFY_INPUTS # line: 38 +from tensorflow.python.saved_model.signature_constants import CLASSIFY_METHOD_NAME # line: 47 +from tensorflow.python.saved_model.signature_constants import CLASSIFY_OUTPUT_CLASSES # line: 56 +from tensorflow.python.saved_model.signature_constants import CLASSIFY_OUTPUT_SCORES # line: 65 +from tensorflow.python.saved_model.signature_constants import DEFAULT_SERVING_SIGNATURE_DEF_KEY # line: 25 +from tensorflow.python.saved_model.signature_constants import PREDICT_INPUTS # line: 77 +from tensorflow.python.saved_model.signature_constants import PREDICT_METHOD_NAME # line: 86 +from tensorflow.python.saved_model.signature_constants import PREDICT_OUTPUTS # line: 95 +from tensorflow.python.saved_model.signature_constants import REGRESS_INPUTS # line: 107 +from tensorflow.python.saved_model.signature_constants import REGRESS_METHOD_NAME # line: 116 +from tensorflow.python.saved_model.signature_constants import REGRESS_OUTPUTS # line: 125 +from tensorflow.python.saved_model.tag_constants import GPU # line: 44 +from tensorflow.python.saved_model.tag_constants import SERVING # line: 23 +from tensorflow.python.saved_model.tag_constants import TPU # line: 51 +from tensorflow.python.saved_model.tag_constants import TRAINING # line: 31 +from tensorflow.python.trackable.asset import Asset # line: 30 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/saved_model/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/saved_model/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..40daaf08990f910291bd6115b3696b52a48702e6 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/saved_model/experimental/__init__.py @@ -0,0 +1,11 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.saved_model.experimental namespace +""" + +import sys as _sys + +from tensorflow.python.saved_model.fingerprinting import Fingerprint # line: 26 +from tensorflow.python.saved_model.fingerprinting import read_fingerprint # line: 149 +from tensorflow.python.saved_model.save_options import VariablePolicy # line: 26 +from tensorflow.python.trackable.resource import TrackableResource # line: 233 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/sets/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/sets/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9d0e25911cd93fe6da9a471cce9f1ae078dd3ac1 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/sets/__init__.py @@ -0,0 +1,11 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.sets namespace +""" + +import sys as _sys + +from tensorflow.python.ops.sets_impl import set_difference as difference # line: 208 +from tensorflow.python.ops.sets_impl import set_intersection as intersection # line: 137 +from tensorflow.python.ops.sets_impl import set_size as size # line: 30 +from tensorflow.python.ops.sets_impl import set_union as union # line: 289 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/signal/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/signal/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..75bf63034ff4df03813c3cefd775e85e6641d868 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/signal/__init__.py @@ -0,0 +1,41 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.signal namespace +""" + +import sys as _sys + +from tensorflow.python.ops.gen_spectral_ops import fft # line: 353 +from tensorflow.python.ops.gen_spectral_ops import fft2d # line: 442 +from tensorflow.python.ops.gen_spectral_ops import fft3d # line: 531 +from tensorflow.python.ops.gen_spectral_ops import ifft # line: 724 +from tensorflow.python.ops.gen_spectral_ops import ifft2d # line: 813 +from tensorflow.python.ops.gen_spectral_ops import ifft3d # line: 902 +from tensorflow.python.ops.signal.dct_ops import dct # line: 50 +from tensorflow.python.ops.signal.dct_ops import idct # line: 212 +from tensorflow.python.ops.signal.fft_ops import fftnd # line: 400 +from tensorflow.python.ops.signal.fft_ops import fftshift # line: 603 +from tensorflow.python.ops.signal.fft_ops import ifftnd # line: 404 +from tensorflow.python.ops.signal.fft_ops import ifftshift # line: 648 +from tensorflow.python.ops.signal.fft_ops import irfft # line: 411 +from tensorflow.python.ops.signal.fft_ops import irfft2d # line: 417 +from tensorflow.python.ops.signal.fft_ops import irfft3d # line: 423 +from tensorflow.python.ops.signal.fft_ops import irfftnd # line: 430 +from tensorflow.python.ops.signal.fft_ops import rfft # line: 408 +from tensorflow.python.ops.signal.fft_ops import rfft2d # line: 414 +from tensorflow.python.ops.signal.fft_ops import rfft3d # line: 420 +from tensorflow.python.ops.signal.fft_ops import rfftnd # line: 426 +from tensorflow.python.ops.signal.mel_ops import linear_to_mel_weight_matrix # line: 90 +from tensorflow.python.ops.signal.mfcc_ops import mfccs_from_log_mel_spectrograms # line: 25 +from tensorflow.python.ops.signal.reconstruction_ops import overlap_and_add # line: 26 +from tensorflow.python.ops.signal.shape_ops import frame # line: 55 +from tensorflow.python.ops.signal.spectral_ops import inverse_mdct # line: 367 +from tensorflow.python.ops.signal.spectral_ops import inverse_stft # line: 155 +from tensorflow.python.ops.signal.spectral_ops import inverse_stft_window_fn # line: 95 +from tensorflow.python.ops.signal.spectral_ops import mdct # line: 291 +from tensorflow.python.ops.signal.spectral_ops import stft # line: 34 +from tensorflow.python.ops.signal.window_ops import hamming_window # line: 171 +from tensorflow.python.ops.signal.window_ops import hann_window # line: 145 +from tensorflow.python.ops.signal.window_ops import kaiser_bessel_derived_window # line: 92 +from tensorflow.python.ops.signal.window_ops import kaiser_window # line: 53 +from tensorflow.python.ops.signal.window_ops import vorbis_window # line: 120 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/sparse/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/sparse/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9710725d5c87fddbf25edbe45d961e8e446953c2 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/sparse/__init__.py @@ -0,0 +1,37 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.sparse namespace +""" + +import sys as _sys + +from tensorflow.python.framework.sparse_tensor import SparseTensor # line: 47 +from tensorflow.python.ops.array_ops import sparse_mask as mask # line: 1845 +from tensorflow.python.ops.math_ops import sparse_segment_mean_v2 as segment_mean # line: 5003 +from tensorflow.python.ops.math_ops import sparse_segment_sqrt_n_v2 as segment_sqrt_n # line: 5105 +from tensorflow.python.ops.math_ops import sparse_segment_sum_v2 as segment_sum # line: 4861 +from tensorflow.python.ops.sparse_ops import sparse_add_v2 as add # line: 524 +from tensorflow.python.ops.sparse_ops import sparse_bincount as bincount # line: 3205 +from tensorflow.python.ops.sparse_ops import sparse_concat_v2 as concat # line: 400 +from tensorflow.python.ops.sparse_ops import sparse_cross as cross # line: 608 +from tensorflow.python.ops.sparse_ops import sparse_cross_hashed as cross_hashed # line: 666 +from tensorflow.python.ops.sparse_ops import sparse_expand_dims as expand_dims # line: 143 +from tensorflow.python.ops.sparse_ops import sparse_eye as eye # line: 249 +from tensorflow.python.ops.sparse_ops import sparse_fill_empty_rows as fill_empty_rows # line: 2109 +from tensorflow.python.ops.sparse_ops import from_dense # line: 111 +from tensorflow.python.ops.sparse_ops import map_values # line: 2932 +from tensorflow.python.ops.sparse_ops import sparse_maximum as maximum # line: 2734 +from tensorflow.python.ops.sparse_ops import sparse_minimum as minimum # line: 2780 +from tensorflow.python.ops.sparse_ops import sparse_reduce_max_v2 as reduce_max # line: 1246 +from tensorflow.python.ops.sparse_ops import sparse_reduce_sum_v2 as reduce_sum # line: 1480 +from tensorflow.python.ops.sparse_ops import sparse_reorder as reorder # line: 821 +from tensorflow.python.ops.sparse_ops import sparse_reset_shape as reset_shape # line: 2004 +from tensorflow.python.ops.sparse_ops import sparse_reshape as reshape # line: 876 +from tensorflow.python.ops.sparse_ops import sparse_retain as retain # line: 1957 +from tensorflow.python.ops.sparse_ops import sparse_slice as slice # line: 1136 +from tensorflow.python.ops.sparse_ops import sparse_softmax as softmax # line: 2671 +from tensorflow.python.ops.sparse_ops import sparse_tensor_dense_matmul as sparse_dense_matmul # line: 2430 +from tensorflow.python.ops.sparse_ops import sparse_split_v2 as split # line: 1067 +from tensorflow.python.ops.sparse_ops import sparse_tensor_to_dense as to_dense # line: 1681 +from tensorflow.python.ops.sparse_ops import sparse_to_indicator as to_indicator # line: 1737 +from tensorflow.python.ops.sparse_ops import sparse_transpose as transpose # line: 2824 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/strings/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/strings/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f7fd90a27f3293a73be560b9cde37aab2639f134 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/strings/__init__.py @@ -0,0 +1,33 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.strings namespace +""" + +import sys as _sys + +from tensorflow.python.ops.gen_string_ops import as_string # line: 29 +from tensorflow.python.ops.gen_string_ops import string_lower as lower # line: 1009 +from tensorflow.python.ops.gen_string_ops import string_strip as strip # line: 1429 +from tensorflow.python.ops.gen_string_ops import string_to_hash_bucket_fast as to_hash_bucket_fast # line: 1583 +from tensorflow.python.ops.gen_string_ops import string_to_hash_bucket_strong as to_hash_bucket_strong # line: 1688 +from tensorflow.python.ops.gen_string_ops import unicode_script # line: 2477 +from tensorflow.python.ops.gen_string_ops import unicode_transcode # line: 2578 +from tensorflow.python.ops.gen_string_ops import string_upper as upper # line: 1814 +from tensorflow.python.ops.ragged.ragged_string_ops import string_bytes_split as bytes_split # line: 40 +from tensorflow.python.ops.ragged.ragged_string_ops import ngrams # line: 672 +from tensorflow.python.ops.ragged.ragged_string_ops import string_split_v2 as split # line: 466 +from tensorflow.python.ops.ragged.ragged_string_ops import unicode_decode # line: 186 +from tensorflow.python.ops.ragged.ragged_string_ops import unicode_decode_with_offsets # line: 232 +from tensorflow.python.ops.ragged.ragged_string_ops import unicode_encode # line: 88 +from tensorflow.python.ops.ragged.ragged_string_ops import unicode_split # line: 294 +from tensorflow.python.ops.ragged.ragged_string_ops import unicode_split_with_offsets # line: 342 +from tensorflow.python.ops.string_ops import string_format as format # line: 115 +from tensorflow.python.ops.string_ops import string_join as join # line: 551 +from tensorflow.python.ops.string_ops import string_length_v2 as length # line: 412 +from tensorflow.python.ops.string_ops import reduce_join_v2 as reduce_join # line: 332 +from tensorflow.python.ops.string_ops import regex_full_match # line: 47 +from tensorflow.python.ops.string_ops import regex_replace # line: 74 +from tensorflow.python.ops.string_ops import substr_v2 as substr # line: 441 +from tensorflow.python.ops.string_ops import string_to_hash_bucket as to_hash_bucket # line: 505 +from tensorflow.python.ops.string_ops import string_to_number as to_number # line: 462 +from tensorflow.python.ops.string_ops import unsorted_segment_join # line: 586 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/summary/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/summary/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..825d6478cc4d67fe47c8eb30708c3923aa7bb37f --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/summary/__init__.py @@ -0,0 +1,19 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.summary namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.summary import experimental +from tensorflow.python.ops.summary_ops_v2 import SummaryWriter # line: 239 +from tensorflow.python.ops.summary_ops_v2 import create_file_writer_v2 as create_file_writer # line: 511 +from tensorflow.python.ops.summary_ops_v2 import create_noop_writer # line: 636 +from tensorflow.python.ops.summary_ops_v2 import flush # line: 1136 +from tensorflow.python.ops.summary_ops_v2 import graph # line: 1048 +from tensorflow.python.ops.summary_ops_v2 import record_if # line: 152 +from tensorflow.python.ops.summary_ops_v2 import should_record_summaries # line: 133 +from tensorflow.python.ops.summary_ops_v2 import trace_export # line: 1374 +from tensorflow.python.ops.summary_ops_v2 import trace_off # line: 1425 +from tensorflow.python.ops.summary_ops_v2 import trace_on # line: 1329 +from tensorflow.python.ops.summary_ops_v2 import write # line: 732 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/summary/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/summary/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d7152cb936f4610286a0acf0c4dccd669f0c7132 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/summary/experimental/__init__.py @@ -0,0 +1,11 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.summary.experimental namespace +""" + +import sys as _sys + +from tensorflow.python.ops.summary_ops_v2 import get_step # line: 209 +from tensorflow.python.ops.summary_ops_v2 import set_step # line: 220 +from tensorflow.python.ops.summary_ops_v2 import summary_scope # line: 691 +from tensorflow.python.ops.summary_ops_v2 import write_raw_pb # line: 809 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/sysconfig/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/sysconfig/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fa18e873703ecf78b4671ef9145116a150d51f08 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/sysconfig/__init__.py @@ -0,0 +1,15 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.sysconfig namespace +""" + +import sys as _sys + +from tensorflow.python.framework.versions import CXX11_ABI_FLAG # line: 48 +from tensorflow.python.framework.versions import CXX_VERSION # line: 54 +from tensorflow.python.framework.versions import MONOLITHIC_BUILD # line: 60 +from tensorflow.python.platform.sysconfig import get_build_info # line: 122 +from tensorflow.python.platform.sysconfig import get_compile_flags # line: 59 +from tensorflow.python.platform.sysconfig import get_include # line: 33 +from tensorflow.python.platform.sysconfig import get_lib # line: 48 +from tensorflow.python.platform.sysconfig import get_link_flags # line: 94 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/test/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/test/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..22fc0e394dfdd0f90f73807b3058bc335f3a4011 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/test/__init__.py @@ -0,0 +1,23 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.test namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.test import experimental +from tensorflow.python.framework.test_util import TensorFlowTestCase as TestCase # line: 2504 +from tensorflow.python.framework.test_util import assert_equal_graph_def_v2 as assert_equal_graph_def # line: 205 +from tensorflow.python.framework.test_util import create_local_cluster # line: 3921 +from tensorflow.python.framework.test_util import gpu_device_name # line: 156 +from tensorflow.python.framework.test_util import is_gpu_available # line: 1989 +from tensorflow.python.framework.test_util import with_eager_op_as_function # line: 1219 +from tensorflow.python.ops.gradient_checker_v2 import compute_gradient # line: 295 +from tensorflow.python.platform.benchmark import TensorFlowBenchmark as Benchmark # line: 287 +from tensorflow.python.platform.benchmark import benchmark_config # line: 274 +from tensorflow.python.platform.test import disable_with_predicate # line: 131 +from tensorflow.python.platform.test import is_built_with_cuda # line: 89 +from tensorflow.python.platform.test import is_built_with_gpu_support # line: 149 +from tensorflow.python.platform.test import is_built_with_rocm # line: 110 +from tensorflow.python.platform.test import is_built_with_xla # line: 170 +from tensorflow.python.platform.test import main # line: 49 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/test/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/test/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ff027d362fbd63221354d71b6ea76dff623f107d --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/test/experimental/__init__.py @@ -0,0 +1,8 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.test.experimental namespace +""" + +import sys as _sys + +from tensorflow.python.framework.test_util import sync_devices # line: 4146 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/tpu/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/tpu/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..10fd5d34bff32d9d22acd4a70378e21cb3c45417 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/tpu/__init__.py @@ -0,0 +1,9 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.tpu namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.tpu import experimental +from tensorflow.python.tpu.tpu import XLAOptions # line: 230 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/tpu/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/tpu/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b503f33182280abfc4431d208297c4b224cf667f --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/tpu/experimental/__init__.py @@ -0,0 +1,15 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.tpu.experimental namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.tpu.experimental import embedding +from tensorflow.python.distribute.cluster_resolver.tpu_cluster_resolver import initialize_tpu_system # line: 25 +from tensorflow.python.distribute.cluster_resolver.tpu_cluster_resolver import shutdown_tpu_system # line: 26 +from tensorflow.python.tpu.device_assignment import DeviceAssignment # line: 68 +from tensorflow.python.tpu.device_assignment import DeviceOrderMode # line: 56 +from tensorflow.python.tpu.topology import Topology # line: 39 +from tensorflow.python.tpu.tpu_hardware_feature import HardwareFeature # line: 21 +from tensorflow.python.tpu.tpu_system_metadata import TPUSystemMetadata # line: 40 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/tpu/experimental/embedding/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/tpu/experimental/embedding/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9e0c85f7996d7881327306a678031b4ebffdda6f --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/tpu/experimental/embedding/__init__.py @@ -0,0 +1,19 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.tpu.experimental.embedding namespace +""" + +import sys as _sys + +from tensorflow.python.tpu.tpu_embedding_for_serving import TPUEmbeddingForServing # line: 42 +from tensorflow.python.tpu.tpu_embedding_for_serving import cpu_embedding_lookup as serving_embedding_lookup # line: 335 +from tensorflow.python.tpu.tpu_embedding_v1 import TPUEmbeddingV0 # line: 38 +from tensorflow.python.tpu.tpu_embedding_v2 import TPUEmbedding # line: 75 +from tensorflow.python.tpu.tpu_embedding_v2_utils import Adagrad # line: 302 +from tensorflow.python.tpu.tpu_embedding_v2_utils import AdagradMomentum # line: 431 +from tensorflow.python.tpu.tpu_embedding_v2_utils import Adam # line: 752 +from tensorflow.python.tpu.tpu_embedding_v2_utils import FTRL # line: 578 +from tensorflow.python.tpu.tpu_embedding_v2_utils import FeatureConfig # line: 1161 +from tensorflow.python.tpu.tpu_embedding_v2_utils import QuantizationConfig # line: 920 +from tensorflow.python.tpu.tpu_embedding_v2_utils import SGD # line: 186 +from tensorflow.python.tpu.tpu_embedding_v2_utils import TableConfig # line: 984 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/train/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/train/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b319845c4f4bdcd3d442e8785b65ed08d4f33d01 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/train/__init__.py @@ -0,0 +1,34 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.train namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.train import experimental +from tensorflow.python.checkpoint.checkpoint import Checkpoint # line: 2035 +from tensorflow.python.checkpoint.checkpoint_management import CheckpointManager # line: 518 +from tensorflow.python.checkpoint.checkpoint_management import get_checkpoint_state # line: 250 +from tensorflow.python.checkpoint.checkpoint_management import latest_checkpoint # line: 328 +from tensorflow.python.checkpoint.checkpoint_options import CheckpointOptions # line: 24 +from tensorflow.python.checkpoint.checkpoint_view import CheckpointView # line: 28 +from tensorflow.python.checkpoint.trackable_view import TrackableView # line: 25 +from tensorflow.python.training.checkpoint_utils import checkpoints_iterator # line: 181 +from tensorflow.python.training.checkpoint_utils import list_variables # line: 117 +from tensorflow.python.training.checkpoint_utils import load_checkpoint # line: 46 +from tensorflow.python.training.checkpoint_utils import load_variable # line: 83 +from tensorflow.python.training.coordinator import Coordinator # line: 27 +from tensorflow.python.training.moving_averages import ExponentialMovingAverage # line: 283 +from tensorflow.python.training.server_lib import ClusterSpec # line: 242 +from tensorflow.python.training.training import BytesList # line: 131 +from tensorflow.python.training.training import ClusterDef # line: 132 +from tensorflow.python.training.training import Example # line: 133 +from tensorflow.python.training.training import Feature # line: 134 +from tensorflow.python.training.training import FeatureList # line: 136 +from tensorflow.python.training.training import FeatureLists # line: 137 +from tensorflow.python.training.training import Features # line: 135 +from tensorflow.python.training.training import FloatList # line: 138 +from tensorflow.python.training.training import Int64List # line: 139 +from tensorflow.python.training.training import JobDef # line: 140 +from tensorflow.python.training.training import SequenceExample # line: 142 +from tensorflow.python.training.training import ServerDef # line: 143 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/train/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/train/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5a31469418cf82e8e03dd3ad573af2056b35ec72 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/train/experimental/__init__.py @@ -0,0 +1,8 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.train.experimental namespace +""" + +import sys as _sys + +from tensorflow.python.trackable.python_state import PythonState # line: 28 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/types/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/types/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0660b095ff579443a289dac3f27e6d666416effd --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/types/__init__.py @@ -0,0 +1,8 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.types namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.types import experimental diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/types/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/types/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a089f943a3826f41920222d4de34d2d207509136 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/types/experimental/__init__.py @@ -0,0 +1,17 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.types.experimental namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.types.experimental import distributed +from tensorflow.python.types.core import AtomicFunction # line: 143 +from tensorflow.python.types.core import Callable # line: 112 +from tensorflow.python.types.core import ConcreteFunction # line: 170 +from tensorflow.python.types.core import FunctionType # line: 91 +from tensorflow.python.types.core import PolymorphicFunction as GenericFunction # line: 187 +from tensorflow.python.types.core import PolymorphicFunction # line: 187 +from tensorflow.python.types.core import TensorLike # line: 419 +from tensorflow.python.types.trace import SupportsTracingProtocol # line: 307 +from tensorflow.python.types.trace import TraceType # line: 39 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/types/experimental/distributed/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/types/experimental/distributed/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1db2dff92629c06b05e0a4dc3472003807513696 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/types/experimental/distributed/__init__.py @@ -0,0 +1,9 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.types.experimental.distributed namespace +""" + +import sys as _sys + +from tensorflow.python.types.distribute import Mirrored # line: 182 +from tensorflow.python.types.distribute import PerReplica # line: 169 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/version/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/version/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d494fbe6c828c9f311a543b9882150ad2ab33672 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/version/__init__.py @@ -0,0 +1,13 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.version namespace +""" + +import sys as _sys + +from tensorflow.python.framework.versions import COMPILER_VERSION # line: 41 +from tensorflow.python.framework.versions import GIT_VERSION # line: 35 +from tensorflow.python.framework.versions import GRAPH_DEF_VERSION # line: 68 +from tensorflow.python.framework.versions import GRAPH_DEF_VERSION_MIN_CONSUMER # line: 74 +from tensorflow.python.framework.versions import GRAPH_DEF_VERSION_MIN_PRODUCER # line: 82 +from tensorflow.python.framework.versions import VERSION # line: 29 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/xla/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/xla/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..794db274ec42e8ab9412ab9cecd4032193343f50 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/xla/__init__.py @@ -0,0 +1,8 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.xla namespace +""" + +import sys as _sys + +from tensorflow._api.v2.compat.v2.xla import experimental diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/xla/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/xla/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f2c1148ed178739e4a069fc1d4ef5696ec5d8841 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v2/xla/experimental/__init__.py @@ -0,0 +1,9 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.xla.experimental namespace +""" + +import sys as _sys + +from tensorflow.python.compiler.xla.jit import experimental_jit_scope as jit_scope # line: 37 +from tensorflow.python.compiler.xla.xla import compile # line: 62 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/config/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/config/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..75564a3dc4fac135e688c7337f147c2578c6ddec --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/config/__init__.py @@ -0,0 +1,27 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.config namespace +""" + +import sys as _sys + +from tensorflow._api.v2.config import experimental +from tensorflow._api.v2.config import optimizer +from tensorflow._api.v2.config import threading +from tensorflow.python.eager.context import LogicalDevice # line: 290 +from tensorflow.python.eager.context import LogicalDeviceConfiguration # line: 308 +from tensorflow.python.eager.context import PhysicalDevice # line: 345 +from tensorflow.python.eager.polymorphic_function.eager_function_run import experimental_functions_run_eagerly # line: 108 +from tensorflow.python.eager.polymorphic_function.eager_function_run import experimental_run_functions_eagerly # line: 82 +from tensorflow.python.eager.polymorphic_function.eager_function_run import functions_run_eagerly # line: 25 +from tensorflow.python.eager.polymorphic_function.eager_function_run import run_functions_eagerly # line: 31 +from tensorflow.python.eager.remote import connect_to_cluster as experimental_connect_to_cluster # line: 76 +from tensorflow.python.eager.remote import connect_to_remote_host as experimental_connect_to_host # line: 37 +from tensorflow.python.framework.config import get_logical_device_configuration # line: 802 +from tensorflow.python.framework.config import get_soft_device_placement # line: 257 +from tensorflow.python.framework.config import get_visible_devices # line: 500 +from tensorflow.python.framework.config import list_logical_devices # line: 461 +from tensorflow.python.framework.config import list_physical_devices # line: 424 +from tensorflow.python.framework.config import set_logical_device_configuration # line: 843 +from tensorflow.python.framework.config import set_soft_device_placement # line: 283 +from tensorflow.python.framework.config import set_visible_devices # line: 533 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/config/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/config/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..47b2375fa234f413b58109b5e20c4303269866b2 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/config/experimental/__init__.py @@ -0,0 +1,30 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.config.experimental namespace +""" + +import sys as _sys + +from tensorflow.python.eager.context import LogicalDeviceConfiguration as VirtualDeviceConfiguration # line: 308 +from tensorflow.python.framework.config import disable_mlir_bridge # line: 926 +from tensorflow.python.framework.config import enable_mlir_bridge # line: 915 +from tensorflow.python.framework.config import enable_op_determinism # line: 932 +from tensorflow.python.framework.config import enable_tensor_float_32_execution # line: 46 +from tensorflow.python.framework.config import get_device_details # line: 757 +from tensorflow.python.framework.config import get_device_policy # line: 312 +from tensorflow.python.framework.config import get_memory_growth # line: 700 +from tensorflow.python.framework.config import get_memory_info # line: 571 +from tensorflow.python.framework.config import get_memory_usage # line: 664 +from tensorflow.python.framework.config import get_synchronous_execution # line: 386 +from tensorflow.python.framework.config import get_logical_device_configuration as get_virtual_device_configuration # line: 802 +from tensorflow.python.framework.config import get_visible_devices # line: 500 +from tensorflow.python.framework.config import list_logical_devices # line: 461 +from tensorflow.python.framework.config import list_physical_devices # line: 424 +from tensorflow.python.framework.config import reset_memory_stats # line: 620 +from tensorflow.python.framework.config import set_device_policy # line: 340 +from tensorflow.python.framework.config import set_memory_growth # line: 729 +from tensorflow.python.framework.config import set_synchronous_execution # line: 399 +from tensorflow.python.framework.config import set_logical_device_configuration as set_virtual_device_configuration # line: 843 +from tensorflow.python.framework.config import set_visible_devices # line: 533 +from tensorflow.python.framework.config import tensor_float_32_execution_enabled # line: 27 +from tensorflow.python.training.server_lib import ClusterDeviceFilters # line: 495 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/config/optimizer/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/config/optimizer/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..99ac9b167e6467f647d0bf99079ec8048399c91f --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/config/optimizer/__init__.py @@ -0,0 +1,11 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.config.optimizer namespace +""" + +import sys as _sys + +from tensorflow.python.framework.config import get_optimizer_experimental_options as get_experimental_options # line: 198 +from tensorflow.python.framework.config import get_optimizer_jit as get_jit # line: 158 +from tensorflow.python.framework.config import set_optimizer_experimental_options as set_experimental_options # line: 214 +from tensorflow.python.framework.config import set_optimizer_jit as set_jit # line: 172 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/config/threading/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/config/threading/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e912751472b5ee8cecd9df43957afe403ac6c083 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/config/threading/__init__.py @@ -0,0 +1,11 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.config.threading namespace +""" + +import sys as _sys + +from tensorflow.python.framework.config import get_inter_op_parallelism_threads # line: 132 +from tensorflow.python.framework.config import get_intra_op_parallelism_threads # line: 104 +from tensorflow.python.framework.config import set_inter_op_parallelism_threads # line: 145 +from tensorflow.python.framework.config import set_intra_op_parallelism_threads # line: 118 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/data/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/data/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..728bba8fe353930cc785b02e0e0397dc9a0c0e87 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/data/__init__.py @@ -0,0 +1,21 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.data namespace +""" + +import sys as _sys + +from tensorflow._api.v2.data import experimental +from tensorflow.python.data.ops.dataset_ops import AUTOTUNE # line: 102 +from tensorflow.python.data.ops.dataset_ops import DatasetV2 as Dataset # line: 135 +from tensorflow.python.data.ops.dataset_ops import DatasetSpec # line: 4542 +from tensorflow.python.data.ops.dataset_ops import INFINITE as INFINITE_CARDINALITY # line: 112 +from tensorflow.python.data.ops.dataset_ops import NumpyIterator # line: 4707 +from tensorflow.python.data.ops.dataset_ops import UNKNOWN as UNKNOWN_CARDINALITY # line: 113 +from tensorflow.python.data.ops.iterator_ops import IteratorBase as Iterator # line: 557 +from tensorflow.python.data.ops.iterator_ops import IteratorSpec # line: 913 +from tensorflow.python.data.ops.options import Options # line: 493 +from tensorflow.python.data.ops.options import ThreadingOptions # line: 449 +from tensorflow.python.data.ops.readers import FixedLengthRecordDatasetV2 as FixedLengthRecordDataset # line: 569 +from tensorflow.python.data.ops.readers import TFRecordDatasetV2 as TFRecordDataset # line: 386 +from tensorflow.python.data.ops.readers import TextLineDatasetV2 as TextLineDataset # line: 171 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/data/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/data/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2057f63f9dbb87393bf094a25dd77681bc22cac1 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/data/experimental/__init__.py @@ -0,0 +1,67 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.data.experimental namespace +""" + +import sys as _sys + +from tensorflow._api.v2.data.experimental import service +from tensorflow.python.data.experimental.ops.batching import dense_to_ragged_batch # line: 30 +from tensorflow.python.data.experimental.ops.batching import dense_to_sparse_batch # line: 94 +from tensorflow.python.data.experimental.ops.batching import map_and_batch # line: 210 +from tensorflow.python.data.experimental.ops.batching import unbatch # line: 269 +from tensorflow.python.data.experimental.ops.cardinality import INFINITE as INFINITE_CARDINALITY # line: 26 +from tensorflow.python.data.experimental.ops.cardinality import UNKNOWN as UNKNOWN_CARDINALITY # line: 28 +from tensorflow.python.data.experimental.ops.cardinality import assert_cardinality # line: 67 +from tensorflow.python.data.experimental.ops.cardinality import cardinality # line: 33 +from tensorflow.python.data.experimental.ops.counter import CounterV2 as Counter # line: 23 +from tensorflow.python.data.experimental.ops.distribute import SHARD_HINT # line: 31 +from tensorflow.python.data.experimental.ops.enumerate_ops import enumerate_dataset # line: 21 +from tensorflow.python.data.experimental.ops.error_ops import ignore_errors # line: 20 +from tensorflow.python.data.experimental.ops.from_list import from_list # line: 75 +from tensorflow.python.data.experimental.ops.get_single_element import get_single_element # line: 22 +from tensorflow.python.data.experimental.ops.grouping import Reducer # line: 388 +from tensorflow.python.data.experimental.ops.grouping import bucket_by_sequence_length # line: 112 +from tensorflow.python.data.experimental.ops.grouping import group_by_reducer # line: 28 +from tensorflow.python.data.experimental.ops.grouping import group_by_window # line: 59 +from tensorflow.python.data.experimental.ops.interleave_ops import choose_from_datasets_v2 as choose_from_datasets # line: 175 +from tensorflow.python.data.experimental.ops.interleave_ops import parallel_interleave # line: 28 +from tensorflow.python.data.experimental.ops.interleave_ops import sample_from_datasets_v2 as sample_from_datasets # line: 91 +from tensorflow.python.data.experimental.ops.io import load # line: 108 +from tensorflow.python.data.experimental.ops.io import save # line: 26 +from tensorflow.python.data.experimental.ops.iterator_ops import CheckpointInputPipelineHook # line: 105 +from tensorflow.python.data.experimental.ops.iterator_ops import make_saveable_from_iterator # line: 43 +from tensorflow.python.data.experimental.ops.lookup_ops import DatasetInitializer # line: 54 +from tensorflow.python.data.experimental.ops.lookup_ops import index_table_from_dataset # line: 190 +from tensorflow.python.data.experimental.ops.lookup_ops import table_from_dataset # line: 102 +from tensorflow.python.data.experimental.ops.pad_to_cardinality import pad_to_cardinality # line: 26 +from tensorflow.python.data.experimental.ops.parsing_ops import parse_example_dataset # line: 105 +from tensorflow.python.data.experimental.ops.prefetching_ops import copy_to_device # line: 65 +from tensorflow.python.data.experimental.ops.prefetching_ops import prefetch_to_device # line: 33 +from tensorflow.python.data.experimental.ops.random_access import at # line: 22 +from tensorflow.python.data.experimental.ops.random_ops import RandomDatasetV2 as RandomDataset # line: 27 +from tensorflow.python.data.experimental.ops.readers import CsvDatasetV2 as CsvDataset # line: 668 +from tensorflow.python.data.experimental.ops.readers import SqlDatasetV2 as SqlDataset # line: 1156 +from tensorflow.python.data.experimental.ops.readers import make_batched_features_dataset_v2 as make_batched_features_dataset # line: 916 +from tensorflow.python.data.experimental.ops.readers import make_csv_dataset_v2 as make_csv_dataset # line: 326 +from tensorflow.python.data.experimental.ops.resampling import rejection_resample # line: 21 +from tensorflow.python.data.experimental.ops.scan_ops import scan # line: 21 +from tensorflow.python.data.experimental.ops.shuffle_ops import shuffle_and_repeat # line: 62 +from tensorflow.python.data.experimental.ops.snapshot import snapshot # line: 190 +from tensorflow.python.data.experimental.ops.take_while_ops import take_while # line: 21 +from tensorflow.python.data.experimental.ops.unique import unique # line: 21 +from tensorflow.python.data.experimental.ops.writers import TFRecordWriter # line: 27 +from tensorflow.python.data.ops.dataset_ops import AUTOTUNE # line: 104 +from tensorflow.python.data.ops.dataset_ops import from_variant # line: 4514 +from tensorflow.python.data.ops.dataset_ops import get_structure # line: 4349 +from tensorflow.python.data.ops.dataset_ops import to_variant # line: 4529 +from tensorflow.python.data.ops.debug_mode import enable_debug_mode # line: 24 +from tensorflow.python.data.ops.iterator_ops import get_next_as_optional # line: 999 +from tensorflow.python.data.ops.optional_ops import Optional # line: 31 +from tensorflow.python.data.ops.options import AutoShardPolicy # line: 88 +from tensorflow.python.data.ops.options import AutotuneAlgorithm # line: 30 +from tensorflow.python.data.ops.options import AutotuneOptions # line: 193 +from tensorflow.python.data.ops.options import DistributeOptions # line: 262 +from tensorflow.python.data.ops.options import ExternalStatePolicy # line: 155 +from tensorflow.python.data.ops.options import OptimizationOptions # line: 304 +from tensorflow.python.data.ops.options import ThreadingOptions # line: 449 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/data/experimental/service/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/data/experimental/service/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..40450071641553532311f453e8900bd584061343 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/data/experimental/service/__init__.py @@ -0,0 +1,16 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.data.experimental.service namespace +""" + +import sys as _sys + +from tensorflow.python.data.experimental.ops.data_service_ops import CrossTrainerCache # line: 117 +from tensorflow.python.data.experimental.ops.data_service_ops import ShardingPolicy # line: 46 +from tensorflow.python.data.experimental.ops.data_service_ops import distribute # line: 531 +from tensorflow.python.data.experimental.ops.data_service_ops import from_dataset_id # line: 1045 +from tensorflow.python.data.experimental.ops.data_service_ops import register_dataset # line: 839 +from tensorflow.python.data.experimental.service.server_lib import DispatchServer # line: 130 +from tensorflow.python.data.experimental.service.server_lib import DispatcherConfig # line: 44 +from tensorflow.python.data.experimental.service.server_lib import WorkerConfig # line: 292 +from tensorflow.python.data.experimental.service.server_lib import WorkerServer # line: 348 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/debugging/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/debugging/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e00241aec08ade38a18a7084ae5b2bd159de0c93 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/debugging/__init__.py @@ -0,0 +1,39 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.debugging namespace +""" + +import sys as _sys + +from tensorflow._api.v2.debugging import experimental +from tensorflow.python.ops.gen_array_ops import check_numerics # line: 950 +from tensorflow.python.debug.lib.check_numerics_callback import disable_check_numerics # line: 445 +from tensorflow.python.debug.lib.check_numerics_callback import enable_check_numerics # line: 336 +from tensorflow.python.eager.context import get_log_device_placement # line: 2520 +from tensorflow.python.eager.context import set_log_device_placement # line: 2530 +from tensorflow.python.ops.check_ops import assert_equal_v2 as assert_equal # line: 762 +from tensorflow.python.ops.check_ops import assert_greater_v2 as assert_greater # line: 978 +from tensorflow.python.ops.check_ops import assert_greater_equal_v2 as assert_greater_equal # line: 996 +from tensorflow.python.ops.check_ops import assert_integer_v2 as assert_integer # line: 1427 +from tensorflow.python.ops.check_ops import assert_less_v2 as assert_less # line: 942 +from tensorflow.python.ops.check_ops import assert_less_equal_v2 as assert_less_equal # line: 959 +from tensorflow.python.ops.check_ops import assert_near_v2 as assert_near # line: 803 +from tensorflow.python.ops.check_ops import assert_negative_v2 as assert_negative # line: 543 +from tensorflow.python.ops.check_ops import assert_non_negative_v2 as assert_non_negative # line: 650 +from tensorflow.python.ops.check_ops import assert_non_positive_v2 as assert_non_positive # line: 706 +from tensorflow.python.ops.check_ops import assert_none_equal_v2 as assert_none_equal # line: 783 +from tensorflow.python.ops.check_ops import assert_positive_v2 as assert_positive # line: 597 +from tensorflow.python.ops.check_ops import assert_proper_iterable # line: 511 +from tensorflow.python.ops.check_ops import assert_rank_v2 as assert_rank # line: 1064 +from tensorflow.python.ops.check_ops import assert_rank_at_least_v2 as assert_rank_at_least # line: 1162 +from tensorflow.python.ops.check_ops import assert_rank_in_v2 as assert_rank_in # line: 1329 +from tensorflow.python.ops.check_ops import assert_same_float_dtype # line: 2118 +from tensorflow.python.ops.check_ops import assert_scalar_v2 as assert_scalar # line: 2153 +from tensorflow.python.ops.check_ops import assert_shapes_v2 as assert_shapes # line: 1611 +from tensorflow.python.ops.check_ops import assert_type_v2 as assert_type # line: 1487 +from tensorflow.python.ops.check_ops import is_numeric_tensor # line: 1951 +from tensorflow.python.ops.control_flow_assert import Assert # line: 62 +from tensorflow.python.ops.numerics import verify_tensor_all_finite_v2 as assert_all_finite # line: 50 +from tensorflow.python.util.traceback_utils import disable_traceback_filtering # line: 76 +from tensorflow.python.util.traceback_utils import enable_traceback_filtering # line: 51 +from tensorflow.python.util.traceback_utils import is_traceback_filtering_enabled # line: 32 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/debugging/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/debugging/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..027fca471e864d65283389ff5742ad6af93e34eb --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/debugging/experimental/__init__.py @@ -0,0 +1,9 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.debugging.experimental namespace +""" + +import sys as _sys + +from tensorflow.python.debug.lib.dumping_callback import disable_dump_debug_info # line: 863 +from tensorflow.python.debug.lib.dumping_callback import enable_dump_debug_info # line: 672 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/distribute/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/distribute/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..110dbbd41ded24330d6d7e9be3268f7b2c399118 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/distribute/__init__.py @@ -0,0 +1,36 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.distribute namespace +""" + +import sys as _sys + +from tensorflow._api.v2.distribute import cluster_resolver +from tensorflow._api.v2.distribute import coordinator +from tensorflow._api.v2.distribute import experimental +from tensorflow.python.distribute.collective_all_reduce_strategy import CollectiveAllReduceStrategy as MultiWorkerMirroredStrategy # line: 56 +from tensorflow.python.distribute.cross_device_ops import CrossDeviceOps # line: 251 +from tensorflow.python.distribute.cross_device_ops import HierarchicalCopyAllReduce # line: 996 +from tensorflow.python.distribute.cross_device_ops import NcclAllReduce # line: 959 +from tensorflow.python.distribute.cross_device_ops import ReductionToOneDevice # line: 581 +from tensorflow.python.distribute.distribute_lib import InputContext # line: 841 +from tensorflow.python.distribute.distribute_lib import InputOptions # line: 1015 +from tensorflow.python.distribute.distribute_lib import InputReplicationMode # line: 824 +from tensorflow.python.distribute.distribute_lib import ReplicaContext # line: 3677 +from tensorflow.python.distribute.distribute_lib import RunOptions # line: 980 +from tensorflow.python.distribute.distribute_lib import Strategy # line: 2033 +from tensorflow.python.distribute.distribute_lib import StrategyExtendedV2 as StrategyExtended # line: 2401 +from tensorflow.python.distribute.distribute_lib import experimental_set_strategy # line: 584 +from tensorflow.python.distribute.distribute_lib import get_replica_context # line: 454 +from tensorflow.python.distribute.distribute_lib import get_strategy # line: 543 +from tensorflow.python.distribute.distribute_lib import has_strategy # line: 563 +from tensorflow.python.distribute.distribute_lib import in_cross_replica_context # line: 518 +from tensorflow.python.distribute.mirrored_strategy import MirroredStrategy # line: 199 +from tensorflow.python.distribute.one_device_strategy import OneDeviceStrategy # line: 38 +from tensorflow.python.distribute.parameter_server_strategy_v2 import ParameterServerStrategyV2 as ParameterServerStrategy # line: 72 +from tensorflow.python.distribute.reduce_util import ReduceOp # line: 23 +from tensorflow.python.distribute.tpu_strategy import TPUStrategyV2 as TPUStrategy # line: 242 +from tensorflow.python.training.server_lib import Server # line: 94 +from tensorflow.python.types.distribute import DistributedDatasetInterface as DistributedDataset # line: 307 +from tensorflow.python.types.distribute import DistributedIteratorInterface as DistributedIterator # line: 196 +from tensorflow.python.types.distribute import DistributedValues # line: 62 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/distribute/cluster_resolver/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/distribute/cluster_resolver/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5e2c448e26130bec18027e6193802a70203571c0 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/distribute/cluster_resolver/__init__.py @@ -0,0 +1,15 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.distribute.cluster_resolver namespace +""" + +import sys as _sys + +from tensorflow.python.distribute.cluster_resolver.cluster_resolver import ClusterResolver # line: 55 +from tensorflow.python.distribute.cluster_resolver.cluster_resolver import SimpleClusterResolver # line: 288 +from tensorflow.python.distribute.cluster_resolver.cluster_resolver import UnionClusterResolver as UnionResolver # line: 418 +from tensorflow.python.distribute.cluster_resolver.gce_cluster_resolver import GCEClusterResolver # line: 30 +from tensorflow.python.distribute.cluster_resolver.kubernetes_cluster_resolver import KubernetesClusterResolver # line: 23 +from tensorflow.python.distribute.cluster_resolver.slurm_cluster_resolver import SlurmClusterResolver # line: 163 +from tensorflow.python.distribute.cluster_resolver.tfconfig_cluster_resolver import TFConfigClusterResolver # line: 47 +from tensorflow.python.distribute.cluster_resolver.tpu_cluster_resolver import TPUClusterResolver # line: 24 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/distribute/coordinator/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/distribute/coordinator/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bc20621cc409c281e2e4d4042af36724d380c0b0 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/distribute/coordinator/__init__.py @@ -0,0 +1,11 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.distribute.coordinator namespace +""" + +import sys as _sys + +from tensorflow.python.distribute.coordinator.cluster_coordinator import ClusterCoordinator # line: 1397 +from tensorflow.python.distribute.coordinator.coordinator_context import get_current_worker_index as experimental_get_current_worker_index # line: 81 +from tensorflow.python.distribute.coordinator.remote_value import RemoteValue # line: 53 +from tensorflow.python.distribute.coordinator.values import PerWorkerValues as PerWorkerValue # line: 152 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/distribute/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/distribute/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7c43a0ab3dab1a28d876b37750f4fe853e347e5e --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/distribute/experimental/__init__.py @@ -0,0 +1,22 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.distribute.experimental namespace +""" + +import sys as _sys + +from tensorflow._api.v2.distribute.experimental import coordinator +from tensorflow._api.v2.distribute.experimental import partitioners +from tensorflow._api.v2.distribute.experimental import rpc +from tensorflow.python.distribute.central_storage_strategy import CentralStorageStrategy # line: 23 +from tensorflow.python.distribute.collective_all_reduce_strategy import _CollectiveAllReduceStrategyExperimental as MultiWorkerMirroredStrategy # line: 229 +from tensorflow.python.distribute.collective_util import CommunicationImplementation as CollectiveCommunication # line: 26 +from tensorflow.python.distribute.collective_util import Hints as CollectiveHints # line: 168 +from tensorflow.python.distribute.collective_util import CommunicationImplementation # line: 26 +from tensorflow.python.distribute.collective_util import _OptionsExported as CommunicationOptions # line: 50 +from tensorflow.python.distribute.distribute_lib import ValueContext # line: 914 +from tensorflow.python.distribute.failure_handling.failure_handling import PreemptionCheckpointHandler # line: 336 +from tensorflow.python.distribute.failure_handling.failure_handling import TerminationConfig # line: 74 +from tensorflow.python.distribute.failure_handling.preemption_watcher import PreemptionWatcher # line: 44 +from tensorflow.python.distribute.parameter_server_strategy_v2 import ParameterServerStrategyV2 as ParameterServerStrategy # line: 72 +from tensorflow.python.distribute.tpu_strategy import TPUStrategy # line: 667 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/distribute/experimental/coordinator/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/distribute/experimental/coordinator/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f9512c26846e5de071be7322332141cc8d767684 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/distribute/experimental/coordinator/__init__.py @@ -0,0 +1,10 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.distribute.experimental.coordinator namespace +""" + +import sys as _sys + +from tensorflow.python.distribute.coordinator.cluster_coordinator import ClusterCoordinator # line: 1397 +from tensorflow.python.distribute.coordinator.remote_value import RemoteValue # line: 53 +from tensorflow.python.distribute.coordinator.values import PerWorkerValues # line: 152 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/distribute/experimental/partitioners/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/distribute/experimental/partitioners/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b6c0bb99b12e22643a8f05a75f5068c7bd140d30 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/distribute/experimental/partitioners/__init__.py @@ -0,0 +1,11 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.distribute.experimental.partitioners namespace +""" + +import sys as _sys + +from tensorflow.python.distribute.sharded_variable import FixedShardsPartitioner # line: 83 +from tensorflow.python.distribute.sharded_variable import MaxSizePartitioner # line: 175 +from tensorflow.python.distribute.sharded_variable import MinSizePartitioner # line: 114 +from tensorflow.python.distribute.sharded_variable import Partitioner # line: 46 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/distribute/experimental/rpc/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/distribute/experimental/rpc/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..edd2fea388bb5f3fbb3eb4720d1974c9c37872ba --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/distribute/experimental/rpc/__init__.py @@ -0,0 +1,9 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.distribute.experimental.rpc namespace +""" + +import sys as _sys + +from tensorflow.python.distribute.experimental.rpc.rpc_ops import Client # line: 117 +from tensorflow.python.distribute.experimental.rpc.rpc_ops import Server # line: 50 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/dtypes/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/dtypes/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e5dd4cab8bc5a6a73c381a00e143e36f7aee3e7f --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/dtypes/__init__.py @@ -0,0 +1,39 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.dtypes namespace +""" + +import sys as _sys + +from tensorflow._api.v2.dtypes import experimental +from tensorflow.python.framework.dtypes import DType # line: 51 +from tensorflow.python.framework.dtypes import QUANTIZED_DTYPES # line: 771 +from tensorflow.python.framework.dtypes import as_dtype # line: 793 +from tensorflow.python.framework.dtypes import bfloat16 # line: 450 +from tensorflow.python.framework.dtypes import bool # line: 414 +from tensorflow.python.framework.dtypes import complex128 # line: 401 +from tensorflow.python.framework.dtypes import complex64 # line: 394 +from tensorflow.python.framework.dtypes import double # line: 388 +from tensorflow.python.framework.dtypes import float16 # line: 373 +from tensorflow.python.framework.dtypes import float32 # line: 380 +from tensorflow.python.framework.dtypes import float64 # line: 386 +from tensorflow.python.framework.dtypes import half # line: 374 +from tensorflow.python.framework.dtypes import int16 # line: 354 +from tensorflow.python.framework.dtypes import int32 # line: 360 +from tensorflow.python.framework.dtypes import int64 # line: 366 +from tensorflow.python.framework.dtypes import int8 # line: 348 +from tensorflow.python.framework.dtypes import qint16 # line: 426 +from tensorflow.python.framework.dtypes import qint32 # line: 432 +from tensorflow.python.framework.dtypes import qint8 # line: 420 +from tensorflow.python.framework.dtypes import quint16 # line: 444 +from tensorflow.python.framework.dtypes import quint8 # line: 438 +from tensorflow.python.framework.dtypes import resource # line: 312 +from tensorflow.python.framework.dtypes import string # line: 408 +from tensorflow.python.framework.dtypes import uint16 # line: 330 +from tensorflow.python.framework.dtypes import uint32 # line: 336 +from tensorflow.python.framework.dtypes import uint64 # line: 342 +from tensorflow.python.framework.dtypes import uint8 # line: 324 +from tensorflow.python.framework.dtypes import variant # line: 318 +from tensorflow.python.ops.math_ops import cast # line: 944 +from tensorflow.python.ops.math_ops import complex # line: 699 +from tensorflow.python.ops.math_ops import saturate_cast # line: 1028 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/dtypes/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/dtypes/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d17307b985646f250a5485fd51b6551ddf5bf643 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/dtypes/experimental/__init__.py @@ -0,0 +1,11 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.dtypes.experimental namespace +""" + +import sys as _sys + +from tensorflow.python.framework.dtypes import float8_e4m3fn # line: 465 +from tensorflow.python.framework.dtypes import float8_e5m2 # line: 456 +from tensorflow.python.framework.dtypes import int4 # line: 471 +from tensorflow.python.framework.dtypes import uint4 # line: 477 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/errors/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/errors/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..33c6ebfcd059d3966167a016a340fd15603c7278 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/errors/__init__.py @@ -0,0 +1,42 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.errors namespace +""" + +import sys as _sys + +from tensorflow.python.framework.errors_impl import ABORTED # line: 214 +from tensorflow.python.framework.errors_impl import ALREADY_EXISTS # line: 201 +from tensorflow.python.framework.errors_impl import AbortedError # line: 401 +from tensorflow.python.framework.errors_impl import AlreadyExistsError # line: 318 +from tensorflow.python.framework.errors_impl import CANCELLED # line: 189 +from tensorflow.python.framework.errors_impl import CancelledError # line: 227 +from tensorflow.python.framework.errors_impl import DATA_LOSS # line: 224 +from tensorflow.python.framework.errors_impl import DEADLINE_EXCEEDED # line: 196 +from tensorflow.python.framework.errors_impl import DataLossError # line: 480 +from tensorflow.python.framework.errors_impl import DeadlineExceededError # line: 290 +from tensorflow.python.framework.errors_impl import FAILED_PRECONDITION # line: 211 +from tensorflow.python.framework.errors_impl import FailedPreconditionError # line: 383 +from tensorflow.python.framework.errors_impl import INTERNAL # line: 220 +from tensorflow.python.framework.errors_impl import INVALID_ARGUMENT # line: 193 +from tensorflow.python.framework.errors_impl import InternalError # line: 454 +from tensorflow.python.framework.errors_impl import InvalidArgumentError # line: 270 +from tensorflow.python.framework.errors_impl import NOT_FOUND # line: 199 +from tensorflow.python.framework.errors_impl import NotFoundError # line: 303 +from tensorflow.python.framework.errors_impl import OK # line: 187 +from tensorflow.python.framework.errors_impl import OUT_OF_RANGE # line: 216 +from tensorflow.python.framework.errors_impl import OpError # line: 57 +from tensorflow.python.framework.errors_impl import OperatorNotAllowedInGraphError # line: 34 +from tensorflow.python.framework.errors_impl import OutOfRangeError # line: 417 +from tensorflow.python.framework.errors_impl import PERMISSION_DENIED # line: 203 +from tensorflow.python.framework.errors_impl import PermissionDeniedError # line: 338 +from tensorflow.python.framework.errors_impl import RESOURCE_EXHAUSTED # line: 208 +from tensorflow.python.framework.errors_impl import ResourceExhaustedError # line: 367 +from tensorflow.python.framework.errors_impl import UNAUTHENTICATED # line: 206 +from tensorflow.python.framework.errors_impl import UNAVAILABLE # line: 222 +from tensorflow.python.framework.errors_impl import UNIMPLEMENTED # line: 218 +from tensorflow.python.framework.errors_impl import UNKNOWN # line: 191 +from tensorflow.python.framework.errors_impl import UnauthenticatedError # line: 354 +from tensorflow.python.framework.errors_impl import UnavailableError # line: 467 +from tensorflow.python.framework.errors_impl import UnimplementedError # line: 437 +from tensorflow.python.framework.errors_impl import UnknownError # line: 254 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7a8386e1dbc09de3d870d553ea9a485858cdd4b8 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/experimental/__init__.py @@ -0,0 +1,34 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.experimental namespace +""" + +import sys as _sys + +from tensorflow._api.v2.experimental import dlpack +from tensorflow._api.v2.experimental import dtensor +from tensorflow._api.v2.experimental import extension_type +from tensorflow._api.v2.experimental import numpy +from tensorflow._api.v2.experimental import tensorrt +from tensorflow.python.data.ops.optional_ops import Optional # line: 31 +from tensorflow.python.eager.context import async_clear_error # line: 2836 +from tensorflow.python.eager.context import async_scope # line: 2772 +from tensorflow.python.eager.context import function_executor_type # line: 2621 +from tensorflow.python.framework.dtypes import float8_e4m3fn # line: 465 +from tensorflow.python.framework.dtypes import float8_e5m2 # line: 456 +from tensorflow.python.framework.dtypes import int4 # line: 471 +from tensorflow.python.framework.dtypes import uint4 # line: 477 +from tensorflow.python.framework.extension_type import BatchableExtensionType # line: 831 +from tensorflow.python.framework.extension_type import ExtensionType # line: 99 +from tensorflow.python.framework.extension_type import ExtensionTypeBatchEncoder # line: 651 +from tensorflow.python.framework.extension_type import ExtensionTypeSpec # line: 419 +from tensorflow.python.framework.load_library import register_filesystem_plugin # line: 199 +from tensorflow.python.framework.strict_mode import enable_strict_mode # line: 22 +from tensorflow.python.ops.ragged.dynamic_ragged_shape import DynamicRaggedShape # line: 167 +from tensorflow.python.ops.ragged.row_partition import RowPartition # line: 56 +from tensorflow.python.ops.structured.structured_tensor import StructuredTensor # line: 53 +from tensorflow.python.util.dispatch import dispatch_for_api # line: 334 +from tensorflow.python.util.dispatch import dispatch_for_binary_elementwise_apis # line: 878 +from tensorflow.python.util.dispatch import dispatch_for_binary_elementwise_assert_apis # line: 936 +from tensorflow.python.util.dispatch import dispatch_for_unary_elementwise_apis # line: 811 +from tensorflow.python.util.dispatch import unregister_dispatch_for # line: 553 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/experimental/dlpack/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/experimental/dlpack/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..94b291e4e199347097bef6912c61ee24fb114370 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/experimental/dlpack/__init__.py @@ -0,0 +1,9 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.experimental.dlpack namespace +""" + +import sys as _sys + +from tensorflow.python.dlpack.dlpack import from_dlpack # line: 44 +from tensorflow.python.dlpack.dlpack import to_dlpack # line: 22 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/experimental/dtensor/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/experimental/dtensor/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9d24d5df1af9228736b5d99928d0ded8a12e537e --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/experimental/dtensor/__init__.py @@ -0,0 +1,51 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.experimental.dtensor namespace +""" + +import sys as _sys + +from tensorflow.dtensor.python.accelerator_util import initialize_accelerator_system # line: 114 +from tensorflow.dtensor.python.accelerator_util import initialize_accelerator_system as initialize_multi_client # line: 114 +from tensorflow.dtensor.python.accelerator_util import initialize_accelerator_system as initialize_tpu_system # line: 114 +from tensorflow.dtensor.python.accelerator_util import shutdown_accelerator_system # line: 268 +from tensorflow.dtensor.python.accelerator_util import shutdown_accelerator_system as shutdown_tpu_system # line: 268 +from tensorflow.dtensor.python.api import reset_dtensor_device as _reset_dtensor_device # line: 505 +from tensorflow.dtensor.python.api import call_with_layout # line: 37 +from tensorflow.dtensor.python.api import check_layout # line: 395 +from tensorflow.dtensor.python.api import copy_to_mesh # line: 167 +from tensorflow.dtensor.python.api import default_mesh # line: 89 +from tensorflow.dtensor.python.api import device_name # line: 131 +from tensorflow.dtensor.python.api import fetch_layout # line: 379 +from tensorflow.dtensor.python.api import get_default_mesh # line: 115 +from tensorflow.dtensor.python.api import is_dtensor # line: 147 +from tensorflow.dtensor.python.api import pack # line: 191 +from tensorflow.dtensor.python.api import relayout # line: 411 +from tensorflow.dtensor.python.api import relayout_like # line: 452 +from tensorflow.dtensor.python.api import run_on # line: 67 +from tensorflow.dtensor.python.api import unpack # line: 342 +from tensorflow.dtensor.python.config import client_id # line: 86 +from tensorflow.dtensor.python.config import full_job_name # line: 117 +from tensorflow.dtensor.python.config import heartbeat_enabled # line: 168 +from tensorflow.dtensor.python.config import job_name # line: 108 +from tensorflow.dtensor.python.config import jobs # line: 148 +from tensorflow.dtensor.python.config import local_devices # line: 46 +from tensorflow.dtensor.python.config import num_clients # line: 100 +from tensorflow.dtensor.python.config import num_global_devices # line: 80 +from tensorflow.dtensor.python.config import num_local_devices # line: 68 +from tensorflow.dtensor.python.config import preferred_device_type # line: 192 +from tensorflow.dtensor.python.d_checkpoint import DTensorCheckpoint # line: 411 +from tensorflow.dtensor.python.d_variable import DVariable # line: 143 +from tensorflow.dtensor.python.input_util import DTensorDataset # line: 384 +from tensorflow.dtensor.python.layout import Layout # line: 351 +from tensorflow.dtensor.python.layout import MATCH # line: 39 +from tensorflow.dtensor.python.layout import Mesh # line: 53 +from tensorflow.dtensor.python.layout import UNSHARDED # line: 36 +from tensorflow.dtensor.python.mesh_util import barrier # line: 243 +from tensorflow.dtensor.python.mesh_util import create_distributed_mesh # line: 138 +from tensorflow.dtensor.python.mesh_util import create_mesh # line: 70 +from tensorflow.dtensor.python.save_restore import enable_save_as_bf16 # line: 83 +from tensorflow.dtensor.python.save_restore import name_based_restore # line: 100 +from tensorflow.dtensor.python.save_restore import name_based_save # line: 176 +from tensorflow.dtensor.python.save_restore import sharded_save # line: 34 +from tensorflow.dtensor.python.tpu_util import create_tpu_mesh # line: 578 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/experimental/extension_type/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/experimental/extension_type/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..070fcf42ed4902381a6d0d5b105b29d572bbe61e --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/experimental/extension_type/__init__.py @@ -0,0 +1,8 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.experimental.extension_type namespace +""" + +import sys as _sys + +from tensorflow.python.framework.extension_type import as_dict # line: 332 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/experimental/numpy/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/experimental/numpy/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9ae8fa64287b040800eb5c81f5703d88209cb759 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/experimental/numpy/__init__.py @@ -0,0 +1,236 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.experimental.numpy namespace +""" + +import sys as _sys + +from tensorflow._api.v2.experimental.numpy import random +from tensorflow.python.framework.tensor import Tensor as ndarray # line: 139 +from tensorflow.python.ops.numpy_ops.np_array_ops import all # line: 420 +from tensorflow.python.ops.numpy_ops.np_array_ops import amax # line: 672 +from tensorflow.python.ops.numpy_ops.np_array_ops import amin # line: 689 +from tensorflow.python.ops.numpy_ops.np_array_ops import any # line: 427 +from tensorflow.python.ops.numpy_ops.np_array_ops import arange # line: 259 +from tensorflow.python.ops.numpy_ops.np_array_ops import around # line: 820 +from tensorflow.python.ops.numpy_ops.np_array_ops import array # line: 217 +from tensorflow.python.ops.numpy_ops.np_array_ops import asanyarray # line: 246 +from tensorflow.python.ops.numpy_ops.np_array_ops import asarray # line: 234 +from tensorflow.python.ops.numpy_ops.np_array_ops import ascontiguousarray # line: 252 +from tensorflow.python.ops.numpy_ops.np_array_ops import atleast_1d # line: 1293 +from tensorflow.python.ops.numpy_ops.np_array_ops import atleast_2d # line: 1299 +from tensorflow.python.ops.numpy_ops.np_array_ops import atleast_3d # line: 1305 +from tensorflow.python.ops.numpy_ops.np_array_ops import broadcast_arrays # line: 1567 +from tensorflow.python.ops.numpy_ops.np_array_ops import broadcast_to # line: 1192 +from tensorflow.python.ops.numpy_ops.np_array_ops import compress # line: 434 +from tensorflow.python.ops.numpy_ops.np_array_ops import copy # line: 465 +from tensorflow.python.ops.numpy_ops.np_array_ops import cumprod # line: 483 +from tensorflow.python.ops.numpy_ops.np_array_ops import cumsum # line: 500 +from tensorflow.python.ops.numpy_ops.np_array_ops import diag # line: 305 +from tensorflow.python.ops.numpy_ops.np_array_ops import diag_indices # line: 1338 +from tensorflow.python.ops.numpy_ops.np_array_ops import diagflat # line: 389 +from tensorflow.python.ops.numpy_ops.np_array_ops import diagonal # line: 347 +from tensorflow.python.ops.numpy_ops.np_array_ops import dsplit # line: 1187 +from tensorflow.python.ops.numpy_ops.np_array_ops import dstack # line: 1241 +from tensorflow.python.ops.numpy_ops.np_array_ops import empty # line: 53 +from tensorflow.python.ops.numpy_ops.np_array_ops import empty_like # line: 59 +from tensorflow.python.ops.numpy_ops.np_array_ops import expand_dims # line: 875 +from tensorflow.python.ops.numpy_ops.np_array_ops import eye # line: 98 +from tensorflow.python.ops.numpy_ops.np_array_ops import flatten # line: 889 +from tensorflow.python.ops.numpy_ops.np_array_ops import flip # line: 1433 +from tensorflow.python.ops.numpy_ops.np_array_ops import fliplr # line: 1452 +from tensorflow.python.ops.numpy_ops.np_array_ops import flipud # line: 1446 +from tensorflow.python.ops.numpy_ops.np_array_ops import full # line: 136 +from tensorflow.python.ops.numpy_ops.np_array_ops import full_like # line: 148 +from tensorflow.python.ops.numpy_ops.np_array_ops import hsplit # line: 1184 +from tensorflow.python.ops.numpy_ops.np_array_ops import hstack # line: 1214 +from tensorflow.python.ops.numpy_ops.np_array_ops import identity # line: 130 +from tensorflow.python.ops.numpy_ops.np_array_ops import imag # line: 517 +from tensorflow.python.ops.numpy_ops.np_array_ops import isscalar # line: 1114 +from tensorflow.python.ops.numpy_ops.np_array_ops import ix_ # line: 1534 +from tensorflow.python.ops.numpy_ops.np_array_ops import max # line: 1667 +from tensorflow.python.ops.numpy_ops.np_array_ops import mean # line: 657 +from tensorflow.python.ops.numpy_ops.np_array_ops import min # line: 1673 +from tensorflow.python.ops.numpy_ops.np_array_ops import moveaxis # line: 953 +from tensorflow.python.ops.numpy_ops.np_array_ops import ndim # line: 1107 +from tensorflow.python.ops.numpy_ops.np_array_ops import newaxis # line: 48 +from tensorflow.python.ops.numpy_ops.np_array_ops import nonzero # line: 1324 +from tensorflow.python.ops.numpy_ops.np_array_ops import ones # line: 83 +from tensorflow.python.ops.numpy_ops.np_array_ops import ones_like # line: 91 +from tensorflow.python.ops.numpy_ops.np_array_ops import pad # line: 1018 +from tensorflow.python.ops.numpy_ops.np_array_ops import prod # line: 644 +from tensorflow.python.ops.numpy_ops.np_array_ops import ravel # line: 772 +from tensorflow.python.ops.numpy_ops.np_array_ops import real # line: 779 +from tensorflow.python.ops.numpy_ops.np_array_ops import repeat # line: 788 +from tensorflow.python.ops.numpy_ops.np_array_ops import reshape # line: 843 +from tensorflow.python.ops.numpy_ops.np_array_ops import roll # line: 1458 +from tensorflow.python.ops.numpy_ops.np_array_ops import rot90 # line: 1472 +from tensorflow.python.ops.numpy_ops.np_array_ops import round # line: 1679 +from tensorflow.python.ops.numpy_ops.np_array_ops import select # line: 1077 +from tensorflow.python.ops.numpy_ops.np_array_ops import shape # line: 1095 +from tensorflow.python.ops.numpy_ops.np_array_ops import sign # line: 1580 +from tensorflow.python.ops.numpy_ops.np_array_ops import size # line: 615 +from tensorflow.python.ops.numpy_ops.np_array_ops import split # line: 1152 +from tensorflow.python.ops.numpy_ops.np_array_ops import squeeze # line: 882 +from tensorflow.python.ops.numpy_ops.np_array_ops import stack # line: 1198 +from tensorflow.python.ops.numpy_ops.np_array_ops import std # line: 759 +from tensorflow.python.ops.numpy_ops.np_array_ops import sum # line: 631 +from tensorflow.python.ops.numpy_ops.np_array_ops import swapaxes # line: 914 +from tensorflow.python.ops.numpy_ops.np_array_ops import take # line: 1036 +from tensorflow.python.ops.numpy_ops.np_array_ops import take_along_axis # line: 1602 +from tensorflow.python.ops.numpy_ops.np_array_ops import transpose # line: 905 +from tensorflow.python.ops.numpy_ops.np_array_ops import tri # line: 1353 +from tensorflow.python.ops.numpy_ops.np_array_ops import tril # line: 1383 +from tensorflow.python.ops.numpy_ops.np_array_ops import triu # line: 1408 +from tensorflow.python.ops.numpy_ops.np_array_ops import vander # line: 1493 +from tensorflow.python.ops.numpy_ops.np_array_ops import var # line: 706 +from tensorflow.python.ops.numpy_ops.np_array_ops import vsplit # line: 1181 +from tensorflow.python.ops.numpy_ops.np_array_ops import vstack # line: 1230 +from tensorflow.python.ops.numpy_ops.np_array_ops import where # line: 1064 +from tensorflow.python.ops.numpy_ops.np_array_ops import zeros # line: 65 +from tensorflow.python.ops.numpy_ops.np_array_ops import zeros_like # line: 74 +from tensorflow.python.ops.numpy_ops.np_config import enable_numpy_behavior as experimental_enable_numpy_behavior # line: 25 +from tensorflow.python.ops.numpy_ops.np_dtypes import bool_ # line: 27 +from tensorflow.python.ops.numpy_ops.np_dtypes import complex128 # line: 35 +from tensorflow.python.ops.numpy_ops.np_dtypes import complex64 # line: 39 +from tensorflow.python.ops.numpy_ops.np_dtypes import complex_ # line: 31 +from tensorflow.python.ops.numpy_ops.np_dtypes import float16 # line: 47 +from tensorflow.python.ops.numpy_ops.np_dtypes import float32 # line: 51 +from tensorflow.python.ops.numpy_ops.np_dtypes import float64 # line: 55 +from tensorflow.python.ops.numpy_ops.np_dtypes import float_ # line: 43 +from tensorflow.python.ops.numpy_ops.np_dtypes import iinfo # line: 113 +from tensorflow.python.ops.numpy_ops.np_dtypes import inexact # line: 59 +from tensorflow.python.ops.numpy_ops.np_dtypes import int16 # line: 67 +from tensorflow.python.ops.numpy_ops.np_dtypes import int32 # line: 71 +from tensorflow.python.ops.numpy_ops.np_dtypes import int64 # line: 75 +from tensorflow.python.ops.numpy_ops.np_dtypes import int8 # line: 79 +from tensorflow.python.ops.numpy_ops.np_dtypes import int_ # line: 63 +from tensorflow.python.ops.numpy_ops.np_dtypes import issubdtype # line: 118 +from tensorflow.python.ops.numpy_ops.np_dtypes import object_ # line: 83 +from tensorflow.python.ops.numpy_ops.np_dtypes import string_ # line: 87 +from tensorflow.python.ops.numpy_ops.np_dtypes import uint16 # line: 91 +from tensorflow.python.ops.numpy_ops.np_dtypes import uint32 # line: 95 +from tensorflow.python.ops.numpy_ops.np_dtypes import uint64 # line: 99 +from tensorflow.python.ops.numpy_ops.np_dtypes import uint8 # line: 103 +from tensorflow.python.ops.numpy_ops.np_dtypes import unicode_ # line: 107 +from tensorflow.python.ops.numpy_ops.np_math_ops import abs # line: 698 +from tensorflow.python.ops.numpy_ops.np_math_ops import absolute # line: 704 +from tensorflow.python.ops.numpy_ops.np_math_ops import add # line: 90 +from tensorflow.python.ops.numpy_ops.np_math_ops import allclose # line: 542 +from tensorflow.python.ops.numpy_ops.np_math_ops import angle # line: 852 +from tensorflow.python.ops.numpy_ops.np_math_ops import append # line: 1417 +from tensorflow.python.ops.numpy_ops.np_math_ops import arccos # line: 799 +from tensorflow.python.ops.numpy_ops.np_math_ops import arccosh # line: 817 +from tensorflow.python.ops.numpy_ops.np_math_ops import arcsin # line: 793 +from tensorflow.python.ops.numpy_ops.np_math_ops import arcsinh # line: 811 +from tensorflow.python.ops.numpy_ops.np_math_ops import arctan # line: 805 +from tensorflow.python.ops.numpy_ops.np_math_ops import arctan2 # line: 402 +from tensorflow.python.ops.numpy_ops.np_math_ops import arctanh # line: 823 +from tensorflow.python.ops.numpy_ops.np_math_ops import argmax # line: 1405 +from tensorflow.python.ops.numpy_ops.np_math_ops import argmin # line: 1411 +from tensorflow.python.ops.numpy_ops.np_math_ops import argsort # line: 1340 +from tensorflow.python.ops.numpy_ops.np_math_ops import array_equal # line: 1155 +from tensorflow.python.ops.numpy_ops.np_math_ops import average # line: 1426 +from tensorflow.python.ops.numpy_ops.np_math_ops import bitwise_and # line: 630 +from tensorflow.python.ops.numpy_ops.np_math_ops import bitwise_not # line: 648 +from tensorflow.python.ops.numpy_ops.np_math_ops import bitwise_or # line: 636 +from tensorflow.python.ops.numpy_ops.np_math_ops import bitwise_xor # line: 642 +from tensorflow.python.ops.numpy_ops.np_math_ops import cbrt # line: 868 +from tensorflow.python.ops.numpy_ops.np_math_ops import ceil # line: 716 +from tensorflow.python.ops.numpy_ops.np_math_ops import clip # line: 222 +from tensorflow.python.ops.numpy_ops.np_math_ops import concatenate # line: 1298 +from tensorflow.python.ops.numpy_ops.np_math_ops import conj # line: 728 +from tensorflow.python.ops.numpy_ops.np_math_ops import conjugate # line: 879 +from tensorflow.python.ops.numpy_ops.np_math_ops import cos # line: 763 +from tensorflow.python.ops.numpy_ops.np_math_ops import cosh # line: 781 +from tensorflow.python.ops.numpy_ops.np_math_ops import count_nonzero # line: 1334 +from tensorflow.python.ops.numpy_ops.np_math_ops import cross # line: 289 +from tensorflow.python.ops.numpy_ops.np_math_ops import deg2rad # line: 829 +from tensorflow.python.ops.numpy_ops.np_math_ops import diff # line: 1054 +from tensorflow.python.ops.numpy_ops.np_math_ops import divide # line: 144 +from tensorflow.python.ops.numpy_ops.np_math_ops import divmod # line: 182 +from tensorflow.python.ops.numpy_ops.np_math_ops import dot # line: 60 +from tensorflow.python.ops.numpy_ops.np_math_ops import e # line: 51 +from tensorflow.python.ops.numpy_ops.np_math_ops import einsum # line: 1543 +from tensorflow.python.ops.numpy_ops.np_math_ops import equal # line: 1119 +from tensorflow.python.ops.numpy_ops.np_math_ops import exp # line: 686 +from tensorflow.python.ops.numpy_ops.np_math_ops import exp2 # line: 885 +from tensorflow.python.ops.numpy_ops.np_math_ops import expm1 # line: 894 +from tensorflow.python.ops.numpy_ops.np_math_ops import fabs # line: 710 +from tensorflow.python.ops.numpy_ops.np_math_ops import fix # line: 900 +from tensorflow.python.ops.numpy_ops.np_math_ops import float_power # line: 396 +from tensorflow.python.ops.numpy_ops.np_math_ops import floor # line: 722 +from tensorflow.python.ops.numpy_ops.np_math_ops import floor_divide # line: 150 +from tensorflow.python.ops.numpy_ops.np_math_ops import gcd # line: 588 +from tensorflow.python.ops.numpy_ops.np_math_ops import geomspace # line: 1259 +from tensorflow.python.ops.numpy_ops.np_math_ops import greater # line: 1131 +from tensorflow.python.ops.numpy_ops.np_math_ops import greater_equal # line: 1137 +from tensorflow.python.ops.numpy_ops.np_math_ops import heaviside # line: 414 +from tensorflow.python.ops.numpy_ops.np_math_ops import hypot # line: 430 +from tensorflow.python.ops.numpy_ops.np_math_ops import inf # line: 55 +from tensorflow.python.ops.numpy_ops.np_math_ops import inner # line: 273 +from tensorflow.python.ops.numpy_ops.np_math_ops import isclose # line: 524 +from tensorflow.python.ops.numpy_ops.np_math_ops import iscomplex # line: 909 +from tensorflow.python.ops.numpy_ops.np_math_ops import iscomplexobj # line: 921 +from tensorflow.python.ops.numpy_ops.np_math_ops import isfinite # line: 982 +from tensorflow.python.ops.numpy_ops.np_math_ops import isinf # line: 988 +from tensorflow.python.ops.numpy_ops.np_math_ops import isnan # line: 934 +from tensorflow.python.ops.numpy_ops.np_math_ops import isneginf # line: 996 +from tensorflow.python.ops.numpy_ops.np_math_ops import isposinf # line: 1004 +from tensorflow.python.ops.numpy_ops.np_math_ops import isreal # line: 915 +from tensorflow.python.ops.numpy_ops.np_math_ops import isrealobj # line: 928 +from tensorflow.python.ops.numpy_ops.np_math_ops import kron # line: 436 +from tensorflow.python.ops.numpy_ops.np_math_ops import lcm # line: 595 +from tensorflow.python.ops.numpy_ops.np_math_ops import less # line: 1143 +from tensorflow.python.ops.numpy_ops.np_math_ops import less_equal # line: 1149 +from tensorflow.python.ops.numpy_ops.np_math_ops import linspace # line: 1205 +from tensorflow.python.ops.numpy_ops.np_math_ops import log # line: 680 +from tensorflow.python.ops.numpy_ops.np_math_ops import log10 # line: 1018 +from tensorflow.python.ops.numpy_ops.np_math_ops import log1p # line: 1024 +from tensorflow.python.ops.numpy_ops.np_math_ops import log2 # line: 1012 +from tensorflow.python.ops.numpy_ops.np_math_ops import logaddexp # line: 482 +from tensorflow.python.ops.numpy_ops.np_math_ops import logaddexp2 # line: 494 +from tensorflow.python.ops.numpy_ops.np_math_ops import logical_and # line: 1180 +from tensorflow.python.ops.numpy_ops.np_math_ops import logical_not # line: 1198 +from tensorflow.python.ops.numpy_ops.np_math_ops import logical_or # line: 1186 +from tensorflow.python.ops.numpy_ops.np_math_ops import logical_xor # line: 1192 +from tensorflow.python.ops.numpy_ops.np_math_ops import logspace # line: 1246 +from tensorflow.python.ops.numpy_ops.np_math_ops import matmul # line: 236 +from tensorflow.python.ops.numpy_ops.np_math_ops import maximum # line: 188 +from tensorflow.python.ops.numpy_ops.np_math_ops import meshgrid # line: 1514 +from tensorflow.python.ops.numpy_ops.np_math_ops import minimum # line: 210 +from tensorflow.python.ops.numpy_ops.np_math_ops import mod # line: 163 +from tensorflow.python.ops.numpy_ops.np_math_ops import multiply # line: 108 +from tensorflow.python.ops.numpy_ops.np_math_ops import nanmean # line: 965 +from tensorflow.python.ops.numpy_ops.np_math_ops import nanprod # line: 960 +from tensorflow.python.ops.numpy_ops.np_math_ops import nansum # line: 957 +from tensorflow.python.ops.numpy_ops.np_math_ops import negative # line: 734 +from tensorflow.python.ops.numpy_ops.np_math_ops import nextafter # line: 408 +from tensorflow.python.ops.numpy_ops.np_math_ops import not_equal # line: 1125 +from tensorflow.python.ops.numpy_ops.np_math_ops import outer # line: 472 +from tensorflow.python.ops.numpy_ops.np_math_ops import pi # line: 47 +from tensorflow.python.ops.numpy_ops.np_math_ops import polyval # line: 506 +from tensorflow.python.ops.numpy_ops.np_math_ops import positive # line: 1030 +from tensorflow.python.ops.numpy_ops.np_math_ops import power # line: 390 +from tensorflow.python.ops.numpy_ops.np_math_ops import ptp # line: 1290 +from tensorflow.python.ops.numpy_ops.np_math_ops import rad2deg # line: 838 +from tensorflow.python.ops.numpy_ops.np_math_ops import reciprocal # line: 740 +from tensorflow.python.ops.numpy_ops.np_math_ops import remainder # line: 176 +from tensorflow.python.ops.numpy_ops.np_math_ops import signbit # line: 746 +from tensorflow.python.ops.numpy_ops.np_math_ops import sin # line: 757 +from tensorflow.python.ops.numpy_ops.np_math_ops import sinc # line: 1036 +from tensorflow.python.ops.numpy_ops.np_math_ops import sinh # line: 775 +from tensorflow.python.ops.numpy_ops.np_math_ops import sort # line: 1375 +from tensorflow.python.ops.numpy_ops.np_math_ops import sqrt # line: 692 +from tensorflow.python.ops.numpy_ops.np_math_ops import square # line: 1048 +from tensorflow.python.ops.numpy_ops.np_math_ops import subtract # line: 102 +from tensorflow.python.ops.numpy_ops.np_math_ops import tan # line: 769 +from tensorflow.python.ops.numpy_ops.np_math_ops import tanh # line: 787 +from tensorflow.python.ops.numpy_ops.np_math_ops import tensordot # line: 267 +from tensorflow.python.ops.numpy_ops.np_math_ops import tile # line: 1313 +from tensorflow.python.ops.numpy_ops.np_math_ops import trace # line: 1494 +from tensorflow.python.ops.numpy_ops.np_math_ops import true_divide # line: 120 +from tensorflow.python.ops.numpy_ops.np_math_ops import vdot # line: 379 +from tensorflow.python.ops.numpy_ops.np_utils import finfo # line: 486 +from tensorflow.python.ops.numpy_ops.np_utils import promote_types # line: 564 +from tensorflow.python.ops.numpy_ops.np_utils import result_type # line: 518 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/experimental/numpy/random/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/experimental/numpy/random/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5685f57e5a34b4f331a102216729bf8f07e0ebee --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/experimental/numpy/random/__init__.py @@ -0,0 +1,15 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.experimental.numpy.random namespace +""" + +import sys as _sys + +from tensorflow.python.ops.numpy_ops.np_random import poisson # line: 94 +from tensorflow.python.ops.numpy_ops.np_random import rand # line: 110 +from tensorflow.python.ops.numpy_ops.np_random import randint # line: 116 +from tensorflow.python.ops.numpy_ops.np_random import randn # line: 53 +from tensorflow.python.ops.numpy_ops.np_random import random # line: 104 +from tensorflow.python.ops.numpy_ops.np_random import seed # line: 33 +from tensorflow.python.ops.numpy_ops.np_random import standard_normal # line: 69 +from tensorflow.python.ops.numpy_ops.np_random import uniform # line: 81 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/experimental/tensorrt/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/experimental/tensorrt/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3e715f32cff77d294e77c175d04a19c41ec580cc --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/experimental/tensorrt/__init__.py @@ -0,0 +1,9 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.experimental.tensorrt namespace +""" + +import sys as _sys + +from tensorflow.python.compiler.tensorrt.trt_convert import TrtConversionParams as ConversionParams # line: 135 +from tensorflow.python.compiler.tensorrt.trt_convert import TrtGraphConverterV2 as Converter # line: 1076 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/feature_column/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/feature_column/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..04ca485d32ef9d80ca1fdb6f864272c444dbde00 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/feature_column/__init__.py @@ -0,0 +1,24 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.feature_column namespace +""" + +import sys as _sys + +from tensorflow.python.feature_column.feature_column_v2 import bucketized_column # line: 1124 +from tensorflow.python.feature_column.feature_column_v2 import categorical_column_with_hash_bucket # line: 1211 +from tensorflow.python.feature_column.feature_column_v2 import categorical_column_with_identity # line: 1648 +from tensorflow.python.feature_column.feature_column_v2 import categorical_column_with_vocabulary_file_v2 as categorical_column_with_vocabulary_file # line: 1391 +from tensorflow.python.feature_column.feature_column_v2 import categorical_column_with_vocabulary_list # line: 1529 +from tensorflow.python.feature_column.feature_column_v2 import crossed_column # line: 1849 +from tensorflow.python.feature_column.feature_column_v2 import embedding_column # line: 535 +from tensorflow.python.feature_column.feature_column_v2 import indicator_column # line: 1726 +from tensorflow.python.feature_column.feature_column_v2 import make_parse_example_spec_v2 as make_parse_example_spec # line: 470 +from tensorflow.python.feature_column.feature_column_v2 import numeric_column # line: 1024 +from tensorflow.python.feature_column.feature_column_v2 import shared_embedding_columns_v2 as shared_embeddings # line: 845 +from tensorflow.python.feature_column.feature_column_v2 import weighted_categorical_column # line: 1771 +from tensorflow.python.feature_column.sequence_feature_column import sequence_categorical_column_with_hash_bucket # line: 153 +from tensorflow.python.feature_column.sequence_feature_column import sequence_categorical_column_with_identity # line: 103 +from tensorflow.python.feature_column.sequence_feature_column import sequence_categorical_column_with_vocabulary_file # line: 200 +from tensorflow.python.feature_column.sequence_feature_column import sequence_categorical_column_with_vocabulary_list # line: 270 +from tensorflow.python.feature_column.sequence_feature_column import sequence_numeric_column # line: 337 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/graph_util/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/graph_util/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4563a0266e7ab61d454007c7f8cb7ca7de8bcf4a --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/graph_util/__init__.py @@ -0,0 +1,8 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.graph_util namespace +""" + +import sys as _sys + +from tensorflow.python.framework.importer import import_graph_def # line: 354 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/image/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/image/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fe87a77d1782ca84511ca7355570d527b0cf9a7d --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/image/__init__.py @@ -0,0 +1,78 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.image namespace +""" + +import sys as _sys + +from tensorflow.python.ops.gen_image_ops import hsv_to_rgb # line: 2271 +from tensorflow.python.ops.gen_image_ops import rgb_to_hsv # line: 3276 +from tensorflow.python.ops.array_ops import extract_image_patches_v2 as extract_patches # line: 6416 +from tensorflow.python.ops.image_ops_impl import ResizeMethod # line: 1441 +from tensorflow.python.ops.image_ops_impl import adjust_brightness # line: 2198 +from tensorflow.python.ops.image_ops_impl import adjust_contrast # line: 2251 +from tensorflow.python.ops.image_ops_impl import adjust_gamma # line: 2310 +from tensorflow.python.ops.image_ops_impl import adjust_hue # line: 2734 +from tensorflow.python.ops.image_ops_impl import adjust_jpeg_quality # line: 2920 +from tensorflow.python.ops.image_ops_impl import adjust_saturation # line: 3100 +from tensorflow.python.ops.image_ops_impl import central_crop # line: 857 +from tensorflow.python.ops.image_ops_impl import combined_non_max_suppression # line: 5127 +from tensorflow.python.ops.image_ops_impl import convert_image_dtype # line: 2376 +from tensorflow.python.ops.image_ops_impl import crop_and_resize_v2 as crop_and_resize # line: 4822 +from tensorflow.python.ops.image_ops_impl import crop_to_bounding_box # line: 1168 +from tensorflow.python.ops.image_ops_impl import decode_and_crop_jpeg # line: 3191 +from tensorflow.python.ops.image_ops_impl import decode_bmp # line: 3197 +from tensorflow.python.ops.image_ops_impl import decode_gif # line: 3202 +from tensorflow.python.ops.image_ops_impl import decode_image # line: 3260 +from tensorflow.python.ops.image_ops_impl import decode_jpeg # line: 3207 +from tensorflow.python.ops.image_ops_impl import decode_png # line: 3212 +from tensorflow.python.ops.image_ops_impl import draw_bounding_boxes_v2 as draw_bounding_boxes # line: 5785 +from tensorflow.python.ops.image_ops_impl import encode_jpeg # line: 3218 +from tensorflow.python.ops.image_ops_impl import encode_png # line: 3230 +from tensorflow.python.ops.image_ops_impl import extract_glimpse_v2 as extract_glimpse # line: 5040 +from tensorflow.python.ops.image_ops_impl import extract_jpeg_shape # line: 3223 +from tensorflow.python.ops.image_ops_impl import flip_left_right # line: 546 +from tensorflow.python.ops.image_ops_impl import flip_up_down # line: 581 +from tensorflow.python.ops.image_ops_impl import generate_bounding_box_proposals # line: 5893 +from tensorflow.python.ops.image_ops_impl import grayscale_to_rgb # line: 2597 +from tensorflow.python.ops.image_ops_impl import image_gradients # line: 4604 +from tensorflow.python.ops.image_ops_impl import is_jpeg # line: 3155 +from tensorflow.python.ops.image_ops_impl import non_max_suppression # line: 3775 +from tensorflow.python.ops.image_ops_impl import non_max_suppression_with_overlaps as non_max_suppression_overlaps # line: 3918 +from tensorflow.python.ops.image_ops_impl import non_max_suppression_padded # line: 5395 +from tensorflow.python.ops.image_ops_impl import non_max_suppression_with_scores # line: 3828 +from tensorflow.python.ops.image_ops_impl import pad_to_bounding_box # line: 1004 +from tensorflow.python.ops.image_ops_impl import per_image_standardization # line: 1956 +from tensorflow.python.ops.image_ops_impl import psnr # line: 4159 +from tensorflow.python.ops.image_ops_impl import random_brightness # line: 2015 +from tensorflow.python.ops.image_ops_impl import random_contrast # line: 2105 +from tensorflow.python.ops.image_ops_impl import random_flip_left_right # line: 382 +from tensorflow.python.ops.image_ops_impl import random_flip_up_down # line: 335 +from tensorflow.python.ops.image_ops_impl import random_hue # line: 2634 +from tensorflow.python.ops.image_ops_impl import random_jpeg_quality # line: 2810 +from tensorflow.python.ops.image_ops_impl import random_saturation # line: 2998 +from tensorflow.python.ops.image_ops_impl import resize_images_v2 as resize # line: 1618 +from tensorflow.python.ops.image_ops_impl import resize_image_with_crop_or_pad as resize_with_crop_or_pad # line: 1275 +from tensorflow.python.ops.image_ops_impl import resize_image_with_pad_v2 as resize_with_pad # line: 1915 +from tensorflow.python.ops.image_ops_impl import rgb_to_grayscale # line: 2561 +from tensorflow.python.ops.image_ops_impl import rgb_to_yiq # line: 3972 +from tensorflow.python.ops.image_ops_impl import rgb_to_yuv # line: 4035 +from tensorflow.python.ops.image_ops_impl import rot90 # line: 658 +from tensorflow.python.ops.image_ops_impl import sample_distorted_bounding_box_v2 as sample_distorted_bounding_box # line: 3401 +from tensorflow.python.ops.image_ops_impl import sobel_edges # line: 4678 +from tensorflow.python.ops.image_ops_impl import ssim # line: 4377 +from tensorflow.python.ops.image_ops_impl import ssim_multiscale # line: 4475 +from tensorflow.python.ops.image_ops_impl import stateless_random_brightness # line: 2058 +from tensorflow.python.ops.image_ops_impl import stateless_random_contrast # line: 2151 +from tensorflow.python.ops.image_ops_impl import stateless_random_flip_left_right # line: 430 +from tensorflow.python.ops.image_ops_impl import stateless_random_flip_up_down # line: 461 +from tensorflow.python.ops.image_ops_impl import stateless_random_hue # line: 2683 +from tensorflow.python.ops.image_ops_impl import stateless_random_jpeg_quality # line: 2864 +from tensorflow.python.ops.image_ops_impl import stateless_random_saturation # line: 3050 +from tensorflow.python.ops.image_ops_impl import stateless_sample_distorted_bounding_box # line: 3527 +from tensorflow.python.ops.image_ops_impl import total_variation # line: 3329 +from tensorflow.python.ops.image_ops_impl import transpose # line: 787 +from tensorflow.python.ops.image_ops_impl import yiq_to_rgb # line: 4006 +from tensorflow.python.ops.image_ops_impl import yuv_to_rgb # line: 4065 +from tensorflow.python.ops.random_crop_ops import random_crop # line: 30 +from tensorflow.python.ops.random_crop_ops import stateless_random_crop # line: 85 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/io/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/io/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d9ed20ea549ed908cbc1568b30676316850e130f --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/io/__init__.py @@ -0,0 +1,47 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.io namespace +""" + +import sys as _sys + +from tensorflow._api.v2.io import gfile +from tensorflow.python.ops.gen_decode_proto_ops import decode_proto_v2 as decode_proto # line: 31 +from tensorflow.python.ops.gen_encode_proto_ops import encode_proto # line: 27 +from tensorflow.python.ops.gen_io_ops import matching_files # line: 391 +from tensorflow.python.ops.gen_io_ops import write_file # line: 2269 +from tensorflow.python.ops.gen_parsing_ops import decode_compressed # line: 144 +from tensorflow.python.ops.gen_parsing_ops import parse_tensor # line: 2135 +from tensorflow.python.ops.gen_string_ops import decode_base64 # line: 182 +from tensorflow.python.ops.gen_string_ops import encode_base64 # line: 269 +from tensorflow.python.framework.graph_io import write_graph # line: 28 +from tensorflow.python.lib.io.tf_record import TFRecordOptions # line: 35 +from tensorflow.python.lib.io.tf_record import TFRecordWriter # line: 211 +from tensorflow.python.ops.image_ops_impl import decode_and_crop_jpeg # line: 3191 +from tensorflow.python.ops.image_ops_impl import decode_bmp # line: 3197 +from tensorflow.python.ops.image_ops_impl import decode_gif # line: 3202 +from tensorflow.python.ops.image_ops_impl import decode_image # line: 3260 +from tensorflow.python.ops.image_ops_impl import decode_jpeg # line: 3207 +from tensorflow.python.ops.image_ops_impl import decode_png # line: 3212 +from tensorflow.python.ops.image_ops_impl import encode_jpeg # line: 3218 +from tensorflow.python.ops.image_ops_impl import encode_png # line: 3230 +from tensorflow.python.ops.image_ops_impl import extract_jpeg_shape # line: 3223 +from tensorflow.python.ops.image_ops_impl import is_jpeg # line: 3155 +from tensorflow.python.ops.io_ops import read_file # line: 97 +from tensorflow.python.ops.io_ops import serialize_tensor # line: 137 +from tensorflow.python.ops.parsing_config import FixedLenFeature # line: 298 +from tensorflow.python.ops.parsing_config import FixedLenSequenceFeature # line: 318 +from tensorflow.python.ops.parsing_config import RaggedFeature # line: 54 +from tensorflow.python.ops.parsing_config import SparseFeature # line: 223 +from tensorflow.python.ops.parsing_config import VarLenFeature # line: 44 +from tensorflow.python.ops.parsing_ops import decode_csv_v2 as decode_csv # line: 1073 +from tensorflow.python.ops.parsing_ops import decode_json_example # line: 1152 +from tensorflow.python.ops.parsing_ops import decode_raw # line: 843 +from tensorflow.python.ops.parsing_ops import parse_example_v2 as parse_example # line: 77 +from tensorflow.python.ops.parsing_ops import parse_sequence_example # line: 452 +from tensorflow.python.ops.parsing_ops import parse_single_example_v2 as parse_single_example # line: 410 +from tensorflow.python.ops.parsing_ops import parse_single_sequence_example # line: 696 +from tensorflow.python.ops.sparse_ops import deserialize_many_sparse # line: 2356 +from tensorflow.python.ops.sparse_ops import serialize_many_sparse_v2 as serialize_many_sparse # line: 2254 +from tensorflow.python.ops.sparse_ops import serialize_sparse_v2 as serialize_sparse # line: 2197 +from tensorflow.python.training.input import match_filenames_once # line: 56 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/io/gfile/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/io/gfile/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4b1002208d271902ed287a4257c76fa848edb1f2 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/io/gfile/__init__.py @@ -0,0 +1,22 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.io.gfile namespace +""" + +import sys as _sys + +from tensorflow.python.lib.io.file_io import copy_v2 as copy # line: 516 +from tensorflow.python.lib.io.file_io import file_exists_v2 as exists # line: 249 +from tensorflow.python.lib.io.file_io import get_registered_schemes # line: 980 +from tensorflow.python.lib.io.file_io import get_matching_files_v2 as glob # line: 385 +from tensorflow.python.lib.io.file_io import is_directory_v2 as isdir # line: 692 +from tensorflow.python.lib.io.file_io import join # line: 781 +from tensorflow.python.lib.io.file_io import list_directory_v2 as listdir # line: 751 +from tensorflow.python.lib.io.file_io import recursive_create_dir_v2 as makedirs # line: 501 +from tensorflow.python.lib.io.file_io import create_dir_v2 as mkdir # line: 470 +from tensorflow.python.lib.io.file_io import delete_file_v2 as remove # line: 318 +from tensorflow.python.lib.io.file_io import rename_v2 as rename # line: 609 +from tensorflow.python.lib.io.file_io import delete_recursively_v2 as rmtree # line: 666 +from tensorflow.python.lib.io.file_io import stat_v2 as stat # line: 911 +from tensorflow.python.lib.io.file_io import walk_v2 as walk # line: 837 +from tensorflow.python.platform.gfile import GFile # line: 36 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/linalg/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/linalg/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..254128b05ef55b76e6745a4ee2354aa0c5ce5126 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/linalg/__init__.py @@ -0,0 +1,76 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.linalg namespace +""" + +import sys as _sys + +from tensorflow._api.v2.linalg import experimental +from tensorflow.python.ops.gen_array_ops import matrix_band_part as band_part # line: 4879 +from tensorflow.python.ops.gen_array_ops import diag as tensor_diag # line: 1949 +from tensorflow.python.ops.gen_linalg_ops import cholesky # line: 766 +from tensorflow.python.ops.gen_linalg_ops import matrix_determinant as det # line: 1370 +from tensorflow.python.ops.gen_linalg_ops import matrix_inverse as inv # line: 1516 +from tensorflow.python.ops.gen_linalg_ops import lu # line: 1252 +from tensorflow.python.ops.gen_linalg_ops import qr # line: 2150 +from tensorflow.python.ops.gen_linalg_ops import matrix_solve as solve # line: 1694 +from tensorflow.python.ops.gen_linalg_ops import matrix_square_root as sqrtm # line: 1913 +from tensorflow.python.ops.gen_math_ops import cross # line: 2651 +from tensorflow.python.ops.array_ops import matrix_diag as diag # line: 2322 +from tensorflow.python.ops.array_ops import matrix_diag_part as diag_part # line: 2491 +from tensorflow.python.ops.array_ops import matrix_transpose # line: 2242 +from tensorflow.python.ops.array_ops import matrix_set_diag as set_diag # line: 2679 +from tensorflow.python.ops.array_ops import tensor_diag_part # line: 2634 +from tensorflow.python.ops.clip_ops import global_norm # line: 235 +from tensorflow.python.ops.linalg.linalg_impl import adjoint # line: 102 +from tensorflow.python.ops.linalg.linalg_impl import banded_triangular_solve # line: 350 +from tensorflow.python.ops.linalg.linalg_impl import eigh_tridiagonal # line: 1232 +from tensorflow.python.ops.linalg.linalg_impl import matrix_exponential as expm # line: 232 +from tensorflow.python.ops.linalg.linalg_impl import logdet # line: 68 +from tensorflow.python.ops.linalg.linalg_impl import logm # line: 54 +from tensorflow.python.ops.linalg.linalg_impl import lu_matrix_inverse # line: 1035 +from tensorflow.python.ops.linalg.linalg_impl import lu_reconstruct # line: 1100 +from tensorflow.python.ops.linalg.linalg_impl import lu_solve # line: 937 +from tensorflow.python.ops.linalg.linalg_impl import matrix_rank # line: 768 +from tensorflow.python.ops.linalg.linalg_impl import pinv # line: 807 +from tensorflow.python.ops.linalg.linalg_impl import slogdet # line: 44 +from tensorflow.python.ops.linalg.linalg_impl import tridiagonal_matmul # line: 670 +from tensorflow.python.ops.linalg.linalg_impl import tridiagonal_solve # line: 446 +from tensorflow.python.ops.linalg.linear_operator import LinearOperator # line: 91 +from tensorflow.python.ops.linalg.linear_operator_adjoint import LinearOperatorAdjoint # line: 28 +from tensorflow.python.ops.linalg.linear_operator_block_diag import LinearOperatorBlockDiag # line: 34 +from tensorflow.python.ops.linalg.linear_operator_block_lower_triangular import LinearOperatorBlockLowerTriangular # line: 39 +from tensorflow.python.ops.linalg.linear_operator_circulant import LinearOperatorCirculant # line: 740 +from tensorflow.python.ops.linalg.linear_operator_circulant import LinearOperatorCirculant2D # line: 1035 +from tensorflow.python.ops.linalg.linear_operator_circulant import LinearOperatorCirculant3D # line: 1264 +from tensorflow.python.ops.linalg.linear_operator_composition import LinearOperatorComposition # line: 35 +from tensorflow.python.ops.linalg.linear_operator_diag import LinearOperatorDiag # line: 32 +from tensorflow.python.ops.linalg.linear_operator_full_matrix import LinearOperatorFullMatrix # line: 29 +from tensorflow.python.ops.linalg.linear_operator_householder import LinearOperatorHouseholder # line: 32 +from tensorflow.python.ops.linalg.linear_operator_identity import LinearOperatorIdentity # line: 101 +from tensorflow.python.ops.linalg.linear_operator_identity import LinearOperatorScaledIdentity # line: 538 +from tensorflow.python.ops.linalg.linear_operator_inversion import LinearOperatorInversion # line: 25 +from tensorflow.python.ops.linalg.linear_operator_kronecker import LinearOperatorKronecker # line: 60 +from tensorflow.python.ops.linalg.linear_operator_low_rank_update import LinearOperatorLowRankUpdate # line: 35 +from tensorflow.python.ops.linalg.linear_operator_lower_triangular import LinearOperatorLowerTriangular # line: 31 +from tensorflow.python.ops.linalg.linear_operator_permutation import LinearOperatorPermutation # line: 35 +from tensorflow.python.ops.linalg.linear_operator_toeplitz import LinearOperatorToeplitz # line: 33 +from tensorflow.python.ops.linalg.linear_operator_tridiag import LinearOperatorTridiag # line: 39 +from tensorflow.python.ops.linalg.linear_operator_zeros import LinearOperatorZeros # line: 39 +from tensorflow.python.ops.linalg_ops import cholesky_solve # line: 147 +from tensorflow.python.ops.linalg_ops import eig # line: 382 +from tensorflow.python.ops.linalg_ops import self_adjoint_eig as eigh # line: 441 +from tensorflow.python.ops.linalg_ops import eigvals # line: 414 +from tensorflow.python.ops.linalg_ops import self_adjoint_eigvals as eigvalsh # line: 465 +from tensorflow.python.ops.linalg_ops import eye # line: 196 +from tensorflow.python.ops.linalg_ops import matrix_solve_ls as lstsq # line: 244 +from tensorflow.python.ops.linalg_ops import norm_v2 as norm # line: 561 +from tensorflow.python.ops.linalg_ops import svd # line: 489 +from tensorflow.python.ops.linalg_ops import matrix_triangular_solve as triangular_solve # line: 84 +from tensorflow.python.ops.math_ops import matmul # line: 3617 +from tensorflow.python.ops.math_ops import matvec # line: 3846 +from tensorflow.python.ops.math_ops import tensordot # line: 5152 +from tensorflow.python.ops.math_ops import trace # line: 3573 +from tensorflow.python.ops.nn_impl import l2_normalize # line: 540 +from tensorflow.python.ops.nn_impl import normalize # line: 487 +from tensorflow.python.ops.special_math_ops import einsum # line: 618 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/linalg/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/linalg/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..07230e4ec118e2fe89f8c47ef1ebd82d438299e0 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/linalg/experimental/__init__.py @@ -0,0 +1,8 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.linalg.experimental namespace +""" + +import sys as _sys + +from tensorflow.python.ops.linalg.sparse.conjugate_gradient import conjugate_gradient # line: 30 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/lite/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/lite/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8c825ca49224ad8f6231e0561c1625af60a3006a --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/lite/__init__.py @@ -0,0 +1,14 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.lite namespace +""" + +import sys as _sys + +from tensorflow._api.v2.lite import experimental +from tensorflow.lite.python.convert import OpsSet # line: 169 +from tensorflow.lite.python.interpreter import Interpreter # line: 348 +from tensorflow.lite.python.lite import Optimize # line: 100 +from tensorflow.lite.python.lite import RepresentativeDataset # line: 160 +from tensorflow.lite.python.lite import TFLiteConverterV2 as TFLiteConverter # line: 1915 +from tensorflow.lite.python.lite import TargetSpec # line: 184 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/lite/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/lite/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0f5840906d620d942de67110b7478a6e365cbf49 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/lite/experimental/__init__.py @@ -0,0 +1,13 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.lite.experimental namespace +""" + +import sys as _sys + +from tensorflow._api.v2.lite.experimental import authoring +from tensorflow.lite.python.analyzer import ModelAnalyzer as Analyzer # line: 35 +from tensorflow.lite.python.interpreter import OpResolverType # line: 303 +from tensorflow.lite.python.interpreter import load_delegate # line: 125 +from tensorflow.lite.tools.optimize.debugging.python.debugger import QuantizationDebugOptions # line: 56 +from tensorflow.lite.tools.optimize.debugging.python.debugger import QuantizationDebugger # line: 120 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/lite/experimental/authoring/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/lite/experimental/authoring/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9ab1119e08d20c12ae992ae4e2e34f6568a1541a --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/lite/experimental/authoring/__init__.py @@ -0,0 +1,8 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.lite.experimental.authoring namespace +""" + +import sys as _sys + +from tensorflow.lite.python.authoring.authoring import compatible # line: 265 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/lookup/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/lookup/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..dc4d9dd788e172b48aa895cef02865adf679e299 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/lookup/__init__.py @@ -0,0 +1,13 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.lookup namespace +""" + +import sys as _sys + +from tensorflow._api.v2.lookup import experimental +from tensorflow.python.ops.lookup_ops import KeyValueTensorInitializer # line: 519 +from tensorflow.python.ops.lookup_ops import StaticHashTable # line: 281 +from tensorflow.python.ops.lookup_ops import StaticVocabularyTable # line: 1188 +from tensorflow.python.ops.lookup_ops import TextFileIndex # line: 587 +from tensorflow.python.ops.lookup_ops import TextFileInitializer # line: 607 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/lookup/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/lookup/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1f3366bd1230a95f2a66ffb086f8d7aa3be7add3 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/lookup/experimental/__init__.py @@ -0,0 +1,9 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.lookup.experimental namespace +""" + +import sys as _sys + +from tensorflow.python.ops.lookup_ops import DenseHashTable # line: 2108 +from tensorflow.python.ops.lookup_ops import MutableHashTable # line: 1796 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/math/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/math/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8239d8e6c1fdee72f2f4b26e0281a07524505838 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/math/__init__.py @@ -0,0 +1,139 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.math namespace +""" + +import sys as _sys + +from tensorflow._api.v2.math import special +from tensorflow.python.ops.gen_array_ops import invert_permutation # line: 4592 +from tensorflow.python.ops.gen_math_ops import acosh # line: 231 +from tensorflow.python.ops.gen_math_ops import asin # line: 991 +from tensorflow.python.ops.gen_math_ops import asinh # line: 1091 +from tensorflow.python.ops.gen_math_ops import atan # line: 1184 +from tensorflow.python.ops.gen_math_ops import atan2 # line: 1284 +from tensorflow.python.ops.gen_math_ops import atanh # line: 1383 +from tensorflow.python.ops.gen_math_ops import betainc # line: 1787 +from tensorflow.python.ops.gen_math_ops import cos # line: 2464 +from tensorflow.python.ops.gen_math_ops import cosh # line: 2558 +from tensorflow.python.ops.gen_math_ops import digamma # line: 3161 +from tensorflow.python.ops.gen_math_ops import erf # line: 3454 +from tensorflow.python.ops.gen_math_ops import erfc # line: 3546 +from tensorflow.python.ops.gen_math_ops import expm1 # line: 3847 +from tensorflow.python.ops.gen_math_ops import floor_mod as floormod # line: 4092 +from tensorflow.python.ops.gen_math_ops import greater # line: 4186 +from tensorflow.python.ops.gen_math_ops import greater_equal # line: 4287 +from tensorflow.python.ops.gen_math_ops import igamma # line: 4480 +from tensorflow.python.ops.gen_math_ops import igammac # line: 4639 +from tensorflow.python.ops.gen_math_ops import is_finite # line: 4935 +from tensorflow.python.ops.gen_math_ops import is_inf # line: 5031 +from tensorflow.python.ops.gen_math_ops import is_nan # line: 5127 +from tensorflow.python.ops.gen_math_ops import less # line: 5223 +from tensorflow.python.ops.gen_math_ops import less_equal # line: 5324 +from tensorflow.python.ops.gen_math_ops import lgamma # line: 5425 +from tensorflow.python.ops.gen_math_ops import log # line: 5595 +from tensorflow.python.ops.gen_math_ops import log1p # line: 5689 +from tensorflow.python.ops.gen_math_ops import logical_and # line: 5779 +from tensorflow.python.ops.gen_math_ops import logical_not # line: 5918 +from tensorflow.python.ops.gen_math_ops import logical_or # line: 6005 +from tensorflow.python.ops.gen_math_ops import maximum # line: 6310 +from tensorflow.python.ops.gen_math_ops import minimum # line: 6566 +from tensorflow.python.ops.gen_math_ops import floor_mod as mod # line: 4092 +from tensorflow.python.ops.gen_math_ops import neg as negative # line: 6913 +from tensorflow.python.ops.gen_math_ops import next_after as nextafter # line: 6999 +from tensorflow.python.ops.gen_math_ops import polygamma # line: 7167 +from tensorflow.python.ops.gen_math_ops import reciprocal # line: 8159 +from tensorflow.python.ops.gen_math_ops import rint # line: 8656 +from tensorflow.python.ops.gen_math_ops import segment_max # line: 8930 +from tensorflow.python.ops.gen_math_ops import segment_mean # line: 9164 +from tensorflow.python.ops.gen_math_ops import segment_min # line: 9289 +from tensorflow.python.ops.gen_math_ops import segment_prod # line: 9523 +from tensorflow.python.ops.gen_math_ops import segment_sum # line: 9749 +from tensorflow.python.ops.gen_math_ops import sin # line: 10299 +from tensorflow.python.ops.gen_math_ops import sinh # line: 10392 +from tensorflow.python.ops.gen_math_ops import square # line: 11962 +from tensorflow.python.ops.gen_math_ops import squared_difference # line: 12051 +from tensorflow.python.ops.gen_math_ops import tan # line: 12352 +from tensorflow.python.ops.gen_math_ops import tanh # line: 12446 +from tensorflow.python.ops.gen_math_ops import unsorted_segment_max # line: 12789 +from tensorflow.python.ops.gen_math_ops import unsorted_segment_min # line: 12927 +from tensorflow.python.ops.gen_math_ops import unsorted_segment_prod # line: 13061 +from tensorflow.python.ops.gen_math_ops import unsorted_segment_sum # line: 13195 +from tensorflow.python.ops.gen_math_ops import xlogy # line: 13444 +from tensorflow.python.ops.gen_math_ops import zeta # line: 13530 +from tensorflow.python.ops.gen_nn_ops import softsign # line: 12232 +from tensorflow.python.ops.bincount_ops import bincount # line: 29 +from tensorflow.python.ops.check_ops import is_non_decreasing # line: 1986 +from tensorflow.python.ops.check_ops import is_strictly_increasing # line: 2028 +from tensorflow.python.ops.confusion_matrix import confusion_matrix # line: 92 +from tensorflow.python.ops.math_ops import abs # line: 365 +from tensorflow.python.ops.math_ops import accumulate_n # line: 4161 +from tensorflow.python.ops.math_ops import acos # line: 5747 +from tensorflow.python.ops.math_ops import add # line: 4020 +from tensorflow.python.ops.math_ops import add_n # line: 4101 +from tensorflow.python.ops.math_ops import angle # line: 869 +from tensorflow.python.ops.math_ops import argmax_v2 as argmax # line: 268 +from tensorflow.python.ops.math_ops import argmin_v2 as argmin # line: 322 +from tensorflow.python.ops.math_ops import ceil # line: 5577 +from tensorflow.python.ops.math_ops import conj # line: 4534 +from tensorflow.python.ops.math_ops import count_nonzero_v2 as count_nonzero # line: 2570 +from tensorflow.python.ops.math_ops import cumprod # line: 4424 +from tensorflow.python.ops.math_ops import cumsum # line: 4352 +from tensorflow.python.ops.math_ops import cumulative_logsumexp # line: 4478 +from tensorflow.python.ops.math_ops import divide # line: 446 +from tensorflow.python.ops.math_ops import div_no_nan as divide_no_nan # line: 1696 +from tensorflow.python.ops.math_ops import equal # line: 2003 +from tensorflow.python.ops.math_ops import erfcinv # line: 5547 +from tensorflow.python.ops.math_ops import erfinv # line: 5512 +from tensorflow.python.ops.math_ops import exp # line: 5644 +from tensorflow.python.ops.math_ops import floor # line: 5778 +from tensorflow.python.ops.math_ops import floordiv # line: 1804 +from tensorflow.python.ops.math_ops import imag # line: 835 +from tensorflow.python.ops.math_ops import log_sigmoid # line: 4307 +from tensorflow.python.ops.math_ops import logical_xor # line: 1904 +from tensorflow.python.ops.math_ops import multiply # line: 481 +from tensorflow.python.ops.math_ops import multiply_no_nan # line: 1751 +from tensorflow.python.ops.math_ops import ndtri # line: 5531 +from tensorflow.python.ops.math_ops import not_equal # line: 2040 +from tensorflow.python.ops.math_ops import polyval # line: 5334 +from tensorflow.python.ops.math_ops import pow # line: 669 +from tensorflow.python.ops.math_ops import real # line: 794 +from tensorflow.python.ops.math_ops import reciprocal_no_nan # line: 5406 +from tensorflow.python.ops.math_ops import reduce_all # line: 3306 +from tensorflow.python.ops.math_ops import reduce_any # line: 3412 +from tensorflow.python.ops.math_ops import reduce_euclidean_norm # line: 2447 +from tensorflow.python.ops.math_ops import reduce_logsumexp # line: 3517 +from tensorflow.python.ops.math_ops import reduce_max # line: 3187 +from tensorflow.python.ops.math_ops import reduce_mean # line: 2713 +from tensorflow.python.ops.math_ops import reduce_min # line: 3059 +from tensorflow.python.ops.math_ops import reduce_prod # line: 2887 +from tensorflow.python.ops.math_ops import reduce_std # line: 2836 +from tensorflow.python.ops.math_ops import reduce_sum # line: 2369 +from tensorflow.python.ops.math_ops import reduce_variance # line: 2773 +from tensorflow.python.ops.math_ops import round # line: 914 +from tensorflow.python.ops.math_ops import rsqrt # line: 5722 +from tensorflow.python.ops.math_ops import scalar_mul_v2 as scalar_mul # line: 660 +from tensorflow.python.ops.math_ops import sigmoid # line: 4254 +from tensorflow.python.ops.math_ops import sign # line: 747 +from tensorflow.python.ops.math_ops import sobol_sample # line: 5697 +from tensorflow.python.ops.math_ops import softplus # line: 634 +from tensorflow.python.ops.math_ops import sqrt # line: 5605 +from tensorflow.python.ops.math_ops import subtract # line: 545 +from tensorflow.python.ops.math_ops import truediv # line: 1630 +from tensorflow.python.ops.math_ops import unsorted_segment_mean # line: 4657 +from tensorflow.python.ops.math_ops import unsorted_segment_sqrt_n # line: 4712 +from tensorflow.python.ops.math_ops import xdivy # line: 5440 +from tensorflow.python.ops.math_ops import xlog1py # line: 5474 +from tensorflow.python.ops.nn_impl import l2_normalize # line: 540 +from tensorflow.python.ops.nn_impl import zero_fraction # line: 620 +from tensorflow.python.ops.nn_ops import approx_max_k # line: 5882 +from tensorflow.python.ops.nn_ops import approx_min_k # line: 5945 +from tensorflow.python.ops.nn_ops import in_top_k_v2 as in_top_k # line: 6567 +from tensorflow.python.ops.nn_ops import log_softmax_v2 as log_softmax # line: 3955 +from tensorflow.python.ops.nn_ops import softmax_v2 as softmax # line: 3869 +from tensorflow.python.ops.nn_ops import top_k # line: 5815 +from tensorflow.python.ops.special_math_ops import bessel_i0 # line: 253 +from tensorflow.python.ops.special_math_ops import bessel_i0e # line: 282 +from tensorflow.python.ops.special_math_ops import bessel_i1 # line: 309 +from tensorflow.python.ops.special_math_ops import bessel_i1e # line: 338 +from tensorflow.python.ops.special_math_ops import lbeta # line: 45 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/math/special/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/math/special/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f90e74566d849fe62d8b2dd68c8ade4a890d56c4 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/math/special/__init__.py @@ -0,0 +1,24 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.math.special namespace +""" + +import sys as _sys + +from tensorflow.python.ops.special_math_ops import bessel_i0 # line: 253 +from tensorflow.python.ops.special_math_ops import bessel_i0e # line: 282 +from tensorflow.python.ops.special_math_ops import bessel_i1 # line: 309 +from tensorflow.python.ops.special_math_ops import bessel_i1e # line: 338 +from tensorflow.python.ops.special_math_ops import bessel_j0 # line: 477 +from tensorflow.python.ops.special_math_ops import bessel_j1 # line: 504 +from tensorflow.python.ops.special_math_ops import bessel_k0 # line: 365 +from tensorflow.python.ops.special_math_ops import bessel_k0e # line: 394 +from tensorflow.python.ops.special_math_ops import bessel_k1 # line: 421 +from tensorflow.python.ops.special_math_ops import bessel_k1e # line: 450 +from tensorflow.python.ops.special_math_ops import bessel_y0 # line: 531 +from tensorflow.python.ops.special_math_ops import bessel_y1 # line: 558 +from tensorflow.python.ops.special_math_ops import dawsn # line: 101 +from tensorflow.python.ops.special_math_ops import expint # line: 132 +from tensorflow.python.ops.special_math_ops import fresnel_cos # line: 162 +from tensorflow.python.ops.special_math_ops import fresnel_sin # line: 193 +from tensorflow.python.ops.special_math_ops import spence # line: 223 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/mlir/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/mlir/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..558ed4a35c398fdc2a1eb56fb55db90c72bc9d65 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/mlir/__init__.py @@ -0,0 +1,8 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.mlir namespace +""" + +import sys as _sys + +from tensorflow._api.v2.mlir import experimental diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/mlir/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/mlir/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7ded7e7a94c56a4b895a5afb4a57299715c2d629 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/mlir/experimental/__init__.py @@ -0,0 +1,14 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.mlir.experimental namespace +""" + +import sys as _sys + +from tensorflow.python.compiler.mlir.mlir import convert_function # line: 48 +from tensorflow.python.compiler.mlir.mlir import convert_graph_def # line: 21 +from tensorflow.python.compiler.mlir.mlir import convert_saved_model # line: 95 +from tensorflow.python.compiler.mlir.mlir import convert_saved_model_v1 # line: 115 +from tensorflow.python.compiler.mlir.mlir import run_pass_pipeline # line: 152 +from tensorflow.python.compiler.mlir.mlir import tflite_to_tosa_bytecode # line: 181 +from tensorflow.python.compiler.mlir.mlir import experimental_write_bytecode as write_bytecode # line: 170 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/nest/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/nest/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c829f8ac1920d3cf8ce03d31a156fef83658a062 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/nest/__init__.py @@ -0,0 +1,12 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.nest namespace +""" + +import sys as _sys + +from tensorflow.python.util.nest import assert_same_structure # line: 301 +from tensorflow.python.util.nest import flatten # line: 201 +from tensorflow.python.util.nest import is_nested # line: 166 +from tensorflow.python.util.nest import map_structure # line: 545 +from tensorflow.python.util.nest import pack_sequence_as # line: 426 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/nn/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/nn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d65b9b5726872e0dff9efeb1ea1c8cd8f5cefcc0 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/nn/__init__.py @@ -0,0 +1,97 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.nn namespace +""" + +import sys as _sys + +from tensorflow._api.v2.nn import experimental +from tensorflow.python.ops.gen_math_ops import tanh # line: 12446 +from tensorflow.python.ops.gen_nn_ops import elu # line: 3783 +from tensorflow.python.ops.gen_nn_ops import l2_loss # line: 5717 +from tensorflow.python.ops.gen_nn_ops import lrn as local_response_normalization # line: 5806 +from tensorflow.python.ops.gen_nn_ops import lrn # line: 5806 +from tensorflow.python.ops.gen_nn_ops import relu # line: 11562 +from tensorflow.python.ops.gen_nn_ops import selu # line: 11829 +from tensorflow.python.ops.gen_nn_ops import softsign # line: 12232 +from tensorflow.python.keras.layers.rnn_cell_wrapper_v2 import DeviceWrapper as RNNCellDeviceWrapper # line: 123 +from tensorflow.python.keras.layers.rnn_cell_wrapper_v2 import DropoutWrapper as RNNCellDropoutWrapper # line: 95 +from tensorflow.python.keras.layers.rnn_cell_wrapper_v2 import ResidualWrapper as RNNCellResidualWrapper # line: 111 +from tensorflow.python.ops.array_ops import depth_to_space_v2 as depth_to_space # line: 4069 +from tensorflow.python.ops.array_ops import space_to_batch_v2 as space_to_batch # line: 4031 +from tensorflow.python.ops.array_ops import space_to_depth_v2 as space_to_depth # line: 4050 +from tensorflow.python.ops.candidate_sampling_ops import all_candidate_sampler # line: 430 +from tensorflow.python.ops.candidate_sampling_ops import compute_accidental_hits # line: 466 +from tensorflow.python.ops.candidate_sampling_ops import fixed_unigram_candidate_sampler # line: 306 +from tensorflow.python.ops.candidate_sampling_ops import learned_unigram_candidate_sampler # line: 212 +from tensorflow.python.ops.ctc_ops import collapse_repeated # line: 1175 +from tensorflow.python.ops.ctc_ops import ctc_beam_search_decoder_v2 as ctc_beam_search_decoder # line: 449 +from tensorflow.python.ops.ctc_ops import ctc_greedy_decoder # line: 300 +from tensorflow.python.ops.ctc_ops import ctc_loss_v3 as ctc_loss # line: 886 +from tensorflow.python.ops.ctc_ops import ctc_unique_labels # line: 1273 +from tensorflow.python.ops.embedding_ops import embedding_lookup_v2 as embedding_lookup # line: 371 +from tensorflow.python.ops.embedding_ops import embedding_lookup_sparse_v2 as embedding_lookup_sparse # line: 575 +from tensorflow.python.ops.embedding_ops import safe_embedding_lookup_sparse_v2 as safe_embedding_lookup_sparse # line: 734 +from tensorflow.python.ops.math_ops import sigmoid # line: 4254 +from tensorflow.python.ops.math_ops import softplus # line: 634 +from tensorflow.python.ops.nn_impl import batch_norm_with_global_normalization_v2 as batch_norm_with_global_normalization # line: 1649 +from tensorflow.python.ops.nn_impl import batch_normalization # line: 1420 +from tensorflow.python.ops.nn_impl import depthwise_conv2d_v2 as depthwise_conv2d # line: 792 +from tensorflow.python.ops.nn_impl import l2_normalize # line: 540 +from tensorflow.python.ops.nn_impl import log_poisson_loss # line: 43 +from tensorflow.python.ops.nn_impl import moments_v2 as moments # line: 1281 +from tensorflow.python.ops.nn_impl import nce_loss_v2 as nce_loss # line: 1900 +from tensorflow.python.ops.nn_impl import normalize_moments # line: 1182 +from tensorflow.python.ops.nn_impl import sampled_softmax_loss_v2 as sampled_softmax_loss # line: 2117 +from tensorflow.python.ops.nn_impl import separable_conv2d_v2 as separable_conv2d # line: 1001 +from tensorflow.python.ops.nn_impl import sigmoid_cross_entropy_with_logits_v2 as sigmoid_cross_entropy_with_logits # line: 150 +from tensorflow.python.ops.nn_impl import swish as silu # line: 430 +from tensorflow.python.ops.nn_impl import sufficient_statistics_v2 as sufficient_statistics # line: 1152 +from tensorflow.python.ops.nn_impl import swish # line: 430 +from tensorflow.python.ops.nn_impl import weighted_cross_entropy_with_logits_v2 as weighted_cross_entropy_with_logits # line: 249 +from tensorflow.python.ops.nn_impl import weighted_moments_v2 as weighted_moments # line: 1395 +from tensorflow.python.ops.nn_impl import zero_fraction # line: 620 +from tensorflow.python.ops.nn_impl_distribute import compute_average_loss # line: 70 +from tensorflow.python.ops.nn_impl_distribute import scale_regularization_loss # line: 27 +from tensorflow.python.ops.nn_ops import approx_max_k # line: 5882 +from tensorflow.python.ops.nn_ops import approx_min_k # line: 5945 +from tensorflow.python.ops.nn_ops import atrous_conv2d # line: 1790 +from tensorflow.python.ops.nn_ops import atrous_conv2d_transpose # line: 2814 +from tensorflow.python.ops.nn_ops import avg_pool_v2 as avg_pool # line: 4463 +from tensorflow.python.ops.nn_ops import avg_pool1d # line: 4616 +from tensorflow.python.ops.nn_ops import avg_pool2d # line: 4575 +from tensorflow.python.ops.nn_ops import avg_pool3d # line: 4663 +from tensorflow.python.ops.nn_ops import bias_add # line: 3516 +from tensorflow.python.ops.nn_ops import conv1d_v2 as conv1d # line: 2099 +from tensorflow.python.ops.nn_ops import conv1d_transpose # line: 2169 +from tensorflow.python.ops.nn_ops import conv2d_v2 as conv2d # line: 2260 +from tensorflow.python.ops.nn_ops import conv2d_transpose_v2 as conv2d_transpose # line: 2692 +from tensorflow.python.ops.nn_ops import conv3d_v2 as conv3d # line: 3239 +from tensorflow.python.ops.nn_ops import conv3d_transpose_v2 as conv3d_transpose # line: 3347 +from tensorflow.python.ops.nn_ops import conv_transpose # line: 3428 +from tensorflow.python.ops.nn_ops import convolution_v2 as convolution # line: 1176 +from tensorflow.python.ops.nn_ops import crelu_v2 as crelu # line: 3623 +from tensorflow.python.ops.nn_ops import depthwise_conv2d_native_backprop_filter as depthwise_conv2d_backprop_filter # line: 3126 +from tensorflow.python.ops.nn_ops import depthwise_conv2d_native_backprop_input as depthwise_conv2d_backprop_input # line: 3054 +from tensorflow.python.ops.nn_ops import dilation2d_v2 as dilation2d # line: 482 +from tensorflow.python.ops.nn_ops import dropout_v2 as dropout # line: 5425 +from tensorflow.python.ops.nn_ops import erosion2d_v2 as erosion2d # line: 6459 +from tensorflow.python.ops.nn_ops import fractional_avg_pool_v2 as fractional_avg_pool # line: 6321 +from tensorflow.python.ops.nn_ops import fractional_max_pool_v2 as fractional_max_pool # line: 6141 +from tensorflow.python.ops.nn_ops import gelu # line: 3702 +from tensorflow.python.ops.nn_ops import in_top_k_v2 as in_top_k # line: 6567 +from tensorflow.python.ops.nn_ops import isotonic_regression # line: 6617 +from tensorflow.python.ops.nn_ops import leaky_relu # line: 3667 +from tensorflow.python.ops.nn_ops import log_softmax_v2 as log_softmax # line: 3955 +from tensorflow.python.ops.nn_ops import max_pool_v2 as max_pool # line: 4705 +from tensorflow.python.ops.nn_ops import max_pool1d # line: 4911 +from tensorflow.python.ops.nn_ops import max_pool2d # line: 4971 +from tensorflow.python.ops.nn_ops import max_pool3d # line: 5084 +from tensorflow.python.ops.nn_ops import max_pool_with_argmax_v2 as max_pool_with_argmax # line: 5128 +from tensorflow.python.ops.nn_ops import pool_v2 as pool # line: 1689 +from tensorflow.python.ops.nn_ops import relu6 # line: 3630 +from tensorflow.python.ops.nn_ops import softmax_v2 as softmax # line: 3869 +from tensorflow.python.ops.nn_ops import softmax_cross_entropy_with_logits_v2 as softmax_cross_entropy_with_logits # line: 3989 +from tensorflow.python.ops.nn_ops import sparse_softmax_cross_entropy_with_logits_v2 as sparse_softmax_cross_entropy_with_logits # line: 4402 +from tensorflow.python.ops.nn_ops import top_k # line: 5815 +from tensorflow.python.ops.nn_ops import with_space_to_batch # line: 572 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/nn/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/nn/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..47fa94d259f19d723898910f486905ac0faf5708 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/nn/experimental/__init__.py @@ -0,0 +1,9 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.nn.experimental namespace +""" + +import sys as _sys + +from tensorflow.python.ops.nn_ops import general_dropout # line: 5664 +from tensorflow.python.ops.nn_ops import stateless_dropout # line: 5520 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/profiler/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/profiler/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..008ea525b0443adcd22f5a7208ff4ec86705ef1a --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/profiler/__init__.py @@ -0,0 +1,8 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.profiler namespace +""" + +import sys as _sys + +from tensorflow._api.v2.profiler import experimental diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/profiler/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/profiler/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c6a30d7a3f226942c45250cacda0e53a1dacfebb --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/profiler/experimental/__init__.py @@ -0,0 +1,14 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.profiler.experimental namespace +""" + +import sys as _sys + +from tensorflow._api.v2.profiler.experimental import client +from tensorflow._api.v2.profiler.experimental import server +from tensorflow.python.profiler.profiler_v2 import Profile # line: 183 +from tensorflow.python.profiler.profiler_v2 import ProfilerOptions # line: 45 +from tensorflow.python.profiler.profiler_v2 import start # line: 80 +from tensorflow.python.profiler.profiler_v2 import stop # line: 129 +from tensorflow.python.profiler.trace import Trace # line: 27 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/profiler/experimental/client/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/profiler/experimental/client/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7948c300b88a45b6a34b1f753dbb310d79aabd33 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/profiler/experimental/client/__init__.py @@ -0,0 +1,9 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.profiler.experimental.client namespace +""" + +import sys as _sys + +from tensorflow.python.profiler.profiler_client import monitor # line: 134 +from tensorflow.python.profiler.profiler_client import trace # line: 25 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/profiler/experimental/server/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/profiler/experimental/server/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..790c00223c2bd2f43ff546735432431d96f67319 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/profiler/experimental/server/__init__.py @@ -0,0 +1,8 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.profiler.experimental.server namespace +""" + +import sys as _sys + +from tensorflow.python.profiler.profiler_v2 import start_server as start # line: 168 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/quantization/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/quantization/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8e5fd18fabbd426cd43f7742527e31b7598fe7a1 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/quantization/__init__.py @@ -0,0 +1,19 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.quantization namespace +""" + +import sys as _sys + +from tensorflow._api.v2.quantization import experimental +from tensorflow.python.ops.gen_array_ops import fake_quant_with_min_max_args # line: 2698 +from tensorflow.python.ops.gen_array_ops import fake_quant_with_min_max_args_gradient # line: 2867 +from tensorflow.python.ops.gen_array_ops import fake_quant_with_min_max_vars # line: 3003 +from tensorflow.python.ops.gen_array_ops import fake_quant_with_min_max_vars_gradient # line: 3145 +from tensorflow.python.ops.gen_array_ops import fake_quant_with_min_max_vars_per_channel # line: 3276 +from tensorflow.python.ops.gen_array_ops import fake_quant_with_min_max_vars_per_channel_gradient # line: 3423 +from tensorflow.python.ops.gen_array_ops import quantized_concat # line: 8202 +from tensorflow.python.ops.array_ops import dequantize # line: 6139 +from tensorflow.python.ops.array_ops import quantize # line: 6100 +from tensorflow.python.ops.array_ops import quantize_and_dequantize # line: 6176 +from tensorflow.python.ops.array_ops import quantize_and_dequantize_v2 # line: 6243 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/quantization/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/quantization/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..267d4981e8bcc0b3f894cc33fc1e0c236254a4af --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/quantization/experimental/__init__.py @@ -0,0 +1,13 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.quantization.experimental namespace +""" + +import sys as _sys + +from tensorflow.compiler.mlir.quantization.tensorflow.python.quantize_model import _QuantizationComponentSpec as QuantizationComponentSpec # line: 58 +from tensorflow.compiler.mlir.quantization.tensorflow.python.quantize_model import _QuantizationMethod as QuantizationMethod # line: 54 +from tensorflow.compiler.mlir.quantization.tensorflow.python.quantize_model import _QuantizationOptions as QuantizationOptions # line: 50 +from tensorflow.compiler.mlir.quantization.tensorflow.python.quantize_model import _UnitWiseQuantizationSpec as UnitWiseQuantizationSpec # line: 62 +from tensorflow.compiler.mlir.quantization.tensorflow.python.quantize_model import quantize as quantize_saved_model # line: 1467 +from tensorflow.compiler.mlir.quantization.tensorflow.python.representative_dataset import TfRecordRepresentativeDatasetSaver # line: 78 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/queue/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/queue/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ddd979996fbf7408213917cccdd9b6ff4b35d50f --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/queue/__init__.py @@ -0,0 +1,12 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.queue namespace +""" + +import sys as _sys + +from tensorflow.python.ops.data_flow_ops import FIFOQueue # line: 712 +from tensorflow.python.ops.data_flow_ops import PaddingFIFOQueue # line: 848 +from tensorflow.python.ops.data_flow_ops import PriorityQueue # line: 924 +from tensorflow.python.ops.data_flow_ops import QueueBase # line: 115 +from tensorflow.python.ops.data_flow_ops import RandomShuffleQueue # line: 622 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/ragged/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/ragged/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..748ef1c0f48cce3ca8ea24176f26b1227b77a4e7 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/ragged/__init__.py @@ -0,0 +1,17 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.ragged namespace +""" + +import sys as _sys + +from tensorflow.python.ops.ragged.ragged_array_ops import boolean_mask # line: 49 +from tensorflow.python.ops.ragged.ragged_array_ops import cross # line: 741 +from tensorflow.python.ops.ragged.ragged_array_ops import cross_hashed # line: 768 +from tensorflow.python.ops.ragged.ragged_array_ops import stack_dynamic_partitions # line: 575 +from tensorflow.python.ops.ragged.ragged_concat_ops import stack # line: 73 +from tensorflow.python.ops.ragged.ragged_factory_ops import constant # line: 35 +from tensorflow.python.ops.ragged.ragged_functional_ops import map_flat_values # line: 25 +from tensorflow.python.ops.ragged.ragged_math_ops import range # line: 44 +from tensorflow.python.ops.ragged.segment_id_ops import row_splits_to_segment_ids # line: 31 +from tensorflow.python.ops.ragged.segment_id_ops import segment_ids_to_row_splits # line: 75 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/random/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/random/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0b26fa2ec8a2b3acd3ee83d3cd23d6dd88db102c --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/random/__init__.py @@ -0,0 +1,36 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.random namespace +""" + +import sys as _sys + +from tensorflow._api.v2.random import experimental +from tensorflow.python.framework.random_seed import set_seed # line: 210 +from tensorflow.python.ops.candidate_sampling_ops import all_candidate_sampler # line: 430 +from tensorflow.python.ops.candidate_sampling_ops import fixed_unigram_candidate_sampler # line: 306 +from tensorflow.python.ops.candidate_sampling_ops import learned_unigram_candidate_sampler # line: 212 +from tensorflow.python.ops.candidate_sampling_ops import log_uniform_candidate_sampler # line: 116 +from tensorflow.python.ops.candidate_sampling_ops import uniform_candidate_sampler # line: 27 +from tensorflow.python.ops.random_ops import categorical # line: 394 +from tensorflow.python.ops.random_ops import random_gamma as gamma # line: 451 +from tensorflow.python.ops.random_ops import random_normal as normal # line: 39 +from tensorflow.python.ops.random_ops import random_poisson_v2 as poisson # line: 586 +from tensorflow.python.ops.random_ops import random_shuffle as shuffle # line: 326 +from tensorflow.python.ops.random_ops import truncated_normal # line: 155 +from tensorflow.python.ops.random_ops import random_uniform as uniform # line: 211 +from tensorflow.python.ops.random_ops_util import Algorithm # line: 30 +from tensorflow.python.ops.stateful_random_ops import Generator # line: 220 +from tensorflow.python.ops.stateful_random_ops import create_rng_state # line: 174 +from tensorflow.python.ops.stateful_random_ops import get_global_generator # line: 975 +from tensorflow.python.ops.stateful_random_ops import set_global_generator # line: 1000 +from tensorflow.python.ops.stateless_random_ops import fold_in # line: 93 +from tensorflow.python.ops.stateless_random_ops import split # line: 51 +from tensorflow.python.ops.stateless_random_ops import stateless_random_binomial as stateless_binomial # line: 411 +from tensorflow.python.ops.stateless_random_ops import stateless_categorical # line: 793 +from tensorflow.python.ops.stateless_random_ops import stateless_random_gamma as stateless_gamma # line: 481 +from tensorflow.python.ops.stateless_random_ops import stateless_random_normal as stateless_normal # line: 644 +from tensorflow.python.ops.stateless_random_ops import stateless_parameterized_truncated_normal # line: 851 +from tensorflow.python.ops.stateless_random_ops import stateless_random_poisson as stateless_poisson # line: 584 +from tensorflow.python.ops.stateless_random_ops import stateless_truncated_normal # line: 695 +from tensorflow.python.ops.stateless_random_ops import stateless_random_uniform as stateless_uniform # line: 274 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/random/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/random/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8941fae2111531b4998ca26a4321f32e39a0b5ea --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/random/experimental/__init__.py @@ -0,0 +1,16 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.random.experimental namespace +""" + +import sys as _sys + +from tensorflow.python.ops.random_ops_util import Algorithm # line: 30 +from tensorflow.python.ops.stateful_random_ops import Generator # line: 220 +from tensorflow.python.ops.stateful_random_ops import create_rng_state # line: 174 +from tensorflow.python.ops.stateful_random_ops import get_global_generator # line: 975 +from tensorflow.python.ops.stateful_random_ops import set_global_generator # line: 1000 +from tensorflow.python.ops.stateless_random_ops import index_shuffle # line: 135 +from tensorflow.python.ops.stateless_random_ops import fold_in as stateless_fold_in # line: 93 +from tensorflow.python.ops.stateless_random_ops import stateless_shuffle # line: 226 +from tensorflow.python.ops.stateless_random_ops import split as stateless_split # line: 51 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/raw_ops/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/raw_ops/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5e650c4b2247cad3d39b71e2c6ce5fa7a74699a5 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/raw_ops/__init__.py @@ -0,0 +1,1422 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.raw_ops namespace +""" + +import sys as _sys + +from tensorflow.python.ops.gen_array_ops import BatchMatrixBandPart # line: 68 +from tensorflow.python.ops.gen_array_ops import BatchMatrixDiag # line: 126 +from tensorflow.python.ops.gen_array_ops import BatchMatrixDiagPart # line: 182 +from tensorflow.python.ops.gen_array_ops import BatchMatrixSetDiag # line: 239 +from tensorflow.python.ops.gen_array_ops import BatchToSpace # line: 319 +from tensorflow.python.ops.gen_array_ops import BatchToSpaceND # line: 533 +from tensorflow.python.ops.gen_array_ops import Bitcast # line: 677 +from tensorflow.python.ops.gen_array_ops import BroadcastArgs # line: 739 +from tensorflow.python.ops.gen_array_ops import BroadcastGradientArgs # line: 807 +from tensorflow.python.ops.gen_array_ops import BroadcastTo # line: 928 +from tensorflow.python.ops.gen_array_ops import CheckNumerics # line: 1041 +from tensorflow.python.ops.gen_array_ops import CheckNumericsV2 # line: 1107 +from tensorflow.python.ops.gen_array_ops import Concat # line: 1174 +from tensorflow.python.ops.gen_array_ops import ConcatOffset # line: 1255 +from tensorflow.python.ops.gen_array_ops import ConcatV2 # line: 1328 +from tensorflow.python.ops.gen_array_ops import ConjugateTranspose # line: 1397 +from tensorflow.python.ops.gen_array_ops import Const # line: 1458 +from tensorflow.python.ops.gen_array_ops import DebugGradientIdentity # line: 1519 +from tensorflow.python.ops.gen_array_ops import DebugGradientRefIdentity # line: 1567 +from tensorflow.python.ops.gen_array_ops import DeepCopy # line: 1613 +from tensorflow.python.ops.gen_array_ops import DepthToSpace # line: 1771 +from tensorflow.python.ops.gen_array_ops import Dequantize # line: 1914 +from tensorflow.python.ops.gen_array_ops import Diag # line: 2032 +from tensorflow.python.ops.gen_array_ops import DiagPart # line: 2109 +from tensorflow.python.ops.gen_array_ops import EditDistance # line: 2204 +from tensorflow.python.ops.gen_array_ops import Empty # line: 2279 +from tensorflow.python.ops.gen_array_ops import EnsureShape # line: 2345 +from tensorflow.python.ops.gen_array_ops import ExpandDims # line: 2439 +from tensorflow.python.ops.gen_array_ops import ExtractImagePatches # line: 2532 +from tensorflow.python.ops.gen_array_ops import ExtractVolumePatches # line: 2667 +from tensorflow.python.ops.gen_array_ops import FakeQuantWithMinMaxArgs # line: 2834 +from tensorflow.python.ops.gen_array_ops import FakeQuantWithMinMaxArgsGradient # line: 2969 +from tensorflow.python.ops.gen_array_ops import FakeQuantWithMinMaxVars # line: 3113 +from tensorflow.python.ops.gen_array_ops import FakeQuantWithMinMaxVarsGradient # line: 3247 +from tensorflow.python.ops.gen_array_ops import FakeQuantWithMinMaxVarsPerChannel # line: 3391 +from tensorflow.python.ops.gen_array_ops import FakeQuantWithMinMaxVarsPerChannelGradient # line: 3530 +from tensorflow.python.ops.gen_array_ops import Fill # line: 3625 +from tensorflow.python.ops.gen_array_ops import Fingerprint # line: 3716 +from tensorflow.python.ops.gen_array_ops import Gather # line: 3810 +from tensorflow.python.ops.gen_array_ops import GatherNd # line: 3980 +from tensorflow.python.ops.gen_array_ops import GatherV2 # line: 4083 +from tensorflow.python.ops.gen_array_ops import GuaranteeConst # line: 4152 +from tensorflow.python.ops.gen_array_ops import Identity # line: 4208 +from tensorflow.python.ops.gen_array_ops import IdentityN # line: 4304 +from tensorflow.python.ops.gen_array_ops import ImmutableConst # line: 4374 +from tensorflow.python.ops.gen_array_ops import InplaceAdd # line: 4439 +from tensorflow.python.ops.gen_array_ops import InplaceSub # line: 4503 +from tensorflow.python.ops.gen_array_ops import InplaceUpdate # line: 4570 +from tensorflow.python.ops.gen_array_ops import InvertPermutation # line: 4672 +from tensorflow.python.ops.gen_array_ops import ListDiff # line: 4766 +from tensorflow.python.ops.gen_array_ops import LowerBound # line: 4854 +from tensorflow.python.ops.gen_array_ops import MatrixBandPart # line: 4991 +from tensorflow.python.ops.gen_array_ops import MatrixDiag # line: 5077 +from tensorflow.python.ops.gen_array_ops import MatrixDiagPart # line: 5162 +from tensorflow.python.ops.gen_array_ops import MatrixDiagPartV2 # line: 5296 +from tensorflow.python.ops.gen_array_ops import MatrixDiagPartV3 # line: 5475 +from tensorflow.python.ops.gen_array_ops import MatrixDiagV2 # line: 5643 +from tensorflow.python.ops.gen_array_ops import MatrixDiagV3 # line: 5851 +from tensorflow.python.ops.gen_array_ops import MatrixSetDiag # line: 5929 +from tensorflow.python.ops.gen_array_ops import MatrixSetDiagV2 # line: 6066 +from tensorflow.python.ops.gen_array_ops import MatrixSetDiagV3 # line: 6249 +from tensorflow.python.ops.gen_array_ops import MirrorPad # line: 6348 +from tensorflow.python.ops.gen_array_ops import MirrorPadGrad # line: 6433 +from tensorflow.python.ops.gen_array_ops import OneHot # line: 6595 +from tensorflow.python.ops.gen_array_ops import OnesLike # line: 6658 +from tensorflow.python.ops.gen_array_ops import Pack # line: 6747 +from tensorflow.python.ops.gen_array_ops import Pad # line: 6837 +from tensorflow.python.ops.gen_array_ops import PadV2 # line: 6924 +from tensorflow.python.ops.gen_array_ops import ParallelConcat # line: 7011 +from tensorflow.python.ops.gen_array_ops import Placeholder # line: 7085 +from tensorflow.python.ops.gen_array_ops import PlaceholderV2 # line: 7154 +from tensorflow.python.ops.gen_array_ops import PlaceholderWithDefault # line: 7215 +from tensorflow.python.ops.gen_array_ops import PreventGradient # line: 7288 +from tensorflow.python.ops.gen_array_ops import QuantizeAndDequantize # line: 7378 +from tensorflow.python.ops.gen_array_ops import QuantizeAndDequantizeV2 # line: 7567 +from tensorflow.python.ops.gen_array_ops import QuantizeAndDequantizeV3 # line: 7680 +from tensorflow.python.ops.gen_array_ops import QuantizeAndDequantizeV4 # line: 7820 +from tensorflow.python.ops.gen_array_ops import QuantizeAndDequantizeV4Grad # line: 7922 +from tensorflow.python.ops.gen_array_ops import QuantizeV2 # line: 8159 +from tensorflow.python.ops.gen_array_ops import QuantizedConcat # line: 8310 +from tensorflow.python.ops.gen_array_ops import QuantizedInstanceNorm # line: 8450 +from tensorflow.python.ops.gen_array_ops import QuantizedReshape # line: 8543 +from tensorflow.python.ops.gen_array_ops import Rank # line: 8616 +from tensorflow.python.ops.gen_array_ops import RefIdentity # line: 8660 +from tensorflow.python.ops.gen_array_ops import Reshape # line: 8770 +from tensorflow.python.ops.gen_array_ops import ResourceStridedSliceAssign # line: 8864 +from tensorflow.python.ops.gen_array_ops import Reverse # line: 8985 +from tensorflow.python.ops.gen_array_ops import ReverseSequence # line: 9113 +from tensorflow.python.ops.gen_array_ops import ReverseV2 # line: 9253 +from tensorflow.python.ops.gen_array_ops import ScatterNd # line: 9434 +from tensorflow.python.ops.gen_array_ops import ScatterNdNonAliasingAdd # line: 9537 +from tensorflow.python.ops.gen_array_ops import Shape # line: 9611 +from tensorflow.python.ops.gen_array_ops import ShapeN # line: 9682 +from tensorflow.python.ops.gen_array_ops import Size # line: 9761 +from tensorflow.python.ops.gen_array_ops import Slice # line: 9837 +from tensorflow.python.ops.gen_array_ops import Snapshot # line: 9895 +from tensorflow.python.ops.gen_array_ops import SpaceToBatch # line: 10051 +from tensorflow.python.ops.gen_array_ops import SpaceToBatchND # line: 10267 +from tensorflow.python.ops.gen_array_ops import SpaceToDepth # line: 10422 +from tensorflow.python.ops.gen_array_ops import Split # line: 10490 +from tensorflow.python.ops.gen_array_ops import SplitV # line: 10559 +from tensorflow.python.ops.gen_array_ops import Squeeze # line: 10648 +from tensorflow.python.ops.gen_array_ops import StopGradient # line: 10769 +from tensorflow.python.ops.gen_array_ops import StridedSlice # line: 10985 +from tensorflow.python.ops.gen_array_ops import StridedSliceAssign # line: 11090 +from tensorflow.python.ops.gen_array_ops import StridedSliceGrad # line: 11186 +from tensorflow.python.ops.gen_array_ops import TensorScatterAdd # line: 11358 +from tensorflow.python.ops.gen_array_ops import TensorScatterMax # line: 11464 +from tensorflow.python.ops.gen_array_ops import TensorScatterMin # line: 11559 +from tensorflow.python.ops.gen_array_ops import TensorScatterSub # line: 11718 +from tensorflow.python.ops.gen_array_ops import TensorScatterUpdate # line: 11820 +from tensorflow.python.ops.gen_array_ops import TensorStridedSliceUpdate # line: 11928 +from tensorflow.python.ops.gen_array_ops import Tile # line: 12064 +from tensorflow.python.ops.gen_array_ops import TileGrad # line: 12127 +from tensorflow.python.ops.gen_array_ops import Transpose # line: 12190 +from tensorflow.python.ops.gen_array_ops import Unique # line: 12284 +from tensorflow.python.ops.gen_array_ops import UniqueV2 # line: 12406 +from tensorflow.python.ops.gen_array_ops import UniqueWithCounts # line: 12499 +from tensorflow.python.ops.gen_array_ops import UniqueWithCountsV2 # line: 12626 +from tensorflow.python.ops.gen_array_ops import Unpack # line: 12708 +from tensorflow.python.ops.gen_array_ops import UnravelIndex # line: 12820 +from tensorflow.python.ops.gen_array_ops import UpperBound # line: 12906 +from tensorflow.python.ops.gen_array_ops import Where # line: 13026 +from tensorflow.python.ops.gen_array_ops import ZerosLike # line: 13082 +from tensorflow.python.ops.gen_audio_ops import AudioSpectrogram # line: 108 +from tensorflow.python.ops.gen_audio_ops import DecodeWav # line: 237 +from tensorflow.python.ops.gen_audio_ops import EncodeWav # line: 338 +from tensorflow.python.ops.gen_audio_ops import Mfcc # line: 443 +from tensorflow.python.ops.gen_batch_ops import Batch # line: 171 +from tensorflow.python.ops.gen_batch_ops import BatchFunction # line: 429 +from tensorflow.python.ops.gen_batch_ops import Unbatch # line: 579 +from tensorflow.python.ops.gen_batch_ops import UnbatchGrad # line: 676 +from tensorflow.python.ops.gen_bitwise_ops import BitwiseAnd # line: 113 +from tensorflow.python.ops.gen_bitwise_ops import BitwiseOr # line: 219 +from tensorflow.python.ops.gen_bitwise_ops import BitwiseXor # line: 325 +from tensorflow.python.ops.gen_bitwise_ops import Invert # line: 450 +from tensorflow.python.ops.gen_bitwise_ops import LeftShift # line: 566 +from tensorflow.python.ops.gen_bitwise_ops import PopulationCount # line: 631 +from tensorflow.python.ops.gen_bitwise_ops import RightShift # line: 749 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesAggregateStats # line: 85 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesBucketize # line: 167 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesCalculateBestFeatureSplit # line: 289 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesCalculateBestFeatureSplitV2 # line: 413 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesCalculateBestGainsPerFeature # line: 536 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesCenterBias # line: 623 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesCreateEnsemble # line: 684 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesCreateQuantileStreamResource # line: 747 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesDeserializeEnsemble # line: 808 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesEnsembleResourceHandleOp # line: 873 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesExampleDebugOutputs # line: 956 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesFlushQuantileSummaries # line: 1031 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesGetEnsembleStates # line: 1099 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesMakeQuantileSummaries # line: 1169 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesMakeStatsSummary # line: 1260 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesPredict # line: 1347 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesQuantileStreamResourceAddSummaries # line: 1416 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesQuantileStreamResourceDeserialize # line: 1480 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesQuantileStreamResourceFlush # line: 1551 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesQuantileStreamResourceGetBucketBoundaries # line: 1619 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesQuantileStreamResourceHandleOp # line: 1685 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesSerializeEnsemble # line: 1755 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesSparseAggregateStats # line: 1857 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesSparseCalculateBestFeatureSplit # line: 1980 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesTrainingPredict # line: 2088 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesUpdateEnsemble # line: 2228 +from tensorflow.python.ops.gen_boosted_trees_ops import BoostedTreesUpdateEnsembleV2 # line: 2441 +from tensorflow.python.ops.gen_boosted_trees_ops import IsBoostedTreesEnsembleInitialized # line: 2574 +from tensorflow.python.ops.gen_boosted_trees_ops import IsBoostedTreesQuantileStreamResourceInitialized # line: 2634 +from tensorflow.python.ops.gen_candidate_sampling_ops import AllCandidateSampler # line: 113 +from tensorflow.python.ops.gen_candidate_sampling_ops import ComputeAccidentalHits # line: 214 +from tensorflow.python.ops.gen_candidate_sampling_ops import FixedUnigramCandidateSampler # line: 405 +from tensorflow.python.ops.gen_candidate_sampling_ops import LearnedUnigramCandidateSampler # line: 553 +from tensorflow.python.ops.gen_candidate_sampling_ops import LogUniformCandidateSampler # line: 677 +from tensorflow.python.ops.gen_candidate_sampling_ops import ThreadUnsafeUnigramCandidateSampler # line: 802 +from tensorflow.python.ops.gen_candidate_sampling_ops import UniformCandidateSampler # line: 925 +from tensorflow.python.ops.gen_checkpoint_ops import GenerateVocabRemapping # line: 123 +from tensorflow.python.ops.gen_checkpoint_ops import LoadAndRemapMatrix # line: 264 +from tensorflow.python.ops.gen_clustering_ops import KMC2ChainInitialization # line: 72 +from tensorflow.python.ops.gen_clustering_ops import KmeansPlusPlusInitialization # line: 149 +from tensorflow.python.ops.gen_clustering_ops import NearestNeighbors # line: 225 +from tensorflow.python.ops.gen_collective_ops import CollectiveAllToAllV2 # line: 106 +from tensorflow.python.ops.gen_collective_ops import CollectiveAllToAllV3 # line: 193 +from tensorflow.python.ops.gen_collective_ops import CollectiveAssignGroupV2 # line: 265 +from tensorflow.python.ops.gen_collective_ops import CollectiveBcastRecv # line: 357 +from tensorflow.python.ops.gen_collective_ops import CollectiveBcastRecvV2 # line: 449 +from tensorflow.python.ops.gen_collective_ops import CollectiveBcastSend # line: 548 +from tensorflow.python.ops.gen_collective_ops import CollectiveBcastSendV2 # line: 637 +from tensorflow.python.ops.gen_collective_ops import CollectiveGather # line: 735 +from tensorflow.python.ops.gen_collective_ops import CollectiveGatherV2 # line: 843 +from tensorflow.python.ops.gen_collective_ops import CollectiveInitializeCommunicator # line: 935 +from tensorflow.python.ops.gen_collective_ops import CollectiveReduce # line: 1054 +from tensorflow.python.ops.gen_collective_ops import CollectiveReduceScatterV2 # line: 1194 +from tensorflow.python.ops.gen_collective_ops import CollectiveReduceV2 # line: 1333 +from tensorflow.python.ops.gen_collective_ops import CollectiveReduceV3 # line: 1431 +from tensorflow.python.ops.gen_composite_tensor_ops import CompositeTensorVariantFromComponents # line: 74 +from tensorflow.python.ops.gen_composite_tensor_ops import CompositeTensorVariantToComponents # line: 152 +from tensorflow.python.ops.gen_control_flow_ops import Abort # line: 71 +from tensorflow.python.ops.gen_control_flow_ops import ControlTrigger # line: 120 +from tensorflow.python.ops.gen_control_flow_ops import Enter # line: 196 +from tensorflow.python.ops.gen_control_flow_ops import Exit # line: 262 +from tensorflow.python.ops.gen_control_flow_ops import LoopCond # line: 320 +from tensorflow.python.ops.gen_control_flow_ops import Merge # line: 396 +from tensorflow.python.ops.gen_control_flow_ops import NextIteration # line: 457 +from tensorflow.python.ops.gen_control_flow_ops import NoOp # line: 529 +from tensorflow.python.ops.gen_control_flow_ops import RefEnter # line: 592 +from tensorflow.python.ops.gen_control_flow_ops import RefExit # line: 629 +from tensorflow.python.ops.gen_control_flow_ops import RefMerge # line: 682 +from tensorflow.python.ops.gen_control_flow_ops import RefNextIteration # line: 717 +from tensorflow.python.ops.gen_control_flow_ops import RefSelect # line: 759 +from tensorflow.python.ops.gen_control_flow_ops import RefSwitch # line: 808 +from tensorflow.python.ops.gen_control_flow_ops import Switch # line: 869 +from tensorflow.python.ops.gen_count_ops import DenseCountSparseOutput # line: 103 +from tensorflow.python.ops.gen_count_ops import RaggedCountSparseOutput # line: 211 +from tensorflow.python.ops.gen_count_ops import SparseCountSparseOutput # line: 323 +from tensorflow.python.ops.gen_ctc_ops import CTCBeamSearchDecoder # line: 107 +from tensorflow.python.ops.gen_ctc_ops import CTCGreedyDecoder # line: 212 +from tensorflow.python.ops.gen_ctc_ops import CTCLoss # line: 335 +from tensorflow.python.ops.gen_ctc_ops import CTCLossV2 # line: 463 +from tensorflow.python.ops.gen_cudnn_rnn_ops import CudnnRNN # line: 151 +from tensorflow.python.ops.gen_cudnn_rnn_ops import CudnnRNNBackprop # line: 337 +from tensorflow.python.ops.gen_cudnn_rnn_ops import CudnnRNNBackpropV2 # line: 524 +from tensorflow.python.ops.gen_cudnn_rnn_ops import CudnnRNNBackpropV3 # line: 733 +from tensorflow.python.ops.gen_cudnn_rnn_ops import CudnnRNNCanonicalToParams # line: 907 +from tensorflow.python.ops.gen_cudnn_rnn_ops import CudnnRNNCanonicalToParamsV2 # line: 1098 +from tensorflow.python.ops.gen_cudnn_rnn_ops import CudnnRNNParamsSize # line: 1267 +from tensorflow.python.ops.gen_cudnn_rnn_ops import CudnnRNNParamsToCanonical # line: 1436 +from tensorflow.python.ops.gen_cudnn_rnn_ops import CudnnRNNParamsToCanonicalV2 # line: 1620 +from tensorflow.python.ops.gen_cudnn_rnn_ops import CudnnRNNV2 # line: 1799 +from tensorflow.python.ops.gen_cudnn_rnn_ops import CudnnRNNV3 # line: 1988 +from tensorflow.python.ops.gen_data_flow_ops import AccumulatorApplyGradient # line: 52 +from tensorflow.python.ops.gen_data_flow_ops import AccumulatorNumAccumulated # line: 84 +from tensorflow.python.ops.gen_data_flow_ops import AccumulatorSetGlobalStep # line: 115 +from tensorflow.python.ops.gen_data_flow_ops import AccumulatorTakeGradient # line: 162 +from tensorflow.python.ops.gen_data_flow_ops import Barrier # line: 244 +from tensorflow.python.ops.gen_data_flow_ops import BarrierClose # line: 284 +from tensorflow.python.ops.gen_data_flow_ops import BarrierIncompleteSize # line: 316 +from tensorflow.python.ops.gen_data_flow_ops import BarrierInsertMany # line: 356 +from tensorflow.python.ops.gen_data_flow_ops import BarrierReadySize # line: 388 +from tensorflow.python.ops.gen_data_flow_ops import BarrierTakeMany # line: 472 +from tensorflow.python.ops.gen_data_flow_ops import ConditionalAccumulator # line: 540 +from tensorflow.python.ops.gen_data_flow_ops import DeleteSessionTensor # line: 577 +from tensorflow.python.ops.gen_data_flow_ops import DynamicPartition # line: 713 +from tensorflow.python.ops.gen_data_flow_ops import DynamicStitch # line: 877 +from tensorflow.python.ops.gen_data_flow_ops import FIFOQueue # line: 977 +from tensorflow.python.ops.gen_data_flow_ops import FIFOQueueV2 # line: 1066 +from tensorflow.python.ops.gen_data_flow_ops import FakeQueue # line: 1129 +from tensorflow.python.ops.gen_data_flow_ops import GetSessionHandle # line: 1175 +from tensorflow.python.ops.gen_data_flow_ops import GetSessionHandleV2 # line: 1231 +from tensorflow.python.ops.gen_data_flow_ops import GetSessionTensor # line: 1290 +from tensorflow.python.ops.gen_data_flow_ops import MapClear # line: 1363 +from tensorflow.python.ops.gen_data_flow_ops import MapIncompleteSize # line: 1460 +from tensorflow.python.ops.gen_data_flow_ops import MapPeek # line: 1567 +from tensorflow.python.ops.gen_data_flow_ops import MapSize # line: 1668 +from tensorflow.python.ops.gen_data_flow_ops import MapStage # line: 1767 +from tensorflow.python.ops.gen_data_flow_ops import MapUnstage # line: 1875 +from tensorflow.python.ops.gen_data_flow_ops import MapUnstageNoKey # line: 1990 +from tensorflow.python.ops.gen_data_flow_ops import OrderedMapClear # line: 2082 +from tensorflow.python.ops.gen_data_flow_ops import OrderedMapIncompleteSize # line: 2180 +from tensorflow.python.ops.gen_data_flow_ops import OrderedMapPeek # line: 2290 +from tensorflow.python.ops.gen_data_flow_ops import OrderedMapSize # line: 2392 +from tensorflow.python.ops.gen_data_flow_ops import OrderedMapStage # line: 2494 +from tensorflow.python.ops.gen_data_flow_ops import OrderedMapUnstage # line: 2603 +from tensorflow.python.ops.gen_data_flow_ops import OrderedMapUnstageNoKey # line: 2721 +from tensorflow.python.ops.gen_data_flow_ops import PaddingFIFOQueue # line: 2833 +from tensorflow.python.ops.gen_data_flow_ops import PaddingFIFOQueueV2 # line: 2930 +from tensorflow.python.ops.gen_data_flow_ops import ParallelDynamicStitch # line: 3084 +from tensorflow.python.ops.gen_data_flow_ops import PriorityQueue # line: 3189 +from tensorflow.python.ops.gen_data_flow_ops import PriorityQueueV2 # line: 3284 +from tensorflow.python.ops.gen_data_flow_ops import QueueClose # line: 3353 +from tensorflow.python.ops.gen_data_flow_ops import QueueCloseV2 # line: 3405 +from tensorflow.python.ops.gen_data_flow_ops import QueueDequeue # line: 3469 +from tensorflow.python.ops.gen_data_flow_ops import QueueDequeueMany # line: 3532 +from tensorflow.python.ops.gen_data_flow_ops import QueueDequeueManyV2 # line: 3611 +from tensorflow.python.ops.gen_data_flow_ops import QueueDequeueUpTo # line: 3697 +from tensorflow.python.ops.gen_data_flow_ops import QueueDequeueUpToV2 # line: 3780 +from tensorflow.python.ops.gen_data_flow_ops import QueueDequeueV2 # line: 3869 +from tensorflow.python.ops.gen_data_flow_ops import QueueEnqueue # line: 3927 +from tensorflow.python.ops.gen_data_flow_ops import QueueEnqueueMany # line: 3972 +from tensorflow.python.ops.gen_data_flow_ops import QueueEnqueueManyV2 # line: 4030 +from tensorflow.python.ops.gen_data_flow_ops import QueueEnqueueV2 # line: 4094 +from tensorflow.python.ops.gen_data_flow_ops import QueueIsClosed # line: 4140 +from tensorflow.python.ops.gen_data_flow_ops import QueueIsClosedV2 # line: 4187 +from tensorflow.python.ops.gen_data_flow_ops import QueueSize # line: 4229 +from tensorflow.python.ops.gen_data_flow_ops import QueueSizeV2 # line: 4273 +from tensorflow.python.ops.gen_data_flow_ops import RandomShuffleQueue # line: 4379 +from tensorflow.python.ops.gen_data_flow_ops import RandomShuffleQueueV2 # line: 4492 +from tensorflow.python.ops.gen_data_flow_ops import RecordInput # line: 4630 +from tensorflow.python.ops.gen_data_flow_ops import ResourceAccumulatorApplyGradient # line: 4708 +from tensorflow.python.ops.gen_data_flow_ops import ResourceAccumulatorNumAccumulated # line: 4762 +from tensorflow.python.ops.gen_data_flow_ops import ResourceAccumulatorSetGlobalStep # line: 4817 +from tensorflow.python.ops.gen_data_flow_ops import ResourceAccumulatorTakeGradient # line: 4887 +from tensorflow.python.ops.gen_data_flow_ops import ResourceConditionalAccumulator # line: 4987 +from tensorflow.python.ops.gen_data_flow_ops import SparseAccumulatorApplyGradient # line: 5059 +from tensorflow.python.ops.gen_data_flow_ops import SparseAccumulatorTakeGradient # line: 5117 +from tensorflow.python.ops.gen_data_flow_ops import SparseConditionalAccumulator # line: 5185 +from tensorflow.python.ops.gen_data_flow_ops import Stack # line: 5225 +from tensorflow.python.ops.gen_data_flow_ops import StackClose # line: 5249 +from tensorflow.python.ops.gen_data_flow_ops import StackCloseV2 # line: 5285 +from tensorflow.python.ops.gen_data_flow_ops import StackPop # line: 5328 +from tensorflow.python.ops.gen_data_flow_ops import StackPopV2 # line: 5376 +from tensorflow.python.ops.gen_data_flow_ops import StackPush # line: 5428 +from tensorflow.python.ops.gen_data_flow_ops import StackPushV2 # line: 5482 +from tensorflow.python.ops.gen_data_flow_ops import StackV2 # line: 5556 +from tensorflow.python.ops.gen_data_flow_ops import Stage # line: 5636 +from tensorflow.python.ops.gen_data_flow_ops import StageClear # line: 5718 +from tensorflow.python.ops.gen_data_flow_ops import StagePeek # line: 5821 +from tensorflow.python.ops.gen_data_flow_ops import StageSize # line: 5921 +from tensorflow.python.ops.gen_data_flow_ops import TensorArray # line: 6007 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayClose # line: 6031 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayCloseV2 # line: 6067 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayCloseV3 # line: 6114 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayConcat # line: 6172 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayConcatV2 # line: 6238 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayConcatV3 # line: 6338 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayGather # line: 6398 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayGatherV2 # line: 6457 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayGatherV3 # line: 6539 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayGrad # line: 6591 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayGradV2 # line: 6639 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayGradV3 # line: 6748 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayGradWithShape # line: 6832 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayPack # line: 6889 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayRead # line: 6928 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayReadV2 # line: 6980 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayReadV3 # line: 7046 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayScatter # line: 7097 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayScatterV2 # line: 7147 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayScatterV3 # line: 7214 +from tensorflow.python.ops.gen_data_flow_ops import TensorArraySize # line: 7260 +from tensorflow.python.ops.gen_data_flow_ops import TensorArraySizeV2 # line: 7305 +from tensorflow.python.ops.gen_data_flow_ops import TensorArraySizeV3 # line: 7363 +from tensorflow.python.ops.gen_data_flow_ops import TensorArraySplit # line: 7412 +from tensorflow.python.ops.gen_data_flow_ops import TensorArraySplitV2 # line: 7462 +from tensorflow.python.ops.gen_data_flow_ops import TensorArraySplitV3 # line: 7554 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayUnpack # line: 7604 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayV2 # line: 7679 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayV3 # line: 7815 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayWrite # line: 7882 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayWriteV2 # line: 7932 +from tensorflow.python.ops.gen_data_flow_ops import TensorArrayWriteV3 # line: 7997 +from tensorflow.python.ops.gen_data_flow_ops import Unstage # line: 8087 +from tensorflow.python.ops.gen_dataset_ops import AnonymousIterator # line: 78 +from tensorflow.python.ops.gen_dataset_ops import AnonymousIteratorV2 # line: 164 +from tensorflow.python.ops.gen_dataset_ops import AnonymousIteratorV3 # line: 242 +from tensorflow.python.ops.gen_dataset_ops import AnonymousMemoryCache # line: 312 +from tensorflow.python.ops.gen_dataset_ops import AnonymousMultiDeviceIterator # line: 397 +from tensorflow.python.ops.gen_dataset_ops import AnonymousMultiDeviceIteratorV3 # line: 491 +from tensorflow.python.ops.gen_dataset_ops import AnonymousRandomSeedGenerator # line: 570 +from tensorflow.python.ops.gen_dataset_ops import AnonymousSeedGenerator # line: 637 +from tensorflow.python.ops.gen_dataset_ops import BatchDataset # line: 720 +from tensorflow.python.ops.gen_dataset_ops import BatchDatasetV2 # line: 826 +from tensorflow.python.ops.gen_dataset_ops import CacheDataset # line: 930 +from tensorflow.python.ops.gen_dataset_ops import CacheDatasetV2 # line: 1025 +from tensorflow.python.ops.gen_dataset_ops import ConcatenateDataset # line: 1121 +from tensorflow.python.ops.gen_dataset_ops import DatasetCardinality # line: 1201 +from tensorflow.python.ops.gen_dataset_ops import DatasetToGraph # line: 1289 +from tensorflow.python.ops.gen_dataset_ops import DatasetToGraphV2 # line: 1378 +from tensorflow.python.ops.gen_dataset_ops import DatasetToSingleElement # line: 1463 +from tensorflow.python.ops.gen_dataset_ops import DeleteIterator # line: 1524 +from tensorflow.python.ops.gen_dataset_ops import DeleteMemoryCache # line: 1569 +from tensorflow.python.ops.gen_dataset_ops import DeleteMultiDeviceIterator # line: 1625 +from tensorflow.python.ops.gen_dataset_ops import DeleteRandomSeedGenerator # line: 1678 +from tensorflow.python.ops.gen_dataset_ops import DeleteSeedGenerator # line: 1724 +from tensorflow.python.ops.gen_dataset_ops import DeserializeIterator # line: 1773 +from tensorflow.python.ops.gen_dataset_ops import DummyMemoryCache # line: 1824 +from tensorflow.python.ops.gen_dataset_ops import DummySeedGenerator # line: 1876 +from tensorflow.python.ops.gen_dataset_ops import FilterByLastComponentDataset # line: 1947 +from tensorflow.python.ops.gen_dataset_ops import FilterDataset # line: 2051 +from tensorflow.python.ops.gen_dataset_ops import FinalizeDataset # line: 2147 +from tensorflow.python.ops.gen_dataset_ops import FixedLengthRecordDataset # line: 2238 +from tensorflow.python.ops.gen_dataset_ops import FixedLengthRecordDatasetV2 # line: 2318 +from tensorflow.python.ops.gen_dataset_ops import FlatMapDataset # line: 2417 +from tensorflow.python.ops.gen_dataset_ops import GeneratorDataset # line: 2529 +from tensorflow.python.ops.gen_dataset_ops import GetOptions # line: 2603 +from tensorflow.python.ops.gen_dataset_ops import InterleaveDataset # line: 2700 +from tensorflow.python.ops.gen_dataset_ops import Iterator # line: 2795 +from tensorflow.python.ops.gen_dataset_ops import IteratorFromStringHandle # line: 2887 +from tensorflow.python.ops.gen_dataset_ops import IteratorFromStringHandleV2 # line: 2977 +from tensorflow.python.ops.gen_dataset_ops import IteratorGetNext # line: 3063 +from tensorflow.python.ops.gen_dataset_ops import IteratorGetNextAsOptional # line: 3144 +from tensorflow.python.ops.gen_dataset_ops import IteratorGetNextSync # line: 3231 +from tensorflow.python.ops.gen_dataset_ops import IteratorToStringHandle # line: 3296 +from tensorflow.python.ops.gen_dataset_ops import IteratorV2 # line: 3375 +from tensorflow.python.ops.gen_dataset_ops import MakeIterator # line: 3437 +from tensorflow.python.ops.gen_dataset_ops import MapDataset # line: 3534 +from tensorflow.python.ops.gen_dataset_ops import MapDefun # line: 3658 +from tensorflow.python.ops.gen_dataset_ops import ModelDataset # line: 3767 +from tensorflow.python.ops.gen_dataset_ops import MultiDeviceIterator # line: 3879 +from tensorflow.python.ops.gen_dataset_ops import MultiDeviceIteratorFromStringHandle # line: 3975 +from tensorflow.python.ops.gen_dataset_ops import MultiDeviceIteratorGetNextFromShard # line: 4074 +from tensorflow.python.ops.gen_dataset_ops import MultiDeviceIteratorInit # line: 4148 +from tensorflow.python.ops.gen_dataset_ops import MultiDeviceIteratorToStringHandle # line: 4208 +from tensorflow.python.ops.gen_dataset_ops import OneShotIterator # line: 4314 +from tensorflow.python.ops.gen_dataset_ops import OptimizeDataset # line: 4421 +from tensorflow.python.ops.gen_dataset_ops import OptimizeDatasetV2 # line: 4538 +from tensorflow.python.ops.gen_dataset_ops import OptionsDataset # line: 4644 +from tensorflow.python.ops.gen_dataset_ops import PaddedBatchDataset # line: 4749 +from tensorflow.python.ops.gen_dataset_ops import PaddedBatchDatasetV2 # line: 4867 +from tensorflow.python.ops.gen_dataset_ops import ParallelBatchDataset # line: 4988 +from tensorflow.python.ops.gen_dataset_ops import ParallelFilterDataset # line: 5126 +from tensorflow.python.ops.gen_dataset_ops import ParallelInterleaveDatasetV2 # line: 5271 +from tensorflow.python.ops.gen_dataset_ops import ParallelInterleaveDatasetV3 # line: 5425 +from tensorflow.python.ops.gen_dataset_ops import ParallelInterleaveDatasetV4 # line: 5588 +from tensorflow.python.ops.gen_dataset_ops import ParallelMapDataset # line: 5726 +from tensorflow.python.ops.gen_dataset_ops import ParallelMapDatasetV2 # line: 5867 +from tensorflow.python.ops.gen_dataset_ops import PrefetchDataset # line: 5996 +from tensorflow.python.ops.gen_dataset_ops import RangeDataset # line: 6110 +from tensorflow.python.ops.gen_dataset_ops import ReduceDataset # line: 6230 +from tensorflow.python.ops.gen_dataset_ops import RepeatDataset # line: 6330 +from tensorflow.python.ops.gen_dataset_ops import RewriteDataset # line: 6418 +from tensorflow.python.ops.gen_dataset_ops import SerializeIterator # line: 6493 +from tensorflow.python.ops.gen_dataset_ops import ShardDataset # line: 6585 +from tensorflow.python.ops.gen_dataset_ops import ShuffleAndRepeatDataset # line: 6708 +from tensorflow.python.ops.gen_dataset_ops import ShuffleAndRepeatDatasetV2 # line: 6826 +from tensorflow.python.ops.gen_dataset_ops import ShuffleDataset # line: 6953 +from tensorflow.python.ops.gen_dataset_ops import ShuffleDatasetV2 # line: 7057 +from tensorflow.python.ops.gen_dataset_ops import ShuffleDatasetV3 # line: 7167 +from tensorflow.python.ops.gen_dataset_ops import SkipDataset # line: 7268 +from tensorflow.python.ops.gen_dataset_ops import SparseTensorSliceDataset # line: 7342 +from tensorflow.python.ops.gen_dataset_ops import TFRecordDataset # line: 7416 +from tensorflow.python.ops.gen_dataset_ops import TFRecordDatasetV2 # line: 7496 +from tensorflow.python.ops.gen_dataset_ops import TakeDataset # line: 7582 +from tensorflow.python.ops.gen_dataset_ops import TensorDataset # line: 7666 +from tensorflow.python.ops.gen_dataset_ops import TensorSliceDataset # line: 7759 +from tensorflow.python.ops.gen_dataset_ops import TextLineDataset # line: 7845 +from tensorflow.python.ops.gen_dataset_ops import UnwrapDatasetVariant # line: 7904 +from tensorflow.python.ops.gen_dataset_ops import WindowDataset # line: 8040 +from tensorflow.python.ops.gen_dataset_ops import WindowOp # line: 8129 +from tensorflow.python.ops.gen_dataset_ops import WrapDatasetVariant # line: 8194 +from tensorflow.python.ops.gen_dataset_ops import ZipDataset # line: 8282 +from tensorflow.python.ops.gen_debug_ops import Copy # line: 97 +from tensorflow.python.ops.gen_debug_ops import CopyHost # line: 194 +from tensorflow.python.ops.gen_debug_ops import DebugIdentity # line: 302 +from tensorflow.python.ops.gen_debug_ops import DebugIdentityV2 # line: 444 +from tensorflow.python.ops.gen_debug_ops import DebugIdentityV3 # line: 591 +from tensorflow.python.ops.gen_debug_ops import DebugNanCount # line: 714 +from tensorflow.python.ops.gen_debug_ops import DebugNumericSummary # line: 883 +from tensorflow.python.ops.gen_debug_ops import DebugNumericSummaryV2 # line: 1049 +from tensorflow.python.ops.gen_decode_proto_ops import DecodeProtoV2 # line: 280 +from tensorflow.python.ops.gen_encode_proto_ops import EncodeProto # line: 164 +from tensorflow.python.ops.gen_experimental_dataset_ops import AssertCardinalityDataset # line: 82 +from tensorflow.python.ops.gen_experimental_dataset_ops import AssertNextDataset # line: 180 +from tensorflow.python.ops.gen_experimental_dataset_ops import AssertPrevDataset # line: 277 +from tensorflow.python.ops.gen_experimental_dataset_ops import AutoShardDataset # line: 388 +from tensorflow.python.ops.gen_experimental_dataset_ops import BytesProducedStatsDataset # line: 479 +from tensorflow.python.ops.gen_experimental_dataset_ops import CSVDataset # line: 570 +from tensorflow.python.ops.gen_experimental_dataset_ops import CSVDatasetV2 # line: 666 +from tensorflow.python.ops.gen_experimental_dataset_ops import ChooseFastestBranchDataset # line: 785 +from tensorflow.python.ops.gen_experimental_dataset_ops import ChooseFastestDataset # line: 895 +from tensorflow.python.ops.gen_experimental_dataset_ops import CompressElement # line: 966 +from tensorflow.python.ops.gen_experimental_dataset_ops import ComputeBatchSize # line: 1020 +from tensorflow.python.ops.gen_experimental_dataset_ops import DataServiceDataset # line: 1139 +from tensorflow.python.ops.gen_experimental_dataset_ops import DataServiceDatasetV2 # line: 1295 +from tensorflow.python.ops.gen_experimental_dataset_ops import DataServiceDatasetV3 # line: 1464 +from tensorflow.python.ops.gen_experimental_dataset_ops import DataServiceDatasetV4 # line: 1637 +from tensorflow.python.ops.gen_experimental_dataset_ops import DatasetFromGraph # line: 1731 +from tensorflow.python.ops.gen_experimental_dataset_ops import DatasetToTFRecord # line: 1785 +from tensorflow.python.ops.gen_experimental_dataset_ops import DenseToSparseBatchDataset # line: 1866 +from tensorflow.python.ops.gen_experimental_dataset_ops import DirectedInterleaveDataset # line: 1971 +from tensorflow.python.ops.gen_experimental_dataset_ops import DistributedSave # line: 2046 +from tensorflow.python.ops.gen_experimental_dataset_ops import DummyIterationCounter # line: 2101 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalAssertNextDataset # line: 2175 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalAutoShardDataset # line: 2281 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalBytesProducedStatsDataset # line: 2372 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalCSVDataset # line: 2464 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalChooseFastestDataset # line: 2563 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalDatasetCardinality # line: 2639 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalDatasetToTFRecord # line: 2696 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalDenseToSparseBatchDataset # line: 2779 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalDirectedInterleaveDataset # line: 2877 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalGroupByReducerDataset # line: 3019 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalGroupByWindowDataset # line: 3142 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalIgnoreErrorsDataset # line: 3240 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalIteratorGetDevice # line: 3309 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalLMDBDataset # line: 3381 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalLatencyStatsDataset # line: 3465 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalMapAndBatchDataset # line: 3588 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalMapDataset # line: 3702 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalMatchingFilesDataset # line: 3776 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalMaxIntraOpParallelismDataset # line: 3853 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalNonSerializableDataset # line: 3937 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalParallelInterleaveDataset # line: 4051 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalParseExampleDataset # line: 4208 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalPrivateThreadPoolDataset # line: 4323 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalRandomDataset # line: 4411 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalRebatchDataset # line: 4511 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalScanDataset # line: 4615 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalSetStatsAggregatorDataset # line: 4713 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalSleepDataset # line: 4801 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalSlidingWindowDataset # line: 4899 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalSqlDataset # line: 4989 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalStatsAggregatorHandle # line: 5067 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalStatsAggregatorSummary # line: 5127 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalTakeWhileDataset # line: 5217 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalThreadPoolDataset # line: 5306 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalThreadPoolHandle # line: 5407 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalUnbatchDataset # line: 5491 +from tensorflow.python.ops.gen_experimental_dataset_ops import ExperimentalUniqueDataset # line: 5573 +from tensorflow.python.ops.gen_experimental_dataset_ops import GetElementAtIndex # line: 5655 +from tensorflow.python.ops.gen_experimental_dataset_ops import GroupByReducerDataset # line: 5788 +from tensorflow.python.ops.gen_experimental_dataset_ops import GroupByWindowDataset # line: 5914 +from tensorflow.python.ops.gen_experimental_dataset_ops import IgnoreErrorsDataset # line: 6014 +from tensorflow.python.ops.gen_experimental_dataset_ops import InitializeTableFromDataset # line: 6076 +from tensorflow.python.ops.gen_experimental_dataset_ops import IteratorGetDevice # line: 6129 +from tensorflow.python.ops.gen_experimental_dataset_ops import LMDBDataset # line: 6212 +from tensorflow.python.ops.gen_experimental_dataset_ops import LatencyStatsDataset # line: 6294 +from tensorflow.python.ops.gen_experimental_dataset_ops import LegacyParallelInterleaveDatasetV2 # line: 6417 +from tensorflow.python.ops.gen_experimental_dataset_ops import ListDataset # line: 6518 +from tensorflow.python.ops.gen_experimental_dataset_ops import LoadDataset # line: 6616 +from tensorflow.python.ops.gen_experimental_dataset_ops import MapAndBatchDataset # line: 6749 +from tensorflow.python.ops.gen_experimental_dataset_ops import MatchingFilesDataset # line: 6825 +from tensorflow.python.ops.gen_experimental_dataset_ops import MaxIntraOpParallelismDataset # line: 6901 +from tensorflow.python.ops.gen_experimental_dataset_ops import NonSerializableDataset # line: 6984 +from tensorflow.python.ops.gen_experimental_dataset_ops import ParallelInterleaveDataset # line: 7126 +from tensorflow.python.ops.gen_experimental_dataset_ops import ParseExampleDataset # line: 7318 +from tensorflow.python.ops.gen_experimental_dataset_ops import ParseExampleDatasetV2 # line: 7557 +from tensorflow.python.ops.gen_experimental_dataset_ops import PrivateThreadPoolDataset # line: 7692 +from tensorflow.python.ops.gen_experimental_dataset_ops import RandomDataset # line: 7796 +from tensorflow.python.ops.gen_experimental_dataset_ops import RandomDatasetV2 # line: 7920 +from tensorflow.python.ops.gen_experimental_dataset_ops import RebatchDataset # line: 8028 +from tensorflow.python.ops.gen_experimental_dataset_ops import RebatchDatasetV2 # line: 8126 +from tensorflow.python.ops.gen_experimental_dataset_ops import RegisterDataset # line: 8215 +from tensorflow.python.ops.gen_experimental_dataset_ops import RegisterDatasetV2 # line: 8311 +from tensorflow.python.ops.gen_experimental_dataset_ops import SamplingDataset # line: 8409 +from tensorflow.python.ops.gen_experimental_dataset_ops import SaveDataset # line: 8486 +from tensorflow.python.ops.gen_experimental_dataset_ops import SaveDatasetV2 # line: 8585 +from tensorflow.python.ops.gen_experimental_dataset_ops import ScanDataset # line: 8707 +from tensorflow.python.ops.gen_experimental_dataset_ops import SetStatsAggregatorDataset # line: 8809 +from tensorflow.python.ops.gen_experimental_dataset_ops import SleepDataset # line: 8896 +from tensorflow.python.ops.gen_experimental_dataset_ops import SlidingWindowDataset # line: 8998 +from tensorflow.python.ops.gen_experimental_dataset_ops import SnapshotChunkDataset # line: 9093 +from tensorflow.python.ops.gen_experimental_dataset_ops import SnapshotDataset # line: 9286 +from tensorflow.python.ops.gen_experimental_dataset_ops import SnapshotDatasetReader # line: 9430 +from tensorflow.python.ops.gen_experimental_dataset_ops import SnapshotDatasetV2 # line: 9582 +from tensorflow.python.ops.gen_experimental_dataset_ops import SnapshotNestedDatasetReader # line: 9694 +from tensorflow.python.ops.gen_experimental_dataset_ops import SqlDataset # line: 9787 +from tensorflow.python.ops.gen_experimental_dataset_ops import StatsAggregatorHandle # line: 9863 +from tensorflow.python.ops.gen_experimental_dataset_ops import StatsAggregatorHandleV2 # line: 9932 +from tensorflow.python.ops.gen_experimental_dataset_ops import StatsAggregatorSetSummaryWriter # line: 9987 +from tensorflow.python.ops.gen_experimental_dataset_ops import StatsAggregatorSummary # line: 10040 +from tensorflow.python.ops.gen_experimental_dataset_ops import TakeWhileDataset # line: 10134 +from tensorflow.python.ops.gen_experimental_dataset_ops import ThreadPoolDataset # line: 10224 +from tensorflow.python.ops.gen_experimental_dataset_ops import ThreadPoolHandle # line: 10323 +from tensorflow.python.ops.gen_experimental_dataset_ops import UnbatchDataset # line: 10412 +from tensorflow.python.ops.gen_experimental_dataset_ops import UncompressElement # line: 10495 +from tensorflow.python.ops.gen_experimental_dataset_ops import UniqueDataset # line: 10582 +from tensorflow.python.ops.gen_filesystem_ops import FileSystemSetConfiguration # line: 58 +from tensorflow.python.ops.gen_functional_ops import Case # line: 110 +from tensorflow.python.ops.gen_functional_ops import DeviceIndex # line: 191 +from tensorflow.python.ops.gen_functional_ops import FakeParam # line: 260 +from tensorflow.python.ops.gen_functional_ops import For # line: 328 +from tensorflow.python.ops.gen_functional_ops import If # line: 423 +from tensorflow.python.ops.gen_functional_ops import PartitionedCall # line: 524 +from tensorflow.python.ops.gen_functional_ops import RemoteCall # line: 605 +from tensorflow.python.ops.gen_functional_ops import StatefulPartitionedCall # line: 697 +from tensorflow.python.ops.gen_functional_ops import StatelessCase # line: 814 +from tensorflow.python.ops.gen_functional_ops import StatelessIf # line: 926 +from tensorflow.python.ops.gen_functional_ops import StatelessWhile # line: 1029 +from tensorflow.python.ops.gen_functional_ops import SymbolicGradient # line: 1120 +from tensorflow.python.ops.gen_functional_ops import ToBool # line: 1194 +from tensorflow.python.ops.gen_functional_ops import While # line: 1282 +from tensorflow.python.ops.gen_image_ops import AdjustContrast # line: 70 +from tensorflow.python.ops.gen_image_ops import AdjustContrastv2 # line: 143 +from tensorflow.python.ops.gen_image_ops import AdjustHue # line: 209 +from tensorflow.python.ops.gen_image_ops import AdjustSaturation # line: 276 +from tensorflow.python.ops.gen_image_ops import CombinedNonMaxSuppression # line: 402 +from tensorflow.python.ops.gen_image_ops import CropAndResize # line: 524 +from tensorflow.python.ops.gen_image_ops import CropAndResizeGradBoxes # line: 616 +from tensorflow.python.ops.gen_image_ops import CropAndResizeGradImage # line: 710 +from tensorflow.python.ops.gen_image_ops import DecodeAndCropJpeg # line: 847 +from tensorflow.python.ops.gen_image_ops import DecodeBmp # line: 935 +from tensorflow.python.ops.gen_image_ops import DecodeGif # line: 1001 +from tensorflow.python.ops.gen_image_ops import DecodeImage # line: 1098 +from tensorflow.python.ops.gen_image_ops import DecodeJpeg # line: 1234 +from tensorflow.python.ops.gen_image_ops import DecodePng # line: 1338 +from tensorflow.python.ops.gen_image_ops import DrawBoundingBoxes # line: 1416 +from tensorflow.python.ops.gen_image_ops import DrawBoundingBoxesV2 # line: 1492 +from tensorflow.python.ops.gen_image_ops import EncodeJpeg # line: 1633 +from tensorflow.python.ops.gen_image_ops import EncodeJpegVariableQuality # line: 1722 +from tensorflow.python.ops.gen_image_ops import EncodePng # line: 1798 +from tensorflow.python.ops.gen_image_ops import ExtractGlimpse # line: 1919 +from tensorflow.python.ops.gen_image_ops import ExtractGlimpseV2 # line: 2053 +from tensorflow.python.ops.gen_image_ops import ExtractJpegShape # line: 2133 +from tensorflow.python.ops.gen_image_ops import GenerateBoundingBoxProposals # line: 2241 +from tensorflow.python.ops.gen_image_ops import HSVToRGB # line: 2341 +from tensorflow.python.ops.gen_image_ops import ImageProjectiveTransformV2 # line: 2425 +from tensorflow.python.ops.gen_image_ops import ImageProjectiveTransformV3 # line: 2521 +from tensorflow.python.ops.gen_image_ops import NonMaxSuppression # line: 2618 +from tensorflow.python.ops.gen_image_ops import NonMaxSuppressionV2 # line: 2713 +from tensorflow.python.ops.gen_image_ops import NonMaxSuppressionV3 # line: 2810 +from tensorflow.python.ops.gen_image_ops import NonMaxSuppressionV4 # line: 2926 +from tensorflow.python.ops.gen_image_ops import NonMaxSuppressionV5 # line: 3056 +from tensorflow.python.ops.gen_image_ops import NonMaxSuppressionWithOverlaps # line: 3150 +from tensorflow.python.ops.gen_image_ops import QuantizedResizeBilinear # line: 3245 +from tensorflow.python.ops.gen_image_ops import RGBToHSV # line: 3359 +from tensorflow.python.ops.gen_image_ops import RandomCrop # line: 3440 +from tensorflow.python.ops.gen_image_ops import ResizeArea # line: 3527 +from tensorflow.python.ops.gen_image_ops import ResizeBicubic # line: 3608 +from tensorflow.python.ops.gen_image_ops import ResizeBicubicGrad # line: 3693 +from tensorflow.python.ops.gen_image_ops import ResizeBilinear # line: 3778 +from tensorflow.python.ops.gen_image_ops import ResizeBilinearGrad # line: 3864 +from tensorflow.python.ops.gen_image_ops import ResizeNearestNeighbor # line: 3948 +from tensorflow.python.ops.gen_image_ops import ResizeNearestNeighborGrad # line: 4032 +from tensorflow.python.ops.gen_image_ops import SampleDistortedBoundingBox # line: 4227 +from tensorflow.python.ops.gen_image_ops import SampleDistortedBoundingBoxV2 # line: 4442 +from tensorflow.python.ops.gen_image_ops import ScaleAndTranslate # line: 4546 +from tensorflow.python.ops.gen_image_ops import ScaleAndTranslateGrad # line: 4629 +from tensorflow.python.ops.gen_image_ops import StatelessSampleDistortedBoundingBox # line: 4831 +from tensorflow.python.ops.gen_io_ops import FixedLengthRecordReader # line: 89 +from tensorflow.python.ops.gen_io_ops import FixedLengthRecordReaderV2 # line: 184 +from tensorflow.python.ops.gen_io_ops import IdentityReader # line: 263 +from tensorflow.python.ops.gen_io_ops import IdentityReaderV2 # line: 324 +from tensorflow.python.ops.gen_io_ops import LMDBReader # line: 383 +from tensorflow.python.ops.gen_io_ops import MatchingFiles # line: 460 +from tensorflow.python.ops.gen_io_ops import MergeV2Checkpoints # line: 540 +from tensorflow.python.ops.gen_io_ops import ReadFile # line: 599 +from tensorflow.python.ops.gen_io_ops import ReaderNumRecordsProduced # line: 644 +from tensorflow.python.ops.gen_io_ops import ReaderNumRecordsProducedV2 # line: 691 +from tensorflow.python.ops.gen_io_ops import ReaderNumWorkUnitsCompleted # line: 734 +from tensorflow.python.ops.gen_io_ops import ReaderNumWorkUnitsCompletedV2 # line: 779 +from tensorflow.python.ops.gen_io_ops import ReaderRead # line: 836 +from tensorflow.python.ops.gen_io_ops import ReaderReadUpTo # line: 886 +from tensorflow.python.ops.gen_io_ops import ReaderReadUpToV2 # line: 950 +from tensorflow.python.ops.gen_io_ops import ReaderReadV2 # line: 1021 +from tensorflow.python.ops.gen_io_ops import ReaderReset # line: 1056 +from tensorflow.python.ops.gen_io_ops import ReaderResetV2 # line: 1092 +from tensorflow.python.ops.gen_io_ops import ReaderRestoreState # line: 1130 +from tensorflow.python.ops.gen_io_ops import ReaderRestoreStateV2 # line: 1173 +from tensorflow.python.ops.gen_io_ops import ReaderSerializeState # line: 1216 +from tensorflow.python.ops.gen_io_ops import ReaderSerializeStateV2 # line: 1263 +from tensorflow.python.ops.gen_io_ops import Restore # line: 1354 +from tensorflow.python.ops.gen_io_ops import RestoreSlice # line: 1443 +from tensorflow.python.ops.gen_io_ops import RestoreV2 # line: 1536 +from tensorflow.python.ops.gen_io_ops import Save # line: 1599 +from tensorflow.python.ops.gen_io_ops import SaveSlices # line: 1678 +from tensorflow.python.ops.gen_io_ops import SaveV2 # line: 1739 +from tensorflow.python.ops.gen_io_ops import ShardedFilename # line: 1798 +from tensorflow.python.ops.gen_io_ops import ShardedFilespec # line: 1856 +from tensorflow.python.ops.gen_io_ops import TFRecordReader # line: 1917 +from tensorflow.python.ops.gen_io_ops import TFRecordReaderV2 # line: 1981 +from tensorflow.python.ops.gen_io_ops import TextLineReader # line: 2052 +from tensorflow.python.ops.gen_io_ops import TextLineReaderV2 # line: 2118 +from tensorflow.python.ops.gen_io_ops import WholeFileReader # line: 2185 +from tensorflow.python.ops.gen_io_ops import WholeFileReaderV2 # line: 2246 +from tensorflow.python.ops.gen_io_ops import WriteFile # line: 2332 +from tensorflow.python.ops.gen_linalg_ops import BandedTriangularSolve # line: 77 +from tensorflow.python.ops.gen_linalg_ops import BatchCholesky # line: 140 +from tensorflow.python.ops.gen_linalg_ops import BatchCholeskyGrad # line: 197 +from tensorflow.python.ops.gen_linalg_ops import BatchMatrixDeterminant # line: 254 +from tensorflow.python.ops.gen_linalg_ops import BatchMatrixInverse # line: 316 +from tensorflow.python.ops.gen_linalg_ops import BatchMatrixSolve # line: 382 +from tensorflow.python.ops.gen_linalg_ops import BatchMatrixSolveLs # line: 452 +from tensorflow.python.ops.gen_linalg_ops import BatchMatrixTriangularSolve # line: 525 +from tensorflow.python.ops.gen_linalg_ops import BatchSelfAdjointEig # line: 589 +from tensorflow.python.ops.gen_linalg_ops import BatchSelfAdjointEigV2 # line: 658 +from tensorflow.python.ops.gen_linalg_ops import BatchSvd # line: 739 +from tensorflow.python.ops.gen_linalg_ops import Cholesky # line: 845 +from tensorflow.python.ops.gen_linalg_ops import CholeskyGrad # line: 912 +from tensorflow.python.ops.gen_linalg_ops import Eig # line: 1000 +from tensorflow.python.ops.gen_linalg_ops import Einsum # line: 1146 +from tensorflow.python.ops.gen_linalg_ops import LogMatrixDeterminant # line: 1227 +from tensorflow.python.ops.gen_linalg_ops import Lu # line: 1346 +from tensorflow.python.ops.gen_linalg_ops import MatrixDeterminant # line: 1439 +from tensorflow.python.ops.gen_linalg_ops import MatrixExponential # line: 1496 +from tensorflow.python.ops.gen_linalg_ops import MatrixInverse # line: 1597 +from tensorflow.python.ops.gen_linalg_ops import MatrixLogarithm # line: 1674 +from tensorflow.python.ops.gen_linalg_ops import MatrixSolve # line: 1777 +from tensorflow.python.ops.gen_linalg_ops import MatrixSolveLs # line: 1888 +from tensorflow.python.ops.gen_linalg_ops import MatrixSquareRoot # line: 1993 +from tensorflow.python.ops.gen_linalg_ops import MatrixTriangularSolve # line: 2119 +from tensorflow.python.ops.gen_linalg_ops import Qr # line: 2242 +from tensorflow.python.ops.gen_linalg_ops import SelfAdjointEig # line: 2311 +from tensorflow.python.ops.gen_linalg_ops import SelfAdjointEigV2 # line: 2395 +from tensorflow.python.ops.gen_linalg_ops import Svd # line: 2496 +from tensorflow.python.ops.gen_linalg_ops import TridiagonalMatMul # line: 2573 +from tensorflow.python.ops.gen_linalg_ops import TridiagonalSolve # line: 2661 +from tensorflow.python.ops.gen_list_ops import EmptyTensorList # line: 81 +from tensorflow.python.ops.gen_list_ops import TensorListConcat # line: 164 +from tensorflow.python.ops.gen_list_ops import TensorListConcatLists # line: 229 +from tensorflow.python.ops.gen_list_ops import TensorListConcatV2 # line: 318 +from tensorflow.python.ops.gen_list_ops import TensorListElementShape # line: 384 +from tensorflow.python.ops.gen_list_ops import TensorListFromTensor # line: 451 +from tensorflow.python.ops.gen_list_ops import TensorListGather # line: 524 +from tensorflow.python.ops.gen_list_ops import TensorListGetItem # line: 595 +from tensorflow.python.ops.gen_list_ops import TensorListLength # line: 655 +from tensorflow.python.ops.gen_list_ops import TensorListPopBack # line: 733 +from tensorflow.python.ops.gen_list_ops import TensorListPushBack # line: 799 +from tensorflow.python.ops.gen_list_ops import TensorListPushBackBatch # line: 858 +from tensorflow.python.ops.gen_list_ops import TensorListReserve # line: 930 +from tensorflow.python.ops.gen_list_ops import TensorListResize # line: 991 +from tensorflow.python.ops.gen_list_ops import TensorListScatter # line: 1062 +from tensorflow.python.ops.gen_list_ops import TensorListScatterIntoExistingList # line: 1134 +from tensorflow.python.ops.gen_list_ops import TensorListScatterV2 # line: 1213 +from tensorflow.python.ops.gen_list_ops import TensorListSetItem # line: 1292 +from tensorflow.python.ops.gen_list_ops import TensorListSplit # line: 1367 +from tensorflow.python.ops.gen_list_ops import TensorListStack # line: 1445 +from tensorflow.python.ops.gen_logging_ops import Assert # line: 66 +from tensorflow.python.ops.gen_logging_ops import AudioSummary # line: 146 +from tensorflow.python.ops.gen_logging_ops import AudioSummaryV2 # line: 229 +from tensorflow.python.ops.gen_logging_ops import HistogramSummary # line: 299 +from tensorflow.python.ops.gen_logging_ops import ImageSummary # line: 408 +from tensorflow.python.ops.gen_logging_ops import MergeSummary # line: 484 +from tensorflow.python.ops.gen_logging_ops import Print # line: 570 +from tensorflow.python.ops.gen_logging_ops import PrintV2 # line: 640 +from tensorflow.python.ops.gen_logging_ops import ScalarSummary # line: 704 +from tensorflow.python.ops.gen_logging_ops import TensorSummary # line: 788 +from tensorflow.python.ops.gen_logging_ops import TensorSummaryV2 # line: 866 +from tensorflow.python.ops.gen_logging_ops import Timestamp # line: 960 +from tensorflow.python.ops.gen_lookup_ops import AnonymousHashTable # line: 81 +from tensorflow.python.ops.gen_lookup_ops import AnonymousMutableDenseHashTable # line: 190 +from tensorflow.python.ops.gen_lookup_ops import AnonymousMutableHashTable # line: 277 +from tensorflow.python.ops.gen_lookup_ops import AnonymousMutableHashTableOfTensors # line: 360 +from tensorflow.python.ops.gen_lookup_ops import HashTable # line: 442 +from tensorflow.python.ops.gen_lookup_ops import HashTableV2 # line: 524 +from tensorflow.python.ops.gen_lookup_ops import InitializeTable # line: 577 +from tensorflow.python.ops.gen_lookup_ops import InitializeTableFromTextFile # line: 640 +from tensorflow.python.ops.gen_lookup_ops import InitializeTableFromTextFileV2 # line: 720 +from tensorflow.python.ops.gen_lookup_ops import InitializeTableV2 # line: 784 +from tensorflow.python.ops.gen_lookup_ops import LookupTableExport # line: 841 +from tensorflow.python.ops.gen_lookup_ops import LookupTableExportV2 # line: 903 +from tensorflow.python.ops.gen_lookup_ops import LookupTableFind # line: 960 +from tensorflow.python.ops.gen_lookup_ops import LookupTableFindV2 # line: 1017 +from tensorflow.python.ops.gen_lookup_ops import LookupTableImport # line: 1062 +from tensorflow.python.ops.gen_lookup_ops import LookupTableImportV2 # line: 1107 +from tensorflow.python.ops.gen_lookup_ops import LookupTableInsert # line: 1149 +from tensorflow.python.ops.gen_lookup_ops import LookupTableInsertV2 # line: 1194 +from tensorflow.python.ops.gen_lookup_ops import LookupTableRemoveV2 # line: 1246 +from tensorflow.python.ops.gen_lookup_ops import LookupTableSize # line: 1286 +from tensorflow.python.ops.gen_lookup_ops import LookupTableSizeV2 # line: 1330 +from tensorflow.python.ops.gen_lookup_ops import MutableDenseHashTable # line: 1431 +from tensorflow.python.ops.gen_lookup_ops import MutableDenseHashTableV2 # line: 1547 +from tensorflow.python.ops.gen_lookup_ops import MutableHashTable # line: 1649 +from tensorflow.python.ops.gen_lookup_ops import MutableHashTableOfTensors # line: 1721 +from tensorflow.python.ops.gen_lookup_ops import MutableHashTableOfTensorsV2 # line: 1811 +from tensorflow.python.ops.gen_lookup_ops import MutableHashTableV2 # line: 1921 +from tensorflow.python.ops.gen_manip_ops import Roll # line: 100 +from tensorflow.python.ops.gen_map_ops import EmptyTensorMap # line: 64 +from tensorflow.python.ops.gen_map_ops import TensorMapErase # line: 130 +from tensorflow.python.ops.gen_map_ops import TensorMapHasKey # line: 193 +from tensorflow.python.ops.gen_map_ops import TensorMapInsert # line: 260 +from tensorflow.python.ops.gen_map_ops import TensorMapLookup # line: 329 +from tensorflow.python.ops.gen_map_ops import TensorMapSize # line: 388 +from tensorflow.python.ops.gen_map_ops import TensorMapStackKeys # line: 451 +from tensorflow.python.ops.gen_math_ops import Abs # line: 69 +from tensorflow.python.ops.gen_math_ops import AccumulateNV2 # line: 144 +from tensorflow.python.ops.gen_math_ops import Acos # line: 211 +from tensorflow.python.ops.gen_math_ops import Acosh # line: 302 +from tensorflow.python.ops.gen_math_ops import Add # line: 367 +from tensorflow.python.ops.gen_math_ops import AddN # line: 436 +from tensorflow.python.ops.gen_math_ops import AddV2 # line: 501 +from tensorflow.python.ops.gen_math_ops import All # line: 573 +from tensorflow.python.ops.gen_math_ops import Angle # line: 657 +from tensorflow.python.ops.gen_math_ops import Any # line: 731 +from tensorflow.python.ops.gen_math_ops import ApproximateEqual # line: 797 +from tensorflow.python.ops.gen_math_ops import ArgMax # line: 882 +from tensorflow.python.ops.gen_math_ops import ArgMin # line: 967 +from tensorflow.python.ops.gen_math_ops import Asin # line: 1070 +from tensorflow.python.ops.gen_math_ops import Asinh # line: 1163 +from tensorflow.python.ops.gen_math_ops import Atan # line: 1263 +from tensorflow.python.ops.gen_math_ops import Atan2 # line: 1361 +from tensorflow.python.ops.gen_math_ops import Atanh # line: 1457 +from tensorflow.python.ops.gen_math_ops import BatchMatMul # line: 1548 +from tensorflow.python.ops.gen_math_ops import BatchMatMulV2 # line: 1649 +from tensorflow.python.ops.gen_math_ops import BatchMatMulV3 # line: 1758 +from tensorflow.python.ops.gen_math_ops import Betainc # line: 1867 +from tensorflow.python.ops.gen_math_ops import Bincount # line: 1938 +from tensorflow.python.ops.gen_math_ops import Bucketize # line: 2016 +from tensorflow.python.ops.gen_math_ops import Cast # line: 2086 +from tensorflow.python.ops.gen_math_ops import Ceil # line: 2146 +from tensorflow.python.ops.gen_math_ops import ClipByValue # line: 2215 +from tensorflow.python.ops.gen_math_ops import Complex # line: 2294 +from tensorflow.python.ops.gen_math_ops import ComplexAbs # line: 2371 +from tensorflow.python.ops.gen_math_ops import Conj # line: 2444 +from tensorflow.python.ops.gen_math_ops import Cos # line: 2537 +from tensorflow.python.ops.gen_math_ops import Cosh # line: 2630 +from tensorflow.python.ops.gen_math_ops import Cross # line: 2722 +from tensorflow.python.ops.gen_math_ops import Cumprod # line: 2830 +from tensorflow.python.ops.gen_math_ops import Cumsum # line: 2944 +from tensorflow.python.ops.gen_math_ops import CumulativeLogsumexp # line: 3046 +from tensorflow.python.ops.gen_math_ops import DenseBincount # line: 3136 +from tensorflow.python.ops.gen_math_ops import Digamma # line: 3227 +from tensorflow.python.ops.gen_math_ops import Div # line: 3288 +from tensorflow.python.ops.gen_math_ops import DivNoNan # line: 3350 +from tensorflow.python.ops.gen_math_ops import Equal # line: 3429 +from tensorflow.python.ops.gen_math_ops import Erf # line: 3525 +from tensorflow.python.ops.gen_math_ops import Erfc # line: 3610 +from tensorflow.python.ops.gen_math_ops import Erfinv # line: 3667 +from tensorflow.python.ops.gen_math_ops import EuclideanNorm # line: 3740 +from tensorflow.python.ops.gen_math_ops import Exp # line: 3827 +from tensorflow.python.ops.gen_math_ops import Expm1 # line: 3925 +from tensorflow.python.ops.gen_math_ops import Floor # line: 3982 +from tensorflow.python.ops.gen_math_ops import FloorDiv # line: 4070 +from tensorflow.python.ops.gen_math_ops import FloorMod # line: 4164 +from tensorflow.python.ops.gen_math_ops import Greater # line: 4265 +from tensorflow.python.ops.gen_math_ops import GreaterEqual # line: 4366 +from tensorflow.python.ops.gen_math_ops import HistogramFixedWidth # line: 4455 +from tensorflow.python.ops.gen_math_ops import Igamma # line: 4559 +from tensorflow.python.ops.gen_math_ops import IgammaGradA # line: 4618 +from tensorflow.python.ops.gen_math_ops import Igammac # line: 4717 +from tensorflow.python.ops.gen_math_ops import Imag # line: 4793 +from tensorflow.python.ops.gen_math_ops import Inv # line: 4854 +from tensorflow.python.ops.gen_math_ops import InvGrad # line: 4914 +from tensorflow.python.ops.gen_math_ops import IsFinite # line: 5010 +from tensorflow.python.ops.gen_math_ops import IsInf # line: 5106 +from tensorflow.python.ops.gen_math_ops import IsNan # line: 5202 +from tensorflow.python.ops.gen_math_ops import Less # line: 5302 +from tensorflow.python.ops.gen_math_ops import LessEqual # line: 5403 +from tensorflow.python.ops.gen_math_ops import Lgamma # line: 5499 +from tensorflow.python.ops.gen_math_ops import LinSpace # line: 5573 +from tensorflow.python.ops.gen_math_ops import Log # line: 5668 +from tensorflow.python.ops.gen_math_ops import Log1p # line: 5760 +from tensorflow.python.ops.gen_math_ops import LogicalAnd # line: 5898 +from tensorflow.python.ops.gen_math_ops import LogicalNot # line: 5986 +from tensorflow.python.ops.gen_math_ops import LogicalOr # line: 6124 +from tensorflow.python.ops.gen_math_ops import MatMul # line: 6205 +from tensorflow.python.ops.gen_math_ops import Max # line: 6286 +from tensorflow.python.ops.gen_math_ops import Maximum # line: 6390 +from tensorflow.python.ops.gen_math_ops import Mean # line: 6465 +from tensorflow.python.ops.gen_math_ops import Min # line: 6542 +from tensorflow.python.ops.gen_math_ops import Minimum # line: 6649 +from tensorflow.python.ops.gen_math_ops import Mod # line: 6714 +from tensorflow.python.ops.gen_math_ops import Mul # line: 6775 +from tensorflow.python.ops.gen_math_ops import MulNoNan # line: 6836 +from tensorflow.python.ops.gen_math_ops import Ndtri # line: 6893 +from tensorflow.python.ops.gen_math_ops import Neg # line: 6978 +from tensorflow.python.ops.gen_math_ops import NextAfter # line: 7071 +from tensorflow.python.ops.gen_math_ops import NotEqual # line: 7142 +from tensorflow.python.ops.gen_math_ops import Polygamma # line: 7240 +from tensorflow.python.ops.gen_math_ops import Pow # line: 7308 +from tensorflow.python.ops.gen_math_ops import Prod # line: 7382 +from tensorflow.python.ops.gen_math_ops import QuantizeDownAndShrinkRange # line: 7486 +from tensorflow.python.ops.gen_math_ops import QuantizedAdd # line: 7574 +from tensorflow.python.ops.gen_math_ops import QuantizedMatMul # line: 7697 +from tensorflow.python.ops.gen_math_ops import QuantizedMul # line: 7799 +from tensorflow.python.ops.gen_math_ops import RaggedBincount # line: 7891 +from tensorflow.python.ops.gen_math_ops import Range # line: 7970 +from tensorflow.python.ops.gen_math_ops import Real # line: 8045 +from tensorflow.python.ops.gen_math_ops import RealDiv # line: 8137 +from tensorflow.python.ops.gen_math_ops import Reciprocal # line: 8225 +from tensorflow.python.ops.gen_math_ops import ReciprocalGrad # line: 8286 +from tensorflow.python.ops.gen_math_ops import RequantizationRange # line: 8361 +from tensorflow.python.ops.gen_math_ops import RequantizationRangePerChannel # line: 8442 +from tensorflow.python.ops.gen_math_ops import Requantize # line: 8537 +from tensorflow.python.ops.gen_math_ops import RequantizePerChannel # line: 8629 +from tensorflow.python.ops.gen_math_ops import Rint # line: 8730 +from tensorflow.python.ops.gen_math_ops import Round # line: 8790 +from tensorflow.python.ops.gen_math_ops import Rsqrt # line: 8848 +from tensorflow.python.ops.gen_math_ops import RsqrtGrad # line: 8908 +from tensorflow.python.ops.gen_math_ops import SegmentMax # line: 9029 +from tensorflow.python.ops.gen_math_ops import SegmentMaxV2 # line: 9140 +from tensorflow.python.ops.gen_math_ops import SegmentMean # line: 9266 +from tensorflow.python.ops.gen_math_ops import SegmentMin # line: 9388 +from tensorflow.python.ops.gen_math_ops import SegmentMinV2 # line: 9499 +from tensorflow.python.ops.gen_math_ops import SegmentProd # line: 9623 +from tensorflow.python.ops.gen_math_ops import SegmentProdV2 # line: 9725 +from tensorflow.python.ops.gen_math_ops import SegmentSum # line: 9848 +from tensorflow.python.ops.gen_math_ops import SegmentSumV2 # line: 9932 +from tensorflow.python.ops.gen_math_ops import Select # line: 10034 +from tensorflow.python.ops.gen_math_ops import SelectV2 # line: 10094 +from tensorflow.python.ops.gen_math_ops import Sigmoid # line: 10154 +from tensorflow.python.ops.gen_math_ops import SigmoidGrad # line: 10214 +from tensorflow.python.ops.gen_math_ops import Sign # line: 10279 +from tensorflow.python.ops.gen_math_ops import Sin # line: 10371 +from tensorflow.python.ops.gen_math_ops import Sinh # line: 10464 +from tensorflow.python.ops.gen_math_ops import SobolSample # line: 10537 +from tensorflow.python.ops.gen_math_ops import SparseBincount # line: 10627 +from tensorflow.python.ops.gen_math_ops import SparseMatMul # line: 10728 +from tensorflow.python.ops.gen_math_ops import SparseSegmentMean # line: 10821 +from tensorflow.python.ops.gen_math_ops import SparseSegmentMeanGrad # line: 10900 +from tensorflow.python.ops.gen_math_ops import SparseSegmentMeanGradV2 # line: 10987 +from tensorflow.python.ops.gen_math_ops import SparseSegmentMeanWithNumSegments # line: 11078 +from tensorflow.python.ops.gen_math_ops import SparseSegmentSqrtN # line: 11164 +from tensorflow.python.ops.gen_math_ops import SparseSegmentSqrtNGrad # line: 11243 +from tensorflow.python.ops.gen_math_ops import SparseSegmentSqrtNGradV2 # line: 11331 +from tensorflow.python.ops.gen_math_ops import SparseSegmentSqrtNWithNumSegments # line: 11424 +from tensorflow.python.ops.gen_math_ops import SparseSegmentSum # line: 11536 +from tensorflow.python.ops.gen_math_ops import SparseSegmentSumGrad # line: 11615 +from tensorflow.python.ops.gen_math_ops import SparseSegmentSumGradV2 # line: 11702 +from tensorflow.python.ops.gen_math_ops import SparseSegmentSumWithNumSegments # line: 11814 +from tensorflow.python.ops.gen_math_ops import Sqrt # line: 11881 +from tensorflow.python.ops.gen_math_ops import SqrtGrad # line: 11941 +from tensorflow.python.ops.gen_math_ops import Square # line: 12030 +from tensorflow.python.ops.gen_math_ops import SquaredDifference # line: 12119 +from tensorflow.python.ops.gen_math_ops import Sub # line: 12254 +from tensorflow.python.ops.gen_math_ops import Sum # line: 12328 +from tensorflow.python.ops.gen_math_ops import Tan # line: 12425 +from tensorflow.python.ops.gen_math_ops import Tanh # line: 12519 +from tensorflow.python.ops.gen_math_ops import TanhGrad # line: 12580 +from tensorflow.python.ops.gen_math_ops import TruncateDiv # line: 12673 +from tensorflow.python.ops.gen_math_ops import TruncateMod # line: 12765 +from tensorflow.python.ops.gen_math_ops import UnsortedSegmentMax # line: 12901 +from tensorflow.python.ops.gen_math_ops import UnsortedSegmentMin # line: 13035 +from tensorflow.python.ops.gen_math_ops import UnsortedSegmentProd # line: 13169 +from tensorflow.python.ops.gen_math_ops import UnsortedSegmentSum # line: 13304 +from tensorflow.python.ops.gen_math_ops import Xdivy # line: 13365 +from tensorflow.python.ops.gen_math_ops import Xlog1py # line: 13423 +from tensorflow.python.ops.gen_math_ops import Xlogy # line: 13508 +from tensorflow.python.ops.gen_math_ops import Zeta # line: 13600 +from tensorflow.python.ops.gen_nccl_ops import NcclAllReduce # line: 91 +from tensorflow.python.ops.gen_nccl_ops import NcclBroadcast # line: 162 +from tensorflow.python.ops.gen_nccl_ops import NcclReduce # line: 237 +from tensorflow.python.ops.gen_nn_ops import ApproxTopK # line: 167 +from tensorflow.python.ops.gen_nn_ops import AvgPool # line: 279 +from tensorflow.python.ops.gen_nn_ops import AvgPool3D # line: 388 +from tensorflow.python.ops.gen_nn_ops import AvgPool3DGrad # line: 497 +from tensorflow.python.ops.gen_nn_ops import AvgPoolGrad # line: 606 +from tensorflow.python.ops.gen_nn_ops import BatchNormWithGlobalNormalization # line: 712 +from tensorflow.python.ops.gen_nn_ops import BatchNormWithGlobalNormalizationGrad # line: 816 +from tensorflow.python.ops.gen_nn_ops import BiasAdd # line: 895 +from tensorflow.python.ops.gen_nn_ops import BiasAddGrad # line: 973 +from tensorflow.python.ops.gen_nn_ops import BiasAddV1 # line: 1040 +from tensorflow.python.ops.gen_nn_ops import Conv # line: 1218 +from tensorflow.python.ops.gen_nn_ops import Conv2D # line: 1398 +from tensorflow.python.ops.gen_nn_ops import Conv2DBackpropFilter # line: 1559 +from tensorflow.python.ops.gen_nn_ops import Conv2DBackpropFilterV2 # line: 1764 +from tensorflow.python.ops.gen_nn_ops import Conv2DBackpropInput # line: 1927 +from tensorflow.python.ops.gen_nn_ops import Conv2DBackpropInputV2 # line: 2130 +from tensorflow.python.ops.gen_nn_ops import Conv3D # line: 2266 +from tensorflow.python.ops.gen_nn_ops import Conv3DBackpropFilter # line: 2373 +from tensorflow.python.ops.gen_nn_ops import Conv3DBackpropFilterV2 # line: 2538 +from tensorflow.python.ops.gen_nn_ops import Conv3DBackpropInput # line: 2648 +from tensorflow.python.ops.gen_nn_ops import Conv3DBackpropInputV2 # line: 2772 +from tensorflow.python.ops.gen_nn_ops import DataFormatDimMap # line: 2866 +from tensorflow.python.ops.gen_nn_ops import DataFormatVecPermute # line: 2976 +from tensorflow.python.ops.gen_nn_ops import DepthwiseConv2dNative # line: 3111 +from tensorflow.python.ops.gen_nn_ops import DepthwiseConv2dNativeBackpropFilter # line: 3262 +from tensorflow.python.ops.gen_nn_ops import DepthwiseConv2dNativeBackpropInput # line: 3414 +from tensorflow.python.ops.gen_nn_ops import Dilation2D # line: 3549 +from tensorflow.python.ops.gen_nn_ops import Dilation2DBackpropFilter # line: 3649 +from tensorflow.python.ops.gen_nn_ops import Dilation2DBackpropInput # line: 3749 +from tensorflow.python.ops.gen_nn_ops import Elu # line: 3863 +from tensorflow.python.ops.gen_nn_ops import EluGrad # line: 3923 +from tensorflow.python.ops.gen_nn_ops import FractionalAvgPool # line: 4061 +from tensorflow.python.ops.gen_nn_ops import FractionalAvgPoolGrad # line: 4176 +from tensorflow.python.ops.gen_nn_ops import FractionalMaxPool # line: 4343 +from tensorflow.python.ops.gen_nn_ops import FractionalMaxPoolGrad # line: 4455 +from tensorflow.python.ops.gen_nn_ops import FusedBatchNorm # line: 4575 +from tensorflow.python.ops.gen_nn_ops import FusedBatchNormGrad # line: 4704 +from tensorflow.python.ops.gen_nn_ops import FusedBatchNormGradV2 # line: 4830 +from tensorflow.python.ops.gen_nn_ops import FusedBatchNormGradV3 # line: 4964 +from tensorflow.python.ops.gen_nn_ops import FusedBatchNormV2 # line: 5093 +from tensorflow.python.ops.gen_nn_ops import FusedBatchNormV3 # line: 5225 +from tensorflow.python.ops.gen_nn_ops import FusedPadConv2D # line: 5334 +from tensorflow.python.ops.gen_nn_ops import FusedResizeAndPadConv2D # line: 5450 +from tensorflow.python.ops.gen_nn_ops import InTopK # line: 5541 +from tensorflow.python.ops.gen_nn_ops import InTopKV2 # line: 5619 +from tensorflow.python.ops.gen_nn_ops import IsotonicRegression # line: 5694 +from tensorflow.python.ops.gen_nn_ops import L2Loss # line: 5785 +from tensorflow.python.ops.gen_nn_ops import LRN # line: 5908 +from tensorflow.python.ops.gen_nn_ops import LRNGrad # line: 6008 +from tensorflow.python.ops.gen_nn_ops import LeakyRelu # line: 6082 +from tensorflow.python.ops.gen_nn_ops import LeakyReluGrad # line: 6150 +from tensorflow.python.ops.gen_nn_ops import LogSoftmax # line: 6215 +from tensorflow.python.ops.gen_nn_ops import MaxPool # line: 6317 +from tensorflow.python.ops.gen_nn_ops import MaxPool3D # line: 6430 +from tensorflow.python.ops.gen_nn_ops import MaxPool3DGrad # line: 6543 +from tensorflow.python.ops.gen_nn_ops import MaxPool3DGradGrad # line: 6658 +from tensorflow.python.ops.gen_nn_ops import MaxPoolGrad # line: 6781 +from tensorflow.python.ops.gen_nn_ops import MaxPoolGradGrad # line: 6902 +from tensorflow.python.ops.gen_nn_ops import MaxPoolGradGradV2 # line: 7002 +from tensorflow.python.ops.gen_nn_ops import MaxPoolGradGradWithArgmax # line: 7106 +from tensorflow.python.ops.gen_nn_ops import MaxPoolGradV2 # line: 7208 +from tensorflow.python.ops.gen_nn_ops import MaxPoolGradWithArgmax # line: 7312 +from tensorflow.python.ops.gen_nn_ops import MaxPoolV2 # line: 7409 +from tensorflow.python.ops.gen_nn_ops import MaxPoolWithArgmax # line: 7530 +from tensorflow.python.ops.gen_nn_ops import NthElement # line: 7623 +from tensorflow.python.ops.gen_nn_ops import QuantizedAvgPool # line: 7722 +from tensorflow.python.ops.gen_nn_ops import QuantizedBatchNormWithGlobalNormalization # line: 7873 +from tensorflow.python.ops.gen_nn_ops import QuantizedBiasAdd # line: 7975 +from tensorflow.python.ops.gen_nn_ops import QuantizedConv2D # line: 8103 +from tensorflow.python.ops.gen_nn_ops import QuantizedConv2DAndRelu # line: 8241 +from tensorflow.python.ops.gen_nn_ops import QuantizedConv2DAndReluAndRequantize # line: 8398 +from tensorflow.python.ops.gen_nn_ops import QuantizedConv2DAndRequantize # line: 8555 +from tensorflow.python.ops.gen_nn_ops import QuantizedConv2DPerChannel # line: 8701 +from tensorflow.python.ops.gen_nn_ops import QuantizedConv2DWithBias # line: 8841 +from tensorflow.python.ops.gen_nn_ops import QuantizedConv2DWithBiasAndRelu # line: 8993 +from tensorflow.python.ops.gen_nn_ops import QuantizedConv2DWithBiasAndReluAndRequantize # line: 9156 +from tensorflow.python.ops.gen_nn_ops import QuantizedConv2DWithBiasAndRequantize # line: 9320 +from tensorflow.python.ops.gen_nn_ops import QuantizedConv2DWithBiasSignedSumAndReluAndRequantize # line: 9493 +from tensorflow.python.ops.gen_nn_ops import QuantizedConv2DWithBiasSumAndRelu # line: 9653 +from tensorflow.python.ops.gen_nn_ops import QuantizedConv2DWithBiasSumAndReluAndRequantize # line: 9825 +from tensorflow.python.ops.gen_nn_ops import QuantizedDepthwiseConv2D # line: 9976 +from tensorflow.python.ops.gen_nn_ops import QuantizedDepthwiseConv2DWithBias # line: 10115 +from tensorflow.python.ops.gen_nn_ops import QuantizedDepthwiseConv2DWithBiasAndRelu # line: 10269 +from tensorflow.python.ops.gen_nn_ops import QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize # line: 10443 +from tensorflow.python.ops.gen_nn_ops import QuantizedMatMulWithBias # line: 10599 +from tensorflow.python.ops.gen_nn_ops import QuantizedMatMulWithBiasAndDequantize # line: 10721 +from tensorflow.python.ops.gen_nn_ops import QuantizedMatMulWithBiasAndRelu # line: 10864 +from tensorflow.python.ops.gen_nn_ops import QuantizedMatMulWithBiasAndReluAndRequantize # line: 11020 +from tensorflow.python.ops.gen_nn_ops import QuantizedMatMulWithBiasAndRequantize # line: 11155 +from tensorflow.python.ops.gen_nn_ops import QuantizedMaxPool # line: 11273 +from tensorflow.python.ops.gen_nn_ops import QuantizedRelu # line: 11366 +from tensorflow.python.ops.gen_nn_ops import QuantizedRelu6 # line: 11450 +from tensorflow.python.ops.gen_nn_ops import QuantizedReluX # line: 11536 +from tensorflow.python.ops.gen_nn_ops import Relu # line: 11630 +from tensorflow.python.ops.gen_nn_ops import Relu6 # line: 11687 +from tensorflow.python.ops.gen_nn_ops import Relu6Grad # line: 11747 +from tensorflow.python.ops.gen_nn_ops import ReluGrad # line: 11808 +from tensorflow.python.ops.gen_nn_ops import Selu # line: 11900 +from tensorflow.python.ops.gen_nn_ops import SeluGrad # line: 11960 +from tensorflow.python.ops.gen_nn_ops import Softmax # line: 12022 +from tensorflow.python.ops.gen_nn_ops import SoftmaxCrossEntropyWithLogits # line: 12094 +from tensorflow.python.ops.gen_nn_ops import Softplus # line: 12152 +from tensorflow.python.ops.gen_nn_ops import SoftplusGrad # line: 12211 +from tensorflow.python.ops.gen_nn_ops import Softsign # line: 12295 +from tensorflow.python.ops.gen_nn_ops import SoftsignGrad # line: 12355 +from tensorflow.python.ops.gen_nn_ops import SparseSoftmaxCrossEntropyWithLogits # line: 12434 +from tensorflow.python.ops.gen_nn_ops import TopK # line: 12525 +from tensorflow.python.ops.gen_nn_ops import TopKV2 # line: 12624 +from tensorflow.python.ops.gen_optional_ops import OptionalFromValue # line: 63 +from tensorflow.python.ops.gen_optional_ops import OptionalGetValue # line: 132 +from tensorflow.python.ops.gen_optional_ops import OptionalHasValue # line: 196 +from tensorflow.python.ops.gen_optional_ops import OptionalNone # line: 249 +from tensorflow.python.ops.gen_parsing_ops import DecodeCSV # line: 107 +from tensorflow.python.ops.gen_parsing_ops import DecodeCompressed # line: 228 +from tensorflow.python.ops.gen_parsing_ops import DecodeJSONExample # line: 298 +from tensorflow.python.ops.gen_parsing_ops import DecodePaddedRaw # line: 370 +from tensorflow.python.ops.gen_parsing_ops import DecodeRaw # line: 445 +from tensorflow.python.ops.gen_parsing_ops import ParseExample # line: 593 +from tensorflow.python.ops.gen_parsing_ops import ParseExampleV2 # line: 793 +from tensorflow.python.ops.gen_parsing_ops import ParseSequenceExample # line: 1106 +from tensorflow.python.ops.gen_parsing_ops import ParseSequenceExampleV2 # line: 1510 +from tensorflow.python.ops.gen_parsing_ops import ParseSingleExample # line: 1767 +from tensorflow.python.ops.gen_parsing_ops import ParseSingleSequenceExample # line: 2030 +from tensorflow.python.ops.gen_parsing_ops import ParseTensor # line: 2206 +from tensorflow.python.ops.gen_parsing_ops import SerializeTensor # line: 2264 +from tensorflow.python.ops.gen_parsing_ops import StringToNumber # line: 2335 +from tensorflow.python.ops.gen_ragged_array_ops import RaggedCross # line: 141 +from tensorflow.python.ops.gen_ragged_array_ops import RaggedFillEmptyRows # line: 277 +from tensorflow.python.ops.gen_ragged_array_ops import RaggedFillEmptyRowsGrad # line: 378 +from tensorflow.python.ops.gen_ragged_array_ops import RaggedGather # line: 499 +from tensorflow.python.ops.gen_ragged_conversion_ops import RaggedTensorFromVariant # line: 113 +from tensorflow.python.ops.gen_ragged_conversion_ops import RaggedTensorToSparse # line: 202 +from tensorflow.python.ops.gen_ragged_conversion_ops import RaggedTensorToTensor # line: 339 +from tensorflow.python.ops.gen_ragged_conversion_ops import RaggedTensorToVariant # line: 442 +from tensorflow.python.ops.gen_ragged_conversion_ops import RaggedTensorToVariantGradient # line: 526 +from tensorflow.python.ops.gen_ragged_math_ops import RaggedRange # line: 102 +from tensorflow.python.ops.gen_random_index_shuffle_ops import RandomIndexShuffle # line: 118 +from tensorflow.python.ops.gen_random_ops import Multinomial # line: 90 +from tensorflow.python.ops.gen_random_ops import ParameterizedTruncatedNormal # line: 190 +from tensorflow.python.ops.gen_random_ops import RandomGamma # line: 280 +from tensorflow.python.ops.gen_random_ops import RandomGammaGrad # line: 344 +from tensorflow.python.ops.gen_random_ops import RandomPoisson # line: 415 +from tensorflow.python.ops.gen_random_ops import RandomPoissonV2 # line: 516 +from tensorflow.python.ops.gen_random_ops import RandomShuffle # line: 606 +from tensorflow.python.ops.gen_random_ops import RandomStandardNormal # line: 691 +from tensorflow.python.ops.gen_random_ops import RandomUniform # line: 778 +from tensorflow.python.ops.gen_random_ops import RandomUniformInt # line: 871 +from tensorflow.python.ops.gen_random_ops import TruncatedNormal # line: 960 +from tensorflow.python.ops.gen_resource_variable_ops import AssignAddVariableOp # line: 62 +from tensorflow.python.ops.gen_resource_variable_ops import AssignSubVariableOp # line: 113 +from tensorflow.python.ops.gen_resource_variable_ops import AssignVariableOp # line: 170 +from tensorflow.python.ops.gen_resource_variable_ops import ConsumeMutexLock # line: 226 +from tensorflow.python.ops.gen_resource_variable_ops import DestroyResourceOp # line: 282 +from tensorflow.python.ops.gen_resource_variable_ops import DisableCopyOnRead # line: 331 +from tensorflow.python.ops.gen_resource_variable_ops import MutexLock # line: 421 +from tensorflow.python.ops.gen_resource_variable_ops import MutexV2 # line: 488 +from tensorflow.python.ops.gen_resource_variable_ops import ReadVariableOp # line: 559 +from tensorflow.python.ops.gen_resource_variable_ops import ResourceGather # line: 649 +from tensorflow.python.ops.gen_resource_variable_ops import ResourceGatherNd # line: 720 +from tensorflow.python.ops.gen_resource_variable_ops import ResourceScatterAdd # line: 796 +from tensorflow.python.ops.gen_resource_variable_ops import ResourceScatterDiv # line: 869 +from tensorflow.python.ops.gen_resource_variable_ops import ResourceScatterMax # line: 942 +from tensorflow.python.ops.gen_resource_variable_ops import ResourceScatterMin # line: 1015 +from tensorflow.python.ops.gen_resource_variable_ops import ResourceScatterMul # line: 1088 +from tensorflow.python.ops.gen_resource_variable_ops import ResourceScatterSub # line: 1161 +from tensorflow.python.ops.gen_resource_variable_ops import ResourceScatterUpdate # line: 1224 +from tensorflow.python.ops.gen_resource_variable_ops import VarHandleOp # line: 1319 +from tensorflow.python.ops.gen_resource_variable_ops import VarIsInitializedOp # line: 1392 +from tensorflow.python.ops.gen_resource_variable_ops import VariableShape # line: 1461 +from tensorflow.python.ops.gen_rnn_ops import BlockLSTM # line: 136 +from tensorflow.python.ops.gen_rnn_ops import BlockLSTMGrad # line: 265 +from tensorflow.python.ops.gen_rnn_ops import BlockLSTMGradV2 # line: 385 +from tensorflow.python.ops.gen_rnn_ops import BlockLSTMV2 # line: 512 +from tensorflow.python.ops.gen_rnn_ops import GRUBlockCell # line: 638 +from tensorflow.python.ops.gen_rnn_ops import GRUBlockCellGrad # line: 797 +from tensorflow.python.ops.gen_rnn_ops import LSTMBlockCell # line: 928 +from tensorflow.python.ops.gen_rnn_ops import LSTMBlockCellGrad # line: 1040 +from tensorflow.python.ops.gen_script_ops import EagerPyFunc # line: 84 +from tensorflow.python.ops.gen_script_ops import PyFunc # line: 163 +from tensorflow.python.ops.gen_script_ops import PyFuncStateless # line: 230 +from tensorflow.python.ops.gen_sdca_ops import SdcaFprint # line: 92 +from tensorflow.python.ops.gen_sdca_ops import SdcaOptimizer # line: 366 +from tensorflow.python.ops.gen_sdca_ops import SdcaOptimizerV2 # line: 655 +from tensorflow.python.ops.gen_sdca_ops import SdcaShrinkL1 # line: 795 +from tensorflow.python.ops.gen_sendrecv_ops import Recv # line: 98 +from tensorflow.python.ops.gen_sendrecv_ops import Send # line: 181 +from tensorflow.python.ops.gen_set_ops import DenseToDenseSetOperation # line: 100 +from tensorflow.python.ops.gen_set_ops import DenseToSparseSetOperation # line: 217 +from tensorflow.python.ops.gen_set_ops import SetSize # line: 304 +from tensorflow.python.ops.gen_set_ops import SparseToSparseSetOperation # line: 437 +from tensorflow.python.ops.gen_sparse_ops import AddManySparseToTensorsMap # line: 115 +from tensorflow.python.ops.gen_sparse_ops import AddSparseToTensorsMap # line: 218 +from tensorflow.python.ops.gen_sparse_ops import DeserializeManySparse # line: 339 +from tensorflow.python.ops.gen_sparse_ops import DeserializeSparse # line: 454 +from tensorflow.python.ops.gen_sparse_ops import SerializeManySparse # line: 537 +from tensorflow.python.ops.gen_sparse_ops import SerializeSparse # line: 615 +from tensorflow.python.ops.gen_sparse_ops import SparseAdd # line: 719 +from tensorflow.python.ops.gen_sparse_ops import SparseAddGrad # line: 807 +from tensorflow.python.ops.gen_sparse_ops import SparseConcat # line: 952 +from tensorflow.python.ops.gen_sparse_ops import SparseCross # line: 1133 +from tensorflow.python.ops.gen_sparse_ops import SparseCrossHashed # line: 1293 +from tensorflow.python.ops.gen_sparse_ops import SparseCrossV2 # line: 1441 +from tensorflow.python.ops.gen_sparse_ops import SparseDenseCwiseAdd # line: 1535 +from tensorflow.python.ops.gen_sparse_ops import SparseDenseCwiseDiv # line: 1607 +from tensorflow.python.ops.gen_sparse_ops import SparseDenseCwiseMul # line: 1683 +from tensorflow.python.ops.gen_sparse_ops import SparseFillEmptyRows # line: 1800 +from tensorflow.python.ops.gen_sparse_ops import SparseFillEmptyRowsGrad # line: 1879 +from tensorflow.python.ops.gen_sparse_ops import SparseReduceMax # line: 1969 +from tensorflow.python.ops.gen_sparse_ops import SparseReduceMaxSparse # line: 2073 +from tensorflow.python.ops.gen_sparse_ops import SparseReduceSum # line: 2167 +from tensorflow.python.ops.gen_sparse_ops import SparseReduceSumSparse # line: 2271 +from tensorflow.python.ops.gen_sparse_ops import SparseReorder # line: 2358 +from tensorflow.python.ops.gen_sparse_ops import SparseReshape # line: 2445 +from tensorflow.python.ops.gen_sparse_ops import SparseSlice # line: 2539 +from tensorflow.python.ops.gen_sparse_ops import SparseSliceGrad # line: 2616 +from tensorflow.python.ops.gen_sparse_ops import SparseSoftmax # line: 2698 +from tensorflow.python.ops.gen_sparse_ops import SparseSparseMaximum # line: 2782 +from tensorflow.python.ops.gen_sparse_ops import SparseSparseMinimum # line: 2869 +from tensorflow.python.ops.gen_sparse_ops import SparseSplit # line: 2975 +from tensorflow.python.ops.gen_sparse_ops import SparseTensorDenseAdd # line: 3051 +from tensorflow.python.ops.gen_sparse_ops import SparseTensorDenseMatMul # line: 3147 +from tensorflow.python.ops.gen_sparse_ops import SparseToDense # line: 3259 +from tensorflow.python.ops.gen_sparse_ops import TakeManySparseFromTensorsMap # line: 3404 +from tensorflow.python.ops.gen_special_math_ops import BesselI0 # line: 65 +from tensorflow.python.ops.gen_special_math_ops import BesselI0e # line: 121 +from tensorflow.python.ops.gen_special_math_ops import BesselI1 # line: 177 +from tensorflow.python.ops.gen_special_math_ops import BesselI1e # line: 233 +from tensorflow.python.ops.gen_special_math_ops import BesselJ0 # line: 289 +from tensorflow.python.ops.gen_special_math_ops import BesselJ1 # line: 345 +from tensorflow.python.ops.gen_special_math_ops import BesselK0 # line: 401 +from tensorflow.python.ops.gen_special_math_ops import BesselK0e # line: 457 +from tensorflow.python.ops.gen_special_math_ops import BesselK1 # line: 513 +from tensorflow.python.ops.gen_special_math_ops import BesselK1e # line: 569 +from tensorflow.python.ops.gen_special_math_ops import BesselY0 # line: 625 +from tensorflow.python.ops.gen_special_math_ops import BesselY1 # line: 681 +from tensorflow.python.ops.gen_special_math_ops import Dawsn # line: 737 +from tensorflow.python.ops.gen_special_math_ops import Expint # line: 793 +from tensorflow.python.ops.gen_special_math_ops import FresnelCos # line: 849 +from tensorflow.python.ops.gen_special_math_ops import FresnelSin # line: 905 +from tensorflow.python.ops.gen_special_math_ops import Spence # line: 961 +from tensorflow.python.ops.gen_spectral_ops import BatchFFT # line: 63 +from tensorflow.python.ops.gen_spectral_ops import BatchFFT2D # line: 117 +from tensorflow.python.ops.gen_spectral_ops import BatchFFT3D # line: 171 +from tensorflow.python.ops.gen_spectral_ops import BatchIFFT # line: 225 +from tensorflow.python.ops.gen_spectral_ops import BatchIFFT2D # line: 279 +from tensorflow.python.ops.gen_spectral_ops import BatchIFFT3D # line: 333 +from tensorflow.python.ops.gen_spectral_ops import FFT # line: 421 +from tensorflow.python.ops.gen_spectral_ops import FFT2D # line: 510 +from tensorflow.python.ops.gen_spectral_ops import FFT3D # line: 599 +from tensorflow.python.ops.gen_spectral_ops import FFTND # line: 701 +from tensorflow.python.ops.gen_spectral_ops import IFFT # line: 792 +from tensorflow.python.ops.gen_spectral_ops import IFFT2D # line: 881 +from tensorflow.python.ops.gen_spectral_ops import IFFT3D # line: 970 +from tensorflow.python.ops.gen_spectral_ops import IFFTND # line: 1072 +from tensorflow.python.ops.gen_spectral_ops import IRFFT # line: 1154 +from tensorflow.python.ops.gen_spectral_ops import IRFFT2D # line: 1238 +from tensorflow.python.ops.gen_spectral_ops import IRFFT3D # line: 1322 +from tensorflow.python.ops.gen_spectral_ops import IRFFTND # line: 1435 +from tensorflow.python.ops.gen_spectral_ops import RFFT # line: 1518 +from tensorflow.python.ops.gen_spectral_ops import RFFT2D # line: 1600 +from tensorflow.python.ops.gen_spectral_ops import RFFT3D # line: 1682 +from tensorflow.python.ops.gen_spectral_ops import RFFTND # line: 1795 +from tensorflow.python.ops.gen_state_ops import Assign # line: 75 +from tensorflow.python.ops.gen_state_ops import AssignAdd # line: 122 +from tensorflow.python.ops.gen_state_ops import AssignSub # line: 169 +from tensorflow.python.ops.gen_state_ops import CountUpTo # line: 209 +from tensorflow.python.ops.gen_state_ops import DestroyTemporaryVariable # line: 256 +from tensorflow.python.ops.gen_state_ops import IsVariableInitialized # line: 293 +from tensorflow.python.ops.gen_state_ops import ResourceCountUpTo # line: 347 +from tensorflow.python.ops.gen_state_ops import ResourceScatterNdAdd # line: 447 +from tensorflow.python.ops.gen_state_ops import ResourceScatterNdMax # line: 514 +from tensorflow.python.ops.gen_state_ops import ResourceScatterNdMin # line: 581 +from tensorflow.python.ops.gen_state_ops import ResourceScatterNdSub # line: 682 +from tensorflow.python.ops.gen_state_ops import ResourceScatterNdUpdate # line: 786 +from tensorflow.python.ops.gen_state_ops import ScatterAdd # line: 872 +from tensorflow.python.ops.gen_state_ops import ScatterDiv # line: 942 +from tensorflow.python.ops.gen_state_ops import ScatterMax # line: 1014 +from tensorflow.python.ops.gen_state_ops import ScatterMin # line: 1086 +from tensorflow.python.ops.gen_state_ops import ScatterMul # line: 1156 +from tensorflow.python.ops.gen_state_ops import ScatterNdAdd # line: 1242 +from tensorflow.python.ops.gen_state_ops import ScatterNdMax # line: 1294 +from tensorflow.python.ops.gen_state_ops import ScatterNdMin # line: 1346 +from tensorflow.python.ops.gen_state_ops import ScatterNdSub # line: 1434 +from tensorflow.python.ops.gen_state_ops import ScatterNdUpdate # line: 1521 +from tensorflow.python.ops.gen_state_ops import ScatterSub # line: 1593 +from tensorflow.python.ops.gen_state_ops import ScatterUpdate # line: 1669 +from tensorflow.python.ops.gen_state_ops import TemporaryVariable # line: 1731 +from tensorflow.python.ops.gen_state_ops import Variable # line: 1780 +from tensorflow.python.ops.gen_state_ops import VariableV2 # line: 1838 +from tensorflow.python.ops.gen_stateful_random_ops import NonDeterministicInts # line: 74 +from tensorflow.python.ops.gen_stateful_random_ops import RngReadAndSkip # line: 141 +from tensorflow.python.ops.gen_stateful_random_ops import RngSkip # line: 198 +from tensorflow.python.ops.gen_stateful_random_ops import StatefulRandomBinomial # line: 268 +from tensorflow.python.ops.gen_stateful_random_ops import StatefulStandardNormal # line: 344 +from tensorflow.python.ops.gen_stateful_random_ops import StatefulStandardNormalV2 # line: 419 +from tensorflow.python.ops.gen_stateful_random_ops import StatefulTruncatedNormal # line: 497 +from tensorflow.python.ops.gen_stateful_random_ops import StatefulUniform # line: 574 +from tensorflow.python.ops.gen_stateful_random_ops import StatefulUniformFullInt # line: 649 +from tensorflow.python.ops.gen_stateful_random_ops import StatefulUniformInt # line: 730 +from tensorflow.python.ops.gen_stateless_random_ops import StatelessMultinomial # line: 83 +from tensorflow.python.ops.gen_stateless_random_ops import StatelessParameterizedTruncatedNormal # line: 164 +from tensorflow.python.ops.gen_stateless_random_ops import StatelessRandomBinomial # line: 249 +from tensorflow.python.ops.gen_stateless_random_ops import StatelessRandomGammaV2 # line: 326 +from tensorflow.python.ops.gen_stateless_random_ops import StatelessRandomNormal # line: 401 +from tensorflow.python.ops.gen_stateless_random_ops import StatelessRandomPoisson # line: 481 +from tensorflow.python.ops.gen_stateless_random_ops import StatelessRandomUniform # line: 559 +from tensorflow.python.ops.gen_stateless_random_ops import StatelessRandomUniformFullInt # line: 637 +from tensorflow.python.ops.gen_stateless_random_ops import StatelessRandomUniformInt # line: 713 +from tensorflow.python.ops.gen_stateless_random_ops import StatelessTruncatedNormal # line: 791 +from tensorflow.python.ops.gen_stateless_random_ops_v2 import StatelessRandomGammaV3 # line: 81 +from tensorflow.python.ops.gen_stateless_random_ops_v2 import StatelessRandomGetAlg # line: 141 +from tensorflow.python.ops.gen_stateless_random_ops_v2 import StatelessRandomGetKeyCounter # line: 207 +from tensorflow.python.ops.gen_stateless_random_ops_v2 import StatelessRandomGetKeyCounterAlg # line: 276 +from tensorflow.python.ops.gen_stateless_random_ops_v2 import StatelessRandomNormalV2 # line: 352 +from tensorflow.python.ops.gen_stateless_random_ops_v2 import StatelessRandomUniformFullIntV2 # line: 435 +from tensorflow.python.ops.gen_stateless_random_ops_v2 import StatelessRandomUniformIntV2 # line: 517 +from tensorflow.python.ops.gen_stateless_random_ops_v2 import StatelessRandomUniformV2 # line: 599 +from tensorflow.python.ops.gen_stateless_random_ops_v2 import StatelessShuffle # line: 680 +from tensorflow.python.ops.gen_stateless_random_ops_v2 import StatelessTruncatedNormalV2 # line: 760 +from tensorflow.python.ops.gen_string_ops import AsString # line: 147 +from tensorflow.python.ops.gen_string_ops import DecodeBase64 # line: 250 +from tensorflow.python.ops.gen_string_ops import EncodeBase64 # line: 345 +from tensorflow.python.ops.gen_string_ops import ReduceJoin # line: 446 +from tensorflow.python.ops.gen_string_ops import RegexFullMatch # line: 524 +from tensorflow.python.ops.gen_string_ops import RegexReplace # line: 597 +from tensorflow.python.ops.gen_string_ops import StaticRegexFullMatch # line: 666 +from tensorflow.python.ops.gen_string_ops import StaticRegexReplace # line: 738 +from tensorflow.python.ops.gen_string_ops import StringFormat # line: 822 +from tensorflow.python.ops.gen_string_ops import StringJoin # line: 908 +from tensorflow.python.ops.gen_string_ops import StringLength # line: 988 +from tensorflow.python.ops.gen_string_ops import StringLower # line: 1083 +from tensorflow.python.ops.gen_string_ops import StringNGrams # line: 1201 +from tensorflow.python.ops.gen_string_ops import StringSplit # line: 1307 +from tensorflow.python.ops.gen_string_ops import StringSplitV2 # line: 1407 +from tensorflow.python.ops.gen_string_ops import StringStrip # line: 1498 +from tensorflow.python.ops.gen_string_ops import StringToHashBucket # line: 1564 +from tensorflow.python.ops.gen_string_ops import StringToHashBucketFast # line: 1667 +from tensorflow.python.ops.gen_string_ops import StringToHashBucketStrong # line: 1788 +from tensorflow.python.ops.gen_string_ops import StringUpper # line: 1888 +from tensorflow.python.ops.gen_string_ops import Substr # line: 2044 +from tensorflow.python.ops.gen_string_ops import UnicodeDecode # line: 2176 +from tensorflow.python.ops.gen_string_ops import UnicodeDecodeWithOffsets # line: 2325 +from tensorflow.python.ops.gen_string_ops import UnicodeEncode # line: 2450 +from tensorflow.python.ops.gen_string_ops import UnicodeScript # line: 2559 +from tensorflow.python.ops.gen_string_ops import UnicodeTranscode # line: 2745 +from tensorflow.python.ops.gen_string_ops import UnsortedSegmentJoin # line: 2828 +from tensorflow.python.ops.gen_summary_ops import CloseSummaryWriter # line: 55 +from tensorflow.python.ops.gen_summary_ops import CreateSummaryDbWriter # line: 107 +from tensorflow.python.ops.gen_summary_ops import CreateSummaryFileWriter # line: 163 +from tensorflow.python.ops.gen_summary_ops import FlushSummaryWriter # line: 211 +from tensorflow.python.ops.gen_summary_ops import ImportEvent # line: 255 +from tensorflow.python.ops.gen_summary_ops import SummaryWriter # line: 317 +from tensorflow.python.ops.gen_summary_ops import WriteAudioSummary # line: 383 +from tensorflow.python.ops.gen_summary_ops import WriteGraphSummary # line: 438 +from tensorflow.python.ops.gen_summary_ops import WriteHistogramSummary # line: 491 +from tensorflow.python.ops.gen_summary_ops import WriteImageSummary # line: 554 +from tensorflow.python.ops.gen_summary_ops import WriteRawProtoSummary # line: 609 +from tensorflow.python.ops.gen_summary_ops import WriteScalarSummary # line: 662 +from tensorflow.python.ops.gen_summary_ops import WriteSummary # line: 718 +from tensorflow.python.ops.gen_sync_ops import SyncDevice # line: 57 +from tensorflow.python.ops.gen_tpu_ops import AllToAll # line: 104 +from tensorflow.python.ops.gen_tpu_ops import AssignVariableXlaConcatND # line: 228 +from tensorflow.python.ops.gen_tpu_ops import CollectivePermute # line: 313 +from tensorflow.python.ops.gen_tpu_ops import ConfigureDistributedTPU # line: 420 +from tensorflow.python.ops.gen_tpu_ops import ConfigureTPUEmbedding # line: 491 +from tensorflow.python.ops.gen_tpu_ops import CrossReplicaSum # line: 556 +from tensorflow.python.ops.gen_tpu_ops import DynamicEnqueueTPUEmbeddingArbitraryTensorBatch # line: 691 +from tensorflow.python.ops.gen_tpu_ops import DynamicEnqueueTPUEmbeddingRaggedTensorBatch # line: 847 +from tensorflow.python.ops.gen_tpu_ops import EnqueueTPUEmbeddingArbitraryTensorBatch # line: 1038 +from tensorflow.python.ops.gen_tpu_ops import EnqueueTPUEmbeddingIntegerBatch # line: 1142 +from tensorflow.python.ops.gen_tpu_ops import EnqueueTPUEmbeddingRaggedTensorBatch # line: 1311 +from tensorflow.python.ops.gen_tpu_ops import EnqueueTPUEmbeddingSparseBatch # line: 1494 +from tensorflow.python.ops.gen_tpu_ops import EnqueueTPUEmbeddingSparseTensorBatch # line: 1689 +from tensorflow.python.ops.gen_tpu_ops import InfeedDequeue # line: 1805 +from tensorflow.python.ops.gen_tpu_ops import InfeedDequeueTuple # line: 1875 +from tensorflow.python.ops.gen_tpu_ops import InfeedEnqueue # line: 1959 +from tensorflow.python.ops.gen_tpu_ops import InfeedEnqueuePrelinearizedBuffer # line: 2026 +from tensorflow.python.ops.gen_tpu_ops import InfeedEnqueueTuple # line: 2103 +from tensorflow.python.ops.gen_tpu_ops import IsTPUEmbeddingInitialized # line: 2173 +from tensorflow.python.ops.gen_tpu_ops import LoadTPUEmbeddingADAMParameters # line: 2260 +from tensorflow.python.ops.gen_tpu_ops import LoadTPUEmbeddingAdadeltaParameters # line: 2356 +from tensorflow.python.ops.gen_tpu_ops import LoadTPUEmbeddingAdagradMomentumParameters # line: 2452 +from tensorflow.python.ops.gen_tpu_ops import LoadTPUEmbeddingAdagradParameters # line: 2545 +from tensorflow.python.ops.gen_tpu_ops import LoadTPUEmbeddingCenteredRMSPropParameters # line: 2641 +from tensorflow.python.ops.gen_tpu_ops import LoadTPUEmbeddingFTRLParameters # line: 2738 +from tensorflow.python.ops.gen_tpu_ops import LoadTPUEmbeddingFrequencyEstimatorParameters # line: 2833 +from tensorflow.python.ops.gen_tpu_ops import LoadTPUEmbeddingMDLAdagradLightParameters # line: 2932 +from tensorflow.python.ops.gen_tpu_ops import LoadTPUEmbeddingMomentumParameters # line: 3026 +from tensorflow.python.ops.gen_tpu_ops import LoadTPUEmbeddingProximalAdagradParameters # line: 3118 +from tensorflow.python.ops.gen_tpu_ops import LoadTPUEmbeddingProximalYogiParameters # line: 3202 +from tensorflow.python.ops.gen_tpu_ops import LoadTPUEmbeddingRMSPropParameters # line: 3296 +from tensorflow.python.ops.gen_tpu_ops import LoadTPUEmbeddingStochasticGradientDescentParameters # line: 3387 +from tensorflow.python.ops.gen_tpu_ops import OutfeedDequeue # line: 3470 +from tensorflow.python.ops.gen_tpu_ops import OutfeedDequeueTuple # line: 3557 +from tensorflow.python.ops.gen_tpu_ops import OutfeedDequeueTupleV2 # line: 3649 +from tensorflow.python.ops.gen_tpu_ops import OutfeedDequeueV2 # line: 3728 +from tensorflow.python.ops.gen_tpu_ops import OutfeedEnqueue # line: 3778 +from tensorflow.python.ops.gen_tpu_ops import OutfeedEnqueueTuple # line: 3823 +from tensorflow.python.ops.gen_tpu_ops import Prelinearize # line: 3893 +from tensorflow.python.ops.gen_tpu_ops import PrelinearizeTuple # line: 3980 +from tensorflow.python.ops.gen_tpu_ops import ReadVariableXlaSplitND # line: 4115 +from tensorflow.python.ops.gen_tpu_ops import RecvTPUEmbeddingActivations # line: 4199 +from tensorflow.python.ops.gen_tpu_ops import RetrieveTPUEmbeddingADAMParameters # line: 4293 +from tensorflow.python.ops.gen_tpu_ops import RetrieveTPUEmbeddingAdadeltaParameters # line: 4398 +from tensorflow.python.ops.gen_tpu_ops import RetrieveTPUEmbeddingAdagradMomentumParameters # line: 4504 +from tensorflow.python.ops.gen_tpu_ops import RetrieveTPUEmbeddingAdagradParameters # line: 4608 +from tensorflow.python.ops.gen_tpu_ops import RetrieveTPUEmbeddingCenteredRMSPropParameters # line: 4715 +from tensorflow.python.ops.gen_tpu_ops import RetrieveTPUEmbeddingFTRLParameters # line: 4820 +from tensorflow.python.ops.gen_tpu_ops import RetrieveTPUEmbeddingFrequencyEstimatorParameters # line: 4925 +from tensorflow.python.ops.gen_tpu_ops import RetrieveTPUEmbeddingMDLAdagradLightParameters # line: 5032 +from tensorflow.python.ops.gen_tpu_ops import RetrieveTPUEmbeddingMomentumParameters # line: 5136 +from tensorflow.python.ops.gen_tpu_ops import RetrieveTPUEmbeddingProximalAdagradParameters # line: 5241 +from tensorflow.python.ops.gen_tpu_ops import RetrieveTPUEmbeddingProximalYogiParameters # line: 5342 +from tensorflow.python.ops.gen_tpu_ops import RetrieveTPUEmbeddingRMSPropParameters # line: 5447 +from tensorflow.python.ops.gen_tpu_ops import RetrieveTPUEmbeddingStochasticGradientDescentParameters # line: 5544 +from tensorflow.python.ops.gen_tpu_ops import SendTPUEmbeddingGradients # line: 5630 +from tensorflow.python.ops.gen_tpu_ops import ShutdownDistributedTPU # line: 5687 +from tensorflow.python.ops.gen_tpu_ops import TPUCompilationResult # line: 5741 +from tensorflow.python.ops.gen_tpu_ops import TPUEmbeddingActivations # line: 5817 +from tensorflow.python.ops.gen_tpu_ops import TPUOrdinalSelector # line: 5878 +from tensorflow.python.ops.gen_tpu_ops import TPUPartitionedCall # line: 5949 +from tensorflow.python.ops.gen_tpu_ops import TPUReplicateMetadata # line: 6101 +from tensorflow.python.ops.gen_tpu_ops import TPUReplicatedInput # line: 6247 +from tensorflow.python.ops.gen_tpu_ops import TPUReplicatedOutput # line: 6332 +from tensorflow.python.ops.gen_tpu_ops import WorkerHeartbeat # line: 6391 +from tensorflow.python.ops.gen_tpu_ops import XlaConcatND # line: 6513 +from tensorflow.python.ops.gen_tpu_ops import XlaSplitND # line: 6648 +from tensorflow.python.ops.gen_tpu_partition_ops import TPUPartitionedInput # line: 80 +from tensorflow.python.ops.gen_tpu_partition_ops import TPUPartitionedInputV2 # line: 168 +from tensorflow.python.ops.gen_tpu_partition_ops import TPUPartitionedOutput # line: 252 +from tensorflow.python.ops.gen_tpu_partition_ops import TPUPartitionedOutputV2 # line: 330 +from tensorflow.python.ops.gen_training_ops import ApplyAdaMax # line: 83 +from tensorflow.python.ops.gen_training_ops import ApplyAdadelta # line: 143 +from tensorflow.python.ops.gen_training_ops import ApplyAdagrad # line: 201 +from tensorflow.python.ops.gen_training_ops import ApplyAdagradDA # line: 260 +from tensorflow.python.ops.gen_training_ops import ApplyAdagradV2 # line: 320 +from tensorflow.python.ops.gen_training_ops import ApplyAdam # line: 394 +from tensorflow.python.ops.gen_training_ops import ApplyAddSign # line: 452 +from tensorflow.python.ops.gen_training_ops import ApplyCenteredRMSProp # line: 531 +from tensorflow.python.ops.gen_training_ops import ApplyFtrl # line: 600 +from tensorflow.python.ops.gen_training_ops import ApplyFtrlV2 # line: 673 +from tensorflow.python.ops.gen_training_ops import ApplyGradientDescent # line: 719 +from tensorflow.python.ops.gen_training_ops import ApplyMomentum # line: 784 +from tensorflow.python.ops.gen_training_ops import ApplyPowerSign # line: 842 +from tensorflow.python.ops.gen_training_ops import ApplyProximalAdagrad # line: 898 +from tensorflow.python.ops.gen_training_ops import ApplyProximalGradientDescent # line: 952 +from tensorflow.python.ops.gen_training_ops import ApplyRMSProp # line: 1020 +from tensorflow.python.ops.gen_training_ops import ResourceApplyAdaMax # line: 1087 +from tensorflow.python.ops.gen_training_ops import ResourceApplyAdadelta # line: 1164 +from tensorflow.python.ops.gen_training_ops import ResourceApplyAdagrad # line: 1238 +from tensorflow.python.ops.gen_training_ops import ResourceApplyAdagradDA # line: 1321 +from tensorflow.python.ops.gen_training_ops import ResourceApplyAdagradV2 # line: 1400 +from tensorflow.python.ops.gen_training_ops import ResourceApplyAdam # line: 1496 +from tensorflow.python.ops.gen_training_ops import ResourceApplyAdamWithAmsgrad # line: 1589 +from tensorflow.python.ops.gen_training_ops import ResourceApplyAddSign # line: 1665 +from tensorflow.python.ops.gen_training_ops import ResourceApplyCenteredRMSProp # line: 1759 +from tensorflow.python.ops.gen_training_ops import ResourceApplyFtrl # line: 1850 +from tensorflow.python.ops.gen_training_ops import ResourceApplyFtrlV2 # line: 1946 +from tensorflow.python.ops.gen_training_ops import ResourceApplyGradientDescent # line: 2013 +from tensorflow.python.ops.gen_training_ops import ResourceApplyKerasMomentum # line: 2094 +from tensorflow.python.ops.gen_training_ops import ResourceApplyMomentum # line: 2179 +from tensorflow.python.ops.gen_training_ops import ResourceApplyPowerSign # line: 2256 +from tensorflow.python.ops.gen_training_ops import ResourceApplyProximalAdagrad # line: 2330 +from tensorflow.python.ops.gen_training_ops import ResourceApplyProximalGradientDescent # line: 2403 +from tensorflow.python.ops.gen_training_ops import ResourceApplyRMSProp # line: 2486 +from tensorflow.python.ops.gen_training_ops import ResourceSparseApplyAdadelta # line: 2563 +from tensorflow.python.ops.gen_training_ops import ResourceSparseApplyAdagrad # line: 2645 +from tensorflow.python.ops.gen_training_ops import ResourceSparseApplyAdagradDA # line: 2734 +from tensorflow.python.ops.gen_training_ops import ResourceSparseApplyAdagradV2 # line: 2821 +from tensorflow.python.ops.gen_training_ops import ResourceSparseApplyCenteredRMSProp # line: 2924 +from tensorflow.python.ops.gen_training_ops import ResourceSparseApplyFtrl # line: 3022 +from tensorflow.python.ops.gen_training_ops import ResourceSparseApplyFtrlV2 # line: 3126 +from tensorflow.python.ops.gen_training_ops import ResourceSparseApplyKerasMomentum # line: 3222 +from tensorflow.python.ops.gen_training_ops import ResourceSparseApplyMomentum # line: 3315 +from tensorflow.python.ops.gen_training_ops import ResourceSparseApplyProximalAdagrad # line: 3401 +from tensorflow.python.ops.gen_training_ops import ResourceSparseApplyProximalGradientDescent # line: 3481 +from tensorflow.python.ops.gen_training_ops import ResourceSparseApplyRMSProp # line: 3570 +from tensorflow.python.ops.gen_training_ops import SparseApplyAdadelta # line: 3646 +from tensorflow.python.ops.gen_training_ops import SparseApplyAdagrad # line: 3709 +from tensorflow.python.ops.gen_training_ops import SparseApplyAdagradDA # line: 3773 +from tensorflow.python.ops.gen_training_ops import SparseApplyAdagradV2 # line: 3839 +from tensorflow.python.ops.gen_training_ops import SparseApplyCenteredRMSProp # line: 3921 +from tensorflow.python.ops.gen_training_ops import SparseApplyFtrl # line: 3997 +from tensorflow.python.ops.gen_training_ops import SparseApplyFtrlV2 # line: 4077 +from tensorflow.python.ops.gen_training_ops import SparseApplyMomentum # line: 4149 +from tensorflow.python.ops.gen_training_ops import SparseApplyProximalAdagrad # line: 4212 +from tensorflow.python.ops.gen_training_ops import SparseApplyProximalGradientDescent # line: 4273 +from tensorflow.python.ops.gen_training_ops import SparseApplyRMSProp # line: 4346 +from tensorflow.python.ops.gen_uniform_quant_ops import UniformDequantize # line: 111 +from tensorflow.python.ops.gen_uniform_quant_ops import UniformQuantize # line: 223 +from tensorflow.python.ops.gen_uniform_quant_ops import UniformQuantizedAdd # line: 432 +from tensorflow.python.ops.gen_uniform_quant_ops import UniformQuantizedClipByValue # line: 562 +from tensorflow.python.ops.gen_uniform_quant_ops import UniformQuantizedConvolution # line: 879 +from tensorflow.python.ops.gen_uniform_quant_ops import UniformQuantizedConvolutionHybrid # line: 1174 +from tensorflow.python.ops.gen_uniform_quant_ops import UniformQuantizedDot # line: 1422 +from tensorflow.python.ops.gen_uniform_quant_ops import UniformQuantizedDotHybrid # line: 1565 +from tensorflow.python.ops.gen_uniform_quant_ops import UniformRequantize # line: 1732 +from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import CSRSparseMatrixComponents # line: 84 +from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import CSRSparseMatrixToDense # line: 146 +from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import CSRSparseMatrixToSparseTensor # line: 218 +from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import DenseToCSRSparseMatrix # line: 279 +from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import SparseMatrixAdd # line: 344 +from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import SparseMatrixMatMul # line: 476 +from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import SparseMatrixMul # line: 563 +from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import SparseMatrixNNZ # line: 618 +from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import SparseMatrixOrderingAMD # line: 722 +from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import SparseMatrixSoftmax # line: 787 +from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import SparseMatrixSoftmaxGrad # line: 849 +from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import SparseMatrixSparseCholesky # line: 992 +from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import SparseMatrixSparseMatMul # line: 1162 +from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import SparseMatrixTranspose # line: 1247 +from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import SparseMatrixZeros # line: 1309 +from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import SparseTensorToCSRSparseMatrix # line: 1371 +from tensorflow.python.user_ops.ops.gen_user_ops import Fact # line: 62 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/saved_model/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/saved_model/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c751d9f74e185ee1b8ec798a1ba3648253530136 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/saved_model/__init__.py @@ -0,0 +1,38 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.saved_model namespace +""" + +import sys as _sys + +from tensorflow._api.v2.saved_model import experimental +from tensorflow.python.saved_model.constants import ASSETS_DIRECTORY # line: 26 +from tensorflow.python.saved_model.constants import ASSETS_KEY # line: 37 +from tensorflow.python.saved_model.constants import DEBUG_DIRECTORY # line: 97 +from tensorflow.python.saved_model.constants import DEBUG_INFO_FILENAME_PB # line: 107 +from tensorflow.python.saved_model.constants import SAVED_MODEL_FILENAME_PB # line: 76 +from tensorflow.python.saved_model.constants import SAVED_MODEL_FILENAME_PBTXT # line: 88 +from tensorflow.python.saved_model.constants import SAVED_MODEL_SCHEMA_VERSION # line: 64 +from tensorflow.python.saved_model.constants import VARIABLES_DIRECTORY # line: 116 +from tensorflow.python.saved_model.constants import VARIABLES_FILENAME # line: 125 +from tensorflow.python.saved_model.load import load # line: 819 +from tensorflow.python.saved_model.load_options import LoadOptions # line: 21 +from tensorflow.python.saved_model.loader_impl import contains_saved_model # line: 254 +from tensorflow.python.saved_model.save import save # line: 1145 +from tensorflow.python.saved_model.save_options import SaveOptions # line: 92 +from tensorflow.python.saved_model.signature_constants import CLASSIFY_INPUTS # line: 38 +from tensorflow.python.saved_model.signature_constants import CLASSIFY_METHOD_NAME # line: 47 +from tensorflow.python.saved_model.signature_constants import CLASSIFY_OUTPUT_CLASSES # line: 56 +from tensorflow.python.saved_model.signature_constants import CLASSIFY_OUTPUT_SCORES # line: 65 +from tensorflow.python.saved_model.signature_constants import DEFAULT_SERVING_SIGNATURE_DEF_KEY # line: 25 +from tensorflow.python.saved_model.signature_constants import PREDICT_INPUTS # line: 77 +from tensorflow.python.saved_model.signature_constants import PREDICT_METHOD_NAME # line: 86 +from tensorflow.python.saved_model.signature_constants import PREDICT_OUTPUTS # line: 95 +from tensorflow.python.saved_model.signature_constants import REGRESS_INPUTS # line: 107 +from tensorflow.python.saved_model.signature_constants import REGRESS_METHOD_NAME # line: 116 +from tensorflow.python.saved_model.signature_constants import REGRESS_OUTPUTS # line: 125 +from tensorflow.python.saved_model.tag_constants import GPU # line: 44 +from tensorflow.python.saved_model.tag_constants import SERVING # line: 23 +from tensorflow.python.saved_model.tag_constants import TPU # line: 51 +from tensorflow.python.saved_model.tag_constants import TRAINING # line: 31 +from tensorflow.python.trackable.asset import Asset # line: 30 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/saved_model/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/saved_model/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..40daaf08990f910291bd6115b3696b52a48702e6 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/saved_model/experimental/__init__.py @@ -0,0 +1,11 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.saved_model.experimental namespace +""" + +import sys as _sys + +from tensorflow.python.saved_model.fingerprinting import Fingerprint # line: 26 +from tensorflow.python.saved_model.fingerprinting import read_fingerprint # line: 149 +from tensorflow.python.saved_model.save_options import VariablePolicy # line: 26 +from tensorflow.python.trackable.resource import TrackableResource # line: 233 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/sets/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/sets/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9d0e25911cd93fe6da9a471cce9f1ae078dd3ac1 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/sets/__init__.py @@ -0,0 +1,11 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.sets namespace +""" + +import sys as _sys + +from tensorflow.python.ops.sets_impl import set_difference as difference # line: 208 +from tensorflow.python.ops.sets_impl import set_intersection as intersection # line: 137 +from tensorflow.python.ops.sets_impl import set_size as size # line: 30 +from tensorflow.python.ops.sets_impl import set_union as union # line: 289 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/signal/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/signal/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..75bf63034ff4df03813c3cefd775e85e6641d868 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/signal/__init__.py @@ -0,0 +1,41 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.signal namespace +""" + +import sys as _sys + +from tensorflow.python.ops.gen_spectral_ops import fft # line: 353 +from tensorflow.python.ops.gen_spectral_ops import fft2d # line: 442 +from tensorflow.python.ops.gen_spectral_ops import fft3d # line: 531 +from tensorflow.python.ops.gen_spectral_ops import ifft # line: 724 +from tensorflow.python.ops.gen_spectral_ops import ifft2d # line: 813 +from tensorflow.python.ops.gen_spectral_ops import ifft3d # line: 902 +from tensorflow.python.ops.signal.dct_ops import dct # line: 50 +from tensorflow.python.ops.signal.dct_ops import idct # line: 212 +from tensorflow.python.ops.signal.fft_ops import fftnd # line: 400 +from tensorflow.python.ops.signal.fft_ops import fftshift # line: 603 +from tensorflow.python.ops.signal.fft_ops import ifftnd # line: 404 +from tensorflow.python.ops.signal.fft_ops import ifftshift # line: 648 +from tensorflow.python.ops.signal.fft_ops import irfft # line: 411 +from tensorflow.python.ops.signal.fft_ops import irfft2d # line: 417 +from tensorflow.python.ops.signal.fft_ops import irfft3d # line: 423 +from tensorflow.python.ops.signal.fft_ops import irfftnd # line: 430 +from tensorflow.python.ops.signal.fft_ops import rfft # line: 408 +from tensorflow.python.ops.signal.fft_ops import rfft2d # line: 414 +from tensorflow.python.ops.signal.fft_ops import rfft3d # line: 420 +from tensorflow.python.ops.signal.fft_ops import rfftnd # line: 426 +from tensorflow.python.ops.signal.mel_ops import linear_to_mel_weight_matrix # line: 90 +from tensorflow.python.ops.signal.mfcc_ops import mfccs_from_log_mel_spectrograms # line: 25 +from tensorflow.python.ops.signal.reconstruction_ops import overlap_and_add # line: 26 +from tensorflow.python.ops.signal.shape_ops import frame # line: 55 +from tensorflow.python.ops.signal.spectral_ops import inverse_mdct # line: 367 +from tensorflow.python.ops.signal.spectral_ops import inverse_stft # line: 155 +from tensorflow.python.ops.signal.spectral_ops import inverse_stft_window_fn # line: 95 +from tensorflow.python.ops.signal.spectral_ops import mdct # line: 291 +from tensorflow.python.ops.signal.spectral_ops import stft # line: 34 +from tensorflow.python.ops.signal.window_ops import hamming_window # line: 171 +from tensorflow.python.ops.signal.window_ops import hann_window # line: 145 +from tensorflow.python.ops.signal.window_ops import kaiser_bessel_derived_window # line: 92 +from tensorflow.python.ops.signal.window_ops import kaiser_window # line: 53 +from tensorflow.python.ops.signal.window_ops import vorbis_window # line: 120 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/sparse/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/sparse/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9710725d5c87fddbf25edbe45d961e8e446953c2 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/sparse/__init__.py @@ -0,0 +1,37 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.sparse namespace +""" + +import sys as _sys + +from tensorflow.python.framework.sparse_tensor import SparseTensor # line: 47 +from tensorflow.python.ops.array_ops import sparse_mask as mask # line: 1845 +from tensorflow.python.ops.math_ops import sparse_segment_mean_v2 as segment_mean # line: 5003 +from tensorflow.python.ops.math_ops import sparse_segment_sqrt_n_v2 as segment_sqrt_n # line: 5105 +from tensorflow.python.ops.math_ops import sparse_segment_sum_v2 as segment_sum # line: 4861 +from tensorflow.python.ops.sparse_ops import sparse_add_v2 as add # line: 524 +from tensorflow.python.ops.sparse_ops import sparse_bincount as bincount # line: 3205 +from tensorflow.python.ops.sparse_ops import sparse_concat_v2 as concat # line: 400 +from tensorflow.python.ops.sparse_ops import sparse_cross as cross # line: 608 +from tensorflow.python.ops.sparse_ops import sparse_cross_hashed as cross_hashed # line: 666 +from tensorflow.python.ops.sparse_ops import sparse_expand_dims as expand_dims # line: 143 +from tensorflow.python.ops.sparse_ops import sparse_eye as eye # line: 249 +from tensorflow.python.ops.sparse_ops import sparse_fill_empty_rows as fill_empty_rows # line: 2109 +from tensorflow.python.ops.sparse_ops import from_dense # line: 111 +from tensorflow.python.ops.sparse_ops import map_values # line: 2932 +from tensorflow.python.ops.sparse_ops import sparse_maximum as maximum # line: 2734 +from tensorflow.python.ops.sparse_ops import sparse_minimum as minimum # line: 2780 +from tensorflow.python.ops.sparse_ops import sparse_reduce_max_v2 as reduce_max # line: 1246 +from tensorflow.python.ops.sparse_ops import sparse_reduce_sum_v2 as reduce_sum # line: 1480 +from tensorflow.python.ops.sparse_ops import sparse_reorder as reorder # line: 821 +from tensorflow.python.ops.sparse_ops import sparse_reset_shape as reset_shape # line: 2004 +from tensorflow.python.ops.sparse_ops import sparse_reshape as reshape # line: 876 +from tensorflow.python.ops.sparse_ops import sparse_retain as retain # line: 1957 +from tensorflow.python.ops.sparse_ops import sparse_slice as slice # line: 1136 +from tensorflow.python.ops.sparse_ops import sparse_softmax as softmax # line: 2671 +from tensorflow.python.ops.sparse_ops import sparse_tensor_dense_matmul as sparse_dense_matmul # line: 2430 +from tensorflow.python.ops.sparse_ops import sparse_split_v2 as split # line: 1067 +from tensorflow.python.ops.sparse_ops import sparse_tensor_to_dense as to_dense # line: 1681 +from tensorflow.python.ops.sparse_ops import sparse_to_indicator as to_indicator # line: 1737 +from tensorflow.python.ops.sparse_ops import sparse_transpose as transpose # line: 2824 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/strings/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/strings/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f7fd90a27f3293a73be560b9cde37aab2639f134 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/strings/__init__.py @@ -0,0 +1,33 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.strings namespace +""" + +import sys as _sys + +from tensorflow.python.ops.gen_string_ops import as_string # line: 29 +from tensorflow.python.ops.gen_string_ops import string_lower as lower # line: 1009 +from tensorflow.python.ops.gen_string_ops import string_strip as strip # line: 1429 +from tensorflow.python.ops.gen_string_ops import string_to_hash_bucket_fast as to_hash_bucket_fast # line: 1583 +from tensorflow.python.ops.gen_string_ops import string_to_hash_bucket_strong as to_hash_bucket_strong # line: 1688 +from tensorflow.python.ops.gen_string_ops import unicode_script # line: 2477 +from tensorflow.python.ops.gen_string_ops import unicode_transcode # line: 2578 +from tensorflow.python.ops.gen_string_ops import string_upper as upper # line: 1814 +from tensorflow.python.ops.ragged.ragged_string_ops import string_bytes_split as bytes_split # line: 40 +from tensorflow.python.ops.ragged.ragged_string_ops import ngrams # line: 672 +from tensorflow.python.ops.ragged.ragged_string_ops import string_split_v2 as split # line: 466 +from tensorflow.python.ops.ragged.ragged_string_ops import unicode_decode # line: 186 +from tensorflow.python.ops.ragged.ragged_string_ops import unicode_decode_with_offsets # line: 232 +from tensorflow.python.ops.ragged.ragged_string_ops import unicode_encode # line: 88 +from tensorflow.python.ops.ragged.ragged_string_ops import unicode_split # line: 294 +from tensorflow.python.ops.ragged.ragged_string_ops import unicode_split_with_offsets # line: 342 +from tensorflow.python.ops.string_ops import string_format as format # line: 115 +from tensorflow.python.ops.string_ops import string_join as join # line: 551 +from tensorflow.python.ops.string_ops import string_length_v2 as length # line: 412 +from tensorflow.python.ops.string_ops import reduce_join_v2 as reduce_join # line: 332 +from tensorflow.python.ops.string_ops import regex_full_match # line: 47 +from tensorflow.python.ops.string_ops import regex_replace # line: 74 +from tensorflow.python.ops.string_ops import substr_v2 as substr # line: 441 +from tensorflow.python.ops.string_ops import string_to_hash_bucket as to_hash_bucket # line: 505 +from tensorflow.python.ops.string_ops import string_to_number as to_number # line: 462 +from tensorflow.python.ops.string_ops import unsorted_segment_join # line: 586 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/summary/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/summary/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..de01d5f3f24c81c9796f3f487423101d9184197f --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/summary/__init__.py @@ -0,0 +1,19 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.summary namespace +""" + +import sys as _sys + +from tensorflow._api.v2.summary import experimental +from tensorflow.python.ops.summary_ops_v2 import SummaryWriter # line: 239 +from tensorflow.python.ops.summary_ops_v2 import create_file_writer_v2 as create_file_writer # line: 511 +from tensorflow.python.ops.summary_ops_v2 import create_noop_writer # line: 636 +from tensorflow.python.ops.summary_ops_v2 import flush # line: 1136 +from tensorflow.python.ops.summary_ops_v2 import graph # line: 1048 +from tensorflow.python.ops.summary_ops_v2 import record_if # line: 152 +from tensorflow.python.ops.summary_ops_v2 import should_record_summaries # line: 133 +from tensorflow.python.ops.summary_ops_v2 import trace_export # line: 1374 +from tensorflow.python.ops.summary_ops_v2 import trace_off # line: 1425 +from tensorflow.python.ops.summary_ops_v2 import trace_on # line: 1329 +from tensorflow.python.ops.summary_ops_v2 import write # line: 732 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/summary/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/summary/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d7152cb936f4610286a0acf0c4dccd669f0c7132 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/summary/experimental/__init__.py @@ -0,0 +1,11 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.summary.experimental namespace +""" + +import sys as _sys + +from tensorflow.python.ops.summary_ops_v2 import get_step # line: 209 +from tensorflow.python.ops.summary_ops_v2 import set_step # line: 220 +from tensorflow.python.ops.summary_ops_v2 import summary_scope # line: 691 +from tensorflow.python.ops.summary_ops_v2 import write_raw_pb # line: 809 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/sysconfig/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/sysconfig/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fa18e873703ecf78b4671ef9145116a150d51f08 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/sysconfig/__init__.py @@ -0,0 +1,15 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.sysconfig namespace +""" + +import sys as _sys + +from tensorflow.python.framework.versions import CXX11_ABI_FLAG # line: 48 +from tensorflow.python.framework.versions import CXX_VERSION # line: 54 +from tensorflow.python.framework.versions import MONOLITHIC_BUILD # line: 60 +from tensorflow.python.platform.sysconfig import get_build_info # line: 122 +from tensorflow.python.platform.sysconfig import get_compile_flags # line: 59 +from tensorflow.python.platform.sysconfig import get_include # line: 33 +from tensorflow.python.platform.sysconfig import get_lib # line: 48 +from tensorflow.python.platform.sysconfig import get_link_flags # line: 94 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/test/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/test/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..40010eba6dda7a54f69d0e00df806502278ebb77 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/test/__init__.py @@ -0,0 +1,23 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.test namespace +""" + +import sys as _sys + +from tensorflow._api.v2.test import experimental +from tensorflow.python.framework.test_util import TensorFlowTestCase as TestCase # line: 2504 +from tensorflow.python.framework.test_util import assert_equal_graph_def_v2 as assert_equal_graph_def # line: 205 +from tensorflow.python.framework.test_util import create_local_cluster # line: 3921 +from tensorflow.python.framework.test_util import gpu_device_name # line: 156 +from tensorflow.python.framework.test_util import is_gpu_available # line: 1989 +from tensorflow.python.framework.test_util import with_eager_op_as_function # line: 1219 +from tensorflow.python.ops.gradient_checker_v2 import compute_gradient # line: 295 +from tensorflow.python.platform.benchmark import TensorFlowBenchmark as Benchmark # line: 287 +from tensorflow.python.platform.benchmark import benchmark_config # line: 274 +from tensorflow.python.platform.test import disable_with_predicate # line: 131 +from tensorflow.python.platform.test import is_built_with_cuda # line: 89 +from tensorflow.python.platform.test import is_built_with_gpu_support # line: 149 +from tensorflow.python.platform.test import is_built_with_rocm # line: 110 +from tensorflow.python.platform.test import is_built_with_xla # line: 170 +from tensorflow.python.platform.test import main # line: 49 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/test/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/test/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ff027d362fbd63221354d71b6ea76dff623f107d --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/test/experimental/__init__.py @@ -0,0 +1,8 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.test.experimental namespace +""" + +import sys as _sys + +from tensorflow.python.framework.test_util import sync_devices # line: 4146 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/tpu/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/tpu/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..23b9bf300f5d8f51e2599a18496efe0deb5c0aa8 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/tpu/__init__.py @@ -0,0 +1,9 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.tpu namespace +""" + +import sys as _sys + +from tensorflow._api.v2.tpu import experimental +from tensorflow.python.tpu.tpu import XLAOptions # line: 230 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/tpu/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/tpu/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..411a4cadba30ceccc512dbe1125a815db75de271 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/tpu/experimental/__init__.py @@ -0,0 +1,15 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.tpu.experimental namespace +""" + +import sys as _sys + +from tensorflow._api.v2.tpu.experimental import embedding +from tensorflow.python.distribute.cluster_resolver.tpu_cluster_resolver import initialize_tpu_system # line: 25 +from tensorflow.python.distribute.cluster_resolver.tpu_cluster_resolver import shutdown_tpu_system # line: 26 +from tensorflow.python.tpu.device_assignment import DeviceAssignment # line: 68 +from tensorflow.python.tpu.device_assignment import DeviceOrderMode # line: 56 +from tensorflow.python.tpu.topology import Topology # line: 39 +from tensorflow.python.tpu.tpu_hardware_feature import HardwareFeature # line: 21 +from tensorflow.python.tpu.tpu_system_metadata import TPUSystemMetadata # line: 40 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/tpu/experimental/embedding/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/tpu/experimental/embedding/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9e0c85f7996d7881327306a678031b4ebffdda6f --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/tpu/experimental/embedding/__init__.py @@ -0,0 +1,19 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.tpu.experimental.embedding namespace +""" + +import sys as _sys + +from tensorflow.python.tpu.tpu_embedding_for_serving import TPUEmbeddingForServing # line: 42 +from tensorflow.python.tpu.tpu_embedding_for_serving import cpu_embedding_lookup as serving_embedding_lookup # line: 335 +from tensorflow.python.tpu.tpu_embedding_v1 import TPUEmbeddingV0 # line: 38 +from tensorflow.python.tpu.tpu_embedding_v2 import TPUEmbedding # line: 75 +from tensorflow.python.tpu.tpu_embedding_v2_utils import Adagrad # line: 302 +from tensorflow.python.tpu.tpu_embedding_v2_utils import AdagradMomentum # line: 431 +from tensorflow.python.tpu.tpu_embedding_v2_utils import Adam # line: 752 +from tensorflow.python.tpu.tpu_embedding_v2_utils import FTRL # line: 578 +from tensorflow.python.tpu.tpu_embedding_v2_utils import FeatureConfig # line: 1161 +from tensorflow.python.tpu.tpu_embedding_v2_utils import QuantizationConfig # line: 920 +from tensorflow.python.tpu.tpu_embedding_v2_utils import SGD # line: 186 +from tensorflow.python.tpu.tpu_embedding_v2_utils import TableConfig # line: 984 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/train/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/train/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..04955ac4df55e9b1d83907c69ee15559f55a37e6 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/train/__init__.py @@ -0,0 +1,34 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.train namespace +""" + +import sys as _sys + +from tensorflow._api.v2.train import experimental +from tensorflow.python.checkpoint.checkpoint import Checkpoint # line: 2035 +from tensorflow.python.checkpoint.checkpoint_management import CheckpointManager # line: 518 +from tensorflow.python.checkpoint.checkpoint_management import get_checkpoint_state # line: 250 +from tensorflow.python.checkpoint.checkpoint_management import latest_checkpoint # line: 328 +from tensorflow.python.checkpoint.checkpoint_options import CheckpointOptions # line: 24 +from tensorflow.python.checkpoint.checkpoint_view import CheckpointView # line: 28 +from tensorflow.python.checkpoint.trackable_view import TrackableView # line: 25 +from tensorflow.python.training.checkpoint_utils import checkpoints_iterator # line: 181 +from tensorflow.python.training.checkpoint_utils import list_variables # line: 117 +from tensorflow.python.training.checkpoint_utils import load_checkpoint # line: 46 +from tensorflow.python.training.checkpoint_utils import load_variable # line: 83 +from tensorflow.python.training.coordinator import Coordinator # line: 27 +from tensorflow.python.training.moving_averages import ExponentialMovingAverage # line: 283 +from tensorflow.python.training.server_lib import ClusterSpec # line: 242 +from tensorflow.python.training.training import BytesList # line: 131 +from tensorflow.python.training.training import ClusterDef # line: 132 +from tensorflow.python.training.training import Example # line: 133 +from tensorflow.python.training.training import Feature # line: 134 +from tensorflow.python.training.training import FeatureList # line: 136 +from tensorflow.python.training.training import FeatureLists # line: 137 +from tensorflow.python.training.training import Features # line: 135 +from tensorflow.python.training.training import FloatList # line: 138 +from tensorflow.python.training.training import Int64List # line: 139 +from tensorflow.python.training.training import JobDef # line: 140 +from tensorflow.python.training.training import SequenceExample # line: 142 +from tensorflow.python.training.training import ServerDef # line: 143 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/train/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/train/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5a31469418cf82e8e03dd3ad573af2056b35ec72 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/train/experimental/__init__.py @@ -0,0 +1,8 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.train.experimental namespace +""" + +import sys as _sys + +from tensorflow.python.trackable.python_state import PythonState # line: 28 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/types/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/types/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1e607f10ec1721672fabee801d4540d1316f87ac --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/types/__init__.py @@ -0,0 +1,8 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.types namespace +""" + +import sys as _sys + +from tensorflow._api.v2.types import experimental diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/types/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/types/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..521eb948ad962969524ddc1db480ae8c21ff5c8f --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/types/experimental/__init__.py @@ -0,0 +1,17 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.types.experimental namespace +""" + +import sys as _sys + +from tensorflow._api.v2.types.experimental import distributed +from tensorflow.python.types.core import AtomicFunction # line: 143 +from tensorflow.python.types.core import Callable # line: 112 +from tensorflow.python.types.core import ConcreteFunction # line: 170 +from tensorflow.python.types.core import FunctionType # line: 91 +from tensorflow.python.types.core import PolymorphicFunction as GenericFunction # line: 187 +from tensorflow.python.types.core import PolymorphicFunction # line: 187 +from tensorflow.python.types.core import TensorLike # line: 419 +from tensorflow.python.types.trace import SupportsTracingProtocol # line: 307 +from tensorflow.python.types.trace import TraceType # line: 39 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/types/experimental/distributed/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/types/experimental/distributed/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1db2dff92629c06b05e0a4dc3472003807513696 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/types/experimental/distributed/__init__.py @@ -0,0 +1,9 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.types.experimental.distributed namespace +""" + +import sys as _sys + +from tensorflow.python.types.distribute import Mirrored # line: 182 +from tensorflow.python.types.distribute import PerReplica # line: 169 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/version/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/version/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d494fbe6c828c9f311a543b9882150ad2ab33672 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/version/__init__.py @@ -0,0 +1,13 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.version namespace +""" + +import sys as _sys + +from tensorflow.python.framework.versions import COMPILER_VERSION # line: 41 +from tensorflow.python.framework.versions import GIT_VERSION # line: 35 +from tensorflow.python.framework.versions import GRAPH_DEF_VERSION # line: 68 +from tensorflow.python.framework.versions import GRAPH_DEF_VERSION_MIN_CONSUMER # line: 74 +from tensorflow.python.framework.versions import GRAPH_DEF_VERSION_MIN_PRODUCER # line: 82 +from tensorflow.python.framework.versions import VERSION # line: 29 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/xla/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/xla/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..52f1fa3a290adc5ca0f10a9815de46ff9d40a710 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/xla/__init__.py @@ -0,0 +1,8 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.xla namespace +""" + +import sys as _sys + +from tensorflow._api.v2.xla import experimental diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/xla/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/xla/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f2c1148ed178739e4a069fc1d4ef5696ec5d8841 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/_api/v2/xla/experimental/__init__.py @@ -0,0 +1,9 @@ +# This file is MACHINE GENERATED! Do not edit. +# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script. +"""Public API for tf._api.v2.xla.experimental namespace +""" + +import sys as _sys + +from tensorflow.python.compiler.xla.jit import experimental_jit_scope as jit_scope # line: 37 +from tensorflow.python.compiler.xla.xla import compile # line: 62 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/jit/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/jit/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/jit/ops/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/jit/ops/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/jit/ops/xla_ops.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/jit/ops/xla_ops.py new file mode 100644 index 0000000000000000000000000000000000000000..0b488c088f1240a636dc3cb34da3acedf5731844 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/jit/ops/xla_ops.py @@ -0,0 +1,352 @@ +"""Python wrappers around TensorFlow ops. + +This file is MACHINE GENERATED! Do not edit. +""" + +import collections + +from tensorflow.python import pywrap_tfe as pywrap_tfe +from tensorflow.python.eager import context as _context +from tensorflow.python.eager import core as _core +from tensorflow.python.eager import execute as _execute +from tensorflow.python.framework import dtypes as _dtypes +from tensorflow.security.fuzzing.py import annotation_types as _atypes + +from tensorflow.python.framework import op_def_registry as _op_def_registry +from tensorflow.python.framework import ops as _ops +from tensorflow.python.framework import op_def_library as _op_def_library +from tensorflow.python.util.deprecation import deprecated_endpoints +from tensorflow.python.util import dispatch as _dispatch +from tensorflow.python.util.tf_export import tf_export + +from typing import TypeVar, List, Any +from typing_extensions import Annotated + +TV_XlaClusterOutput_T = TypeVar("TV_XlaClusterOutput_T", _atypes.BFloat16, _atypes.Bool, _atypes.Complex128, _atypes.Complex64, _atypes.Float16, _atypes.Float32, _atypes.Float64, _atypes.Float8e4m3fn, _atypes.Float8e5m2, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int4, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.Resource, _atypes.String, _atypes.UInt16, _atypes.UInt32, _atypes.UInt4, _atypes.UInt64, _atypes.UInt8, _atypes.Variant) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_cluster_output') +def xla_cluster_output(input: Annotated[Any, TV_XlaClusterOutput_T], name=None) -> Annotated[Any, TV_XlaClusterOutput_T]: + r"""Operator that connects the output of an XLA computation to other consumer graph nodes. + + Args: + input: A `Tensor`. + name: A name for the operation (optional). + + Returns: + A `Tensor`. Has the same type as `input`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaClusterOutput", name, input) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_cluster_output( + (input, name,), None) + if _result is not NotImplemented: + return _result + return xla_cluster_output_eager_fallback( + input, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_cluster_output, (), dict(input=input, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_cluster_output( + (input, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaClusterOutput", input=input, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_cluster_output, (), dict(input=input, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("T", _op._get_attr_type("T")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaClusterOutput", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +XlaClusterOutput = tf_export("raw_ops.XlaClusterOutput")(_ops.to_raw_op(xla_cluster_output)) +_dispatcher_for_xla_cluster_output = xla_cluster_output._tf_type_based_dispatcher.Dispatch + + +def xla_cluster_output_eager_fallback(input: Annotated[Any, TV_XlaClusterOutput_T], name, ctx) -> Annotated[Any, TV_XlaClusterOutput_T]: + _attr_T, (input,) = _execute.args_to_matching_eager([input], ctx, []) + _inputs_flat = [input] + _attrs = ("T", _attr_T) + _result = _execute.execute(b"XlaClusterOutput", 1, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaClusterOutput", _inputs_flat, _attrs, _result) + _result, = _result + return _result + + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_launch') +def xla_launch(constants, args, resources: Annotated[List[Any], _atypes.Resource], Tresults, function, name=None): + r"""XLA Launch Op. For use by the XLA JIT only. + + Args: + constants: A list of `Tensor` objects. + args: A list of `Tensor` objects. + resources: A list of `Tensor` objects with type `resource`. + Tresults: A list of `tf.DTypes`. + function: A function decorated with @Defun. + name: A name for the operation (optional). + + Returns: + A list of `Tensor` objects of type `Tresults`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaLaunch", name, constants, args, resources, "Tresults", + Tresults, "function", function) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_launch( + (constants, args, resources, Tresults, function, name,), None) + if _result is not NotImplemented: + return _result + return xla_launch_eager_fallback( + constants, args, resources, Tresults=Tresults, function=function, + name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_launch, (), dict(constants=constants, args=args, + resources=resources, Tresults=Tresults, + function=function, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_launch( + (constants, args, resources, Tresults, function, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + if not isinstance(resources, (list, tuple)): + raise TypeError( + "Expected list for 'resources' argument to " + "'xla_launch' Op, not %r." % resources) + _attr_Nresources = len(resources) + if not isinstance(Tresults, (list, tuple)): + raise TypeError( + "Expected list for 'Tresults' argument to " + "'xla_launch' Op, not %r." % Tresults) + Tresults = [_execute.make_type(_t, "Tresults") for _t in Tresults] + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaLaunch", constants=constants, args=args, resources=resources, + Tresults=Tresults, function=function, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_launch, (), dict(constants=constants, args=args, + resources=resources, Tresults=Tresults, + function=function, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if not _result: + return _op + if _execute.must_record_gradient(): + _attrs = ("Tconstants", _op.get_attr("Tconstants"), "Targs", + _op.get_attr("Targs"), "Nresources", + _op._get_attr_int("Nresources"), "Tresults", + _op.get_attr("Tresults"), "function", _op.get_attr("function")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaLaunch", _inputs_flat, _attrs, _result) + return _result + +XlaLaunch = tf_export("raw_ops.XlaLaunch")(_ops.to_raw_op(xla_launch)) +_dispatcher_for_xla_launch = xla_launch._tf_type_based_dispatcher.Dispatch + + +def xla_launch_eager_fallback(constants, args, resources: Annotated[List[Any], _atypes.Resource], Tresults, function, name, ctx): + if not isinstance(resources, (list, tuple)): + raise TypeError( + "Expected list for 'resources' argument to " + "'xla_launch' Op, not %r." % resources) + _attr_Nresources = len(resources) + if not isinstance(Tresults, (list, tuple)): + raise TypeError( + "Expected list for 'Tresults' argument to " + "'xla_launch' Op, not %r." % Tresults) + Tresults = [_execute.make_type(_t, "Tresults") for _t in Tresults] + _attr_Tconstants, constants = _execute.convert_to_mixed_eager_tensors(constants, ctx) + _attr_Targs, args = _execute.convert_to_mixed_eager_tensors(args, ctx) + resources = _ops.convert_n_to_tensor(resources, _dtypes.resource) + _inputs_flat = list(constants) + list(args) + list(resources) + _attrs = ("Tconstants", _attr_Tconstants, "Targs", _attr_Targs, + "Nresources", _attr_Nresources, "Tresults", Tresults, "function", function) + _result = _execute.execute(b"XlaLaunch", len(Tresults), inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaLaunch", _inputs_flat, _attrs, _result) + return _result + + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_launch_v2') +def xla_launch_v2(args, Tresults, constants, resources, function, name=None): + r"""XLA Launch Op. For use by the XLA JIT only. + + Args: + args: A list of `Tensor` objects. + Tresults: A list of `tf.DTypes`. + constants: A list of `ints`. + resources: A list of `ints`. + function: A function decorated with @Defun. + name: A name for the operation (optional). + + Returns: + A list of `Tensor` objects of type `Tresults`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaLaunchV2", name, args, "Tresults", Tresults, "constants", + constants, "resources", resources, "function", function) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_launch_v2( + (args, Tresults, constants, resources, function, name,), None) + if _result is not NotImplemented: + return _result + return xla_launch_v2_eager_fallback( + args, Tresults=Tresults, constants=constants, resources=resources, + function=function, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_launch_v2, (), dict(args=args, Tresults=Tresults, + constants=constants, resources=resources, + function=function, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_launch_v2( + (args, Tresults, constants, resources, function, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + if not isinstance(Tresults, (list, tuple)): + raise TypeError( + "Expected list for 'Tresults' argument to " + "'xla_launch_v2' Op, not %r." % Tresults) + Tresults = [_execute.make_type(_t, "Tresults") for _t in Tresults] + if not isinstance(constants, (list, tuple)): + raise TypeError( + "Expected list for 'constants' argument to " + "'xla_launch_v2' Op, not %r." % constants) + constants = [_execute.make_int(_i, "constants") for _i in constants] + if not isinstance(resources, (list, tuple)): + raise TypeError( + "Expected list for 'resources' argument to " + "'xla_launch_v2' Op, not %r." % resources) + resources = [_execute.make_int(_i, "resources") for _i in resources] + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaLaunchV2", args=args, Tresults=Tresults, constants=constants, + resources=resources, function=function, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_launch_v2, (), dict(args=args, Tresults=Tresults, + constants=constants, resources=resources, + function=function, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("Targs", _op.get_attr("Targs"), "Tresults", + _op.get_attr("Tresults"), "constants", + _op.get_attr("constants"), "resources", + _op.get_attr("resources"), "function", _op.get_attr("function")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaLaunchV2", _inputs_flat, _attrs, _result) + return _result + +XlaLaunchV2 = tf_export("raw_ops.XlaLaunchV2")(_ops.to_raw_op(xla_launch_v2)) +_dispatcher_for_xla_launch_v2 = xla_launch_v2._tf_type_based_dispatcher.Dispatch + + +def xla_launch_v2_eager_fallback(args, Tresults, constants, resources, function, name, ctx): + if not isinstance(Tresults, (list, tuple)): + raise TypeError( + "Expected list for 'Tresults' argument to " + "'xla_launch_v2' Op, not %r." % Tresults) + Tresults = [_execute.make_type(_t, "Tresults") for _t in Tresults] + if not isinstance(constants, (list, tuple)): + raise TypeError( + "Expected list for 'constants' argument to " + "'xla_launch_v2' Op, not %r." % constants) + constants = [_execute.make_int(_i, "constants") for _i in constants] + if not isinstance(resources, (list, tuple)): + raise TypeError( + "Expected list for 'resources' argument to " + "'xla_launch_v2' Op, not %r." % resources) + resources = [_execute.make_int(_i, "resources") for _i in resources] + _attr_Targs, args = _execute.convert_to_mixed_eager_tensors(args, ctx) + _inputs_flat = list(args) + _attrs = ("Targs", _attr_Targs, "Tresults", Tresults, "constants", + constants, "resources", resources, "function", function) + _result = _execute.execute(b"XlaLaunchV2", len(Tresults), + inputs=_inputs_flat, attrs=_attrs, ctx=ctx, + name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaLaunchV2", _inputs_flat, _attrs, _result) + return _result + diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/jit/ops/xla_ops_grad.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/jit/ops/xla_ops_grad.py new file mode 100644 index 0000000000000000000000000000000000000000..cca48e48df59e39a176902024ab0e09c8aa9e86c --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/jit/ops/xla_ops_grad.py @@ -0,0 +1,25 @@ +"""Gradients for XLA ops.""" +# 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. +# ============================================================================== + +from tensorflow.python.framework import ops + + +@ops.RegisterGradient("XlaClusterOutput") +def _XlaClusterOutputGrad(_, grad): + del grad # unused + raise RuntimeError("Gradient computation of graph in xla.compile() is " + "prohibited because it can cause performance degradation." + "Please move gradient computation inside xla.compile().") diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/lite/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/lite/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/lite/debug/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/lite/debug/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/lite/debug/debug_options_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/lite/debug/debug_options_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..4a29dd87fb83f061142402fd48acbe389ec3e674 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/lite/debug/debug_options_pb2.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/compiler/mlir/lite/debug/debug_options.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n7tensorflow/compiler/mlir/lite/debug/debug_options.proto\x12\x14tensorflow.converter\"\xa3\x02\n\x0c\x44\x65\x62ugOptions\x12\x17\n\rmlir_dump_dir\x18\x01 \x01(\t:\x00\x12 \n\x14mlir_dump_pass_regex\x18\x02 \x01(\t:\x02.*\x12 \n\x14mlir_dump_func_regex\x18\x03 \x01(\t:\x02.*\x12!\n\x12mlir_enable_timing\x18\x04 \x01(\x08:\x05\x66\x61lse\x12\x1e\n\x14mlir_print_ir_before\x18\x05 \x01(\t:\x00\x12\x1d\n\x13mlir_print_ir_after\x18\x06 \x01(\t:\x00\x12(\n\x1amlir_print_ir_module_scope\x18\x07 \x01(\x08:\x04true\x12*\n\"mlir_elide_elementsattrs_if_larger\x18\x08 \x01(\x03') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.compiler.mlir.lite.debug.debug_options_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + _DEBUGOPTIONS._serialized_start=82 + _DEBUGOPTIONS._serialized_end=373 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/stablehlo/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/stablehlo/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/stablehlo/quantization_options_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/stablehlo/quantization_options_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..e108e96ca0887457e073825d5d1b58ab60e8f3b6 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/stablehlo/quantization_options_pb2.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/compiler/mlir/quantization/stablehlo/quantization_options.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\nJtensorflow/compiler/mlir/quantization/stablehlo/quantization_options.proto\x12\x16stablehlo.quantization\"^\n\x13QuantizationOptions\x12G\n\x13quantization_method\x18\x01 \x01(\x0b\x32*.stablehlo.quantization.QuantizationMethod\"\xdb\x01\n\x12QuantizationMethod\x12V\n\x1apreset_quantization_method\x18\x01 \x01(\x0b\x32\x30.stablehlo.quantization.PresetQuantizationMethodH\x00\x12V\n\x1a\x63ustom_quantization_method\x18\x02 \x01(\x0b\x32\x30.stablehlo.quantization.CustomQuantizationMethodH\x00\x42\x15\n\x13quantization_method\"\x92\x02\n\x18PresetQuantizationMethod\x12T\n\rpreset_method\x18\x01 \x01(\x0e\x32=.stablehlo.quantization.PresetQuantizationMethod.PresetMethod\"\x9f\x01\n\x0cPresetMethod\x12\x16\n\x12METHOD_UNSPECIFIED\x10\x00\x12\x0f\n\x0bWEIGHT_ONLY\x10\x01\x12,\n(POST_TRAINING_QUANTIZATION_DYNAMIC_RANGE\x10\x02\x12\x0b\n\x07\x46LOAT16\x10\x03\x12+\n\'POST_TRAINING_QUANTIZATION_STATIC_RANGE\x10\x04\"r\n\x18\x43ustomQuantizationMethod\x12V\n\x1bquantization_component_spec\x18\x01 \x03(\x0b\x32\x31.stablehlo.quantization.QuantizationComponentSpec\"\xc5\x05\n\x19QuantizationComponentSpec\x12g\n\x16quantization_component\x18\x01 \x01(\x0e\x32G.stablehlo.quantization.QuantizationComponentSpec.QuantizationComponent\x12M\n\tbit_width\x18\x02 \x01(\x0e\x32:.stablehlo.quantization.QuantizationComponentSpec.BitWidth\x12K\n\x08\x62it_type\x18\x03 \x01(\x0e\x32\x39.stablehlo.quantization.QuantizationComponentSpec.BitType\x12\x1b\n\x13\x65nable_narrow_range\x18\x04 \x01(\x08\x12\'\n\x1f\x65nable_per_channel_quantization\x18\x05 \x01(\x08\x12\x18\n\x10\x65nable_symmetric\x18\x06 \x01(\x08\"v\n\x15QuantizationComponent\x12\x19\n\x15\x43OMPONENT_UNSPECIFIED\x10\x00\x12\x18\n\x14\x43OMPONENT_ACTIVATION\x10\x01\x12\x14\n\x10\x43OMPONENT_WEIGHT\x10\x02\x12\x12\n\x0e\x43OMPONENT_BIAS\x10\x03\"k\n\x08\x42itWidth\x12\x19\n\x15\x42IT_WIDTH_UNSPECIFIED\x10\x00\x12\x0f\n\x0b\x42IT_WIDTH_4\x10\x01\x12\x0f\n\x0b\x42IT_WIDTH_8\x10\x02\x12\x10\n\x0c\x42IT_WIDTH_16\x10\x03\x12\x10\n\x0c\x42IT_WIDTH_32\x10\x04\"^\n\x07\x42itType\x12\x18\n\x14\x42IT_TYPE_UNSPECIFIED\x10\x00\x12\x10\n\x0c\x42IT_TYPE_INT\x10\x01\x12\x12\n\x0e\x42IT_TYPE_FLOAT\x10\x02\x12\x13\n\x0f\x42IT_TYPE_BFLOAT\x10\x03\x42\x03\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.compiler.mlir.quantization.stablehlo.quantization_options_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\370\001\001' + _QUANTIZATIONOPTIONS._serialized_start=102 + _QUANTIZATIONOPTIONS._serialized_end=196 + _QUANTIZATIONMETHOD._serialized_start=199 + _QUANTIZATIONMETHOD._serialized_end=418 + _PRESETQUANTIZATIONMETHOD._serialized_start=421 + _PRESETQUANTIZATIONMETHOD._serialized_end=695 + _PRESETQUANTIZATIONMETHOD_PRESETMETHOD._serialized_start=536 + _PRESETQUANTIZATIONMETHOD_PRESETMETHOD._serialized_end=695 + _CUSTOMQUANTIZATIONMETHOD._serialized_start=697 + _CUSTOMQUANTIZATIONMETHOD._serialized_end=811 + _QUANTIZATIONCOMPONENTSPEC._serialized_start=814 + _QUANTIZATIONCOMPONENTSPEC._serialized_end=1523 + _QUANTIZATIONCOMPONENTSPEC_QUANTIZATIONCOMPONENT._serialized_start=1200 + _QUANTIZATIONCOMPONENTSPEC_QUANTIZATIONCOMPONENT._serialized_end=1318 + _QUANTIZATIONCOMPONENTSPEC_BITWIDTH._serialized_start=1320 + _QUANTIZATIONCOMPONENTSPEC_BITWIDTH._serialized_end=1427 + _QUANTIZATIONCOMPONENTSPEC_BITTYPE._serialized_start=1429 + _QUANTIZATIONCOMPONENTSPEC_BITTYPE._serialized_end=1523 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/calibrator/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/calibrator/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/calibrator/calibration_algorithm.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/calibrator/calibration_algorithm.py new file mode 100644 index 0000000000000000000000000000000000000000..af472e76cbe1ec2031d967c0d975e2e6122a35e1 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/calibrator/calibration_algorithm.py @@ -0,0 +1,393 @@ +# Copyright 2023 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. +# ============================================================================== +"""Defines CalibrationAlgorithm for calculating min and max values calculated by calibration method.""" +import abc +import itertools +import logging + +import numpy as np + +from tensorflow.compiler.mlir.quantization.tensorflow import quantization_options_pb2 as quant_opts_pb2 +from tensorflow.compiler.mlir.quantization.tensorflow.calibrator import calibration_statistics_pb2 as calib_stats_pb2 + + +_CalibrationMethod = quant_opts_pb2.CalibrationOptions.CalibrationMethod +_REGISTRY = {} + + +def _implements(calib_method: _CalibrationMethod): + def decorator(cls): + assert calib_method not in _REGISTRY + _REGISTRY[calib_method] = cls + return cls + + return decorator + + +class _CalibrationAlgorithmBase(abc.ABC): + """Abstract base class for calibration algorithm.""" + + def __init__( + self, + statistics: calib_stats_pb2.CalibrationStatistics, + calib_opts: quant_opts_pb2.CalibrationOptions, + ): + self._statistics = statistics + self._calib_opts = calib_opts + + @abc.abstractmethod + def get_min_max_value(self) -> tuple[float, float]: + pass + + +class _HistogramCalibrationAlgorithmBase(_CalibrationAlgorithmBase): + """Base class for histogram calibrators.""" + + def __init__( + self, + statistics: calib_stats_pb2.CalibrationStatistics, + calib_opts: quant_opts_pb2.CalibrationOptions, + ): + """Builds histogram using statistics.histogram_statistics. + + lower_bound hist_mid + v v + |=========|=========|=========|=========|=========| + bin width + + Args: + statistics: Collected calibration statistics. + calib_opts: Calibration options used for calculating min and max. + """ + super().__init__(statistics, calib_opts) + hist_stats = statistics.histogram_statistics + self._bin_width = hist_stats.bin_width + self._lower_bound = hist_stats.lower_bound + self._hist_freq = np.array(hist_stats.hist_freq) + self._num_bins = len(self._hist_freq) + self._num_bits = 8 + # i-th bin has a range [bins[i], bins[i + 1]). + # bins[i] = lower_bound + i * bin_width + # bins[i + 1] = lower_bound + (i + 1) * bin_width + # So hist_mids[i] = (lower_bound + bin_width / 2) + bin_width * i + first_mid = self._lower_bound + self._bin_width / 2 + last_mid = first_mid + (self._num_bins - 1) * self._bin_width + self._hist_mids = np.linspace(first_mid, last_mid, self._num_bins) + + def _get_dequantized_hist_mids_after_quantize( + self, quant_min: float, quant_max: float + ) -> np.ndarray: + """Quantizes and dequantizes hist_mids using quant_min and quant_max. + + Quantization converts the range of numbers from [quant_min, quant_max] to + [0, 2^num_bits - 1]. Values less than quant_min are converted to 0, and + values greater than quant_max are converted to 2^num_bits - 1. + + The histogram represents the distribution of the data, and our goal is to + find the quant_min and quant_max that best describe this distribution. To do + this, we quantize hist_mids using quant_min and quant_max and dequantize + them again. Then the difference between hist_mids and dequantized hist_mids + equates to quantization error when using quant_min and quant_max. + + + Args: + quant_min: The minimum real value that can be represented by a quantized + value. + quant_max: The maximum real value that can be represented by a quantized + value. + + Returns: + dequantized hist_mids after quantizing by quant_min and quant_max + """ + maxbound = 2**self._num_bits - 1 + minbound = 0 + scale = (quant_max - quant_min) / maxbound + zero_point = -quant_min / scale + + # Limit the range of zero_point and scale in case (quant_max - quant_min) + # is unusually small. + if abs(zero_point) > 9e9: + zero_point = 9e9 + if abs(scale) < 1e-9: + scale = 1e-9 + + zero_point = round(zero_point) + quantized_hist_mids = np.clip( + np.round(self._hist_mids / scale) + zero_point, minbound, maxbound + ) + dequantized_hist_mids = scale * (quantized_hist_mids - zero_point) + return dequantized_hist_mids + + def _get_weighted_mean_squared_error( + self, quant_min, quant_max + ) -> tuple[float, float, float]: + """Gets mean squared error between hist_mids and dequantized hist_mids. + + Quantization converts the range of numbers from [quant_min, quant_max] to + [0, 2^num_bits - 1]. Values less than quant_min are converted to 0, and + values greater than quant_max are converted to 2^num_bits - 1. + + Args: + quant_min: The minimum real value that can be represented by a quantized + value. + quant_max: The maximum real value that can be represented by a quantized + value. + + Returns: + (error, quant_min, quant_max): Tuple of weighted mean squared error. + error = (hist_mids - dequantized_hist_mids)**2 * hist_freq + """ + dequantized_hist_mids = self._get_dequantized_hist_mids_after_quantize( + quant_min, quant_max + ) + squared_error = (self._hist_mids - dequantized_hist_mids) ** 2 + weighted_error = np.sum(squared_error * self._hist_freq) + return (weighted_error, quant_min, quant_max) + + def _get_min_max_value_by_expanding_range( + self, start_idx: int + ) -> tuple[float, float]: + """Starting from start_idx, expand left and right alternately to find the min value of mse loss. + + Args: + start_idx: Index to start quantization. + + Returns: + (min_value, max_value): Min and max calculated. + """ + # Tuple of (mse_error, quant_min, quant_max). + mse_min = (float('inf'), float('inf'), float('inf')) + left, right = start_idx, start_idx + + # If this value is true, it moves left, otherwise it moves right. + move_left = True + while not (left == 0 and right == self._num_bins - 1): + # Decrease left if right can't be moved or move_left is true. + if (move_left and left > 0) or (right == self._num_bins - 1): + left = max(left - 1, 0) + # Else increase right. + else: + right = min(right + 1, self._num_bins - 1) + # Toogle the move_left. + move_left = not move_left + quant_min, quant_max = self._hist_mids[left], self._hist_mids[right] + mse_tuple = self._get_weighted_mean_squared_error(quant_min, quant_max) + mse_min = min(mse_tuple, mse_min) + # Extract (quant_min, quant_max) from (mse_error, quant_min, quant_max). + min_value, max_value = mse_min[1], mse_min[2] + return min_value, max_value + + +@_implements(_CalibrationMethod.CALIBRATION_METHOD_MIN_MAX) +class _MinMax(_CalibrationAlgorithmBase): + """MinMaxCalibrationAlgorithm for calculating min and max values of calibration result. + + MinMax calibration calculates the global min and global max values. + + global min = min of given sample inputs + global max = max of given sample inputs + """ + + def get_min_max_value(self) -> tuple[float, float]: + """Calculates the global min and max values. + + Returns: + (min_value, max_value): Min and max calculated using MinMax + """ + return ( + self._statistics.min_max_statistics.global_min, + self._statistics.min_max_statistics.global_max, + ) + + +@_implements(_CalibrationMethod.CALIBRATION_METHOD_AVERAGE_MIN_MAX) +class _AverageMinMax(_CalibrationAlgorithmBase): + """AverageMinMaxCalibrationAlgorithm for calculating min and max values of calibration result. + + AverageMinMax calibration calculates the average of min and max values. + average of min = sum of min values / number of samples + average of max = sum of max values / number of samples + """ + + def get_min_max_value(self) -> tuple[float, float]: + """Calculates the average of min and max values. + + Returns: + (min_value, max_value): Min and max calculated using AverageMinMax + + Raises: + ValueError: num_samples is 0. + """ + average_min_max_statistics = self._statistics.average_min_max_statistics + # num_samples is guaranteed to be larger than 0 because + # get_statistics_from_calibrator throws an exception if num_samples == 0. + num_samples = average_min_max_statistics.num_samples + if num_samples == 0: + raise ValueError( + 'num_samples must not be 0 when calibration method is' + f' AverageMinMax: {self._calib_opts}' + ) + min_value, max_value = ( + average_min_max_statistics.min_sum / num_samples, + average_min_max_statistics.max_sum / num_samples, + ) + + return min_value, max_value + + +@_implements(_CalibrationMethod.CALIBRATION_METHOD_HISTOGRAM_PERCENTILE) +class _HistogramPercentile(_HistogramCalibrationAlgorithmBase): + """HistogramPercentile for calculating min and max values of calibration result.""" + + def get_min_max_value(self) -> tuple[float, float]: + """Calculates min and max from statistics using calibration options. + + A "percentile" is a statistical concept that represents the value below + which a given percentage of data falls in a dataset. It involves sorting the + data from smallest to largest and then finding the value at a specified + percentage position. For example, the 0.01 percentile represents the value + in a given data set that corresponds to the lowest 0.01% of the data. + + HistogramPercentile calibration uses min_percentile and max_percentile to + find min and max. + + min_percentile and max_percentile must be in range [0, 100]. + min_percentile is 0.001 by default. + max_percentile is 99.999 by default. + + Returns: + (min_value, max_value): Min and max calculated using HistogramPercentile + """ + total_freq = sum(self._hist_freq) + # hist_freq_cumsum is dividing cumulative sum of hist_freq by total_freq + # hist_freq_cumsum's value is in range [0, 1] by its definition + hist_freq_cumsum = np.cumsum(self._hist_freq) / total_freq + + # min_percentile and max_percentile are converted from [0, 100] to [0, 1]. + min_quantile, max_quantile = ( + self._calib_opts.calibration_parameters.min_percentile / 100.0, + self._calib_opts.calibration_parameters.max_percentile / 100.0, + ) + + # Get index of min/max quantile. + min_quantile_idx, max_quantile_idx = ( + np.searchsorted(hist_freq_cumsum, min_quantile, side='right'), + np.searchsorted(hist_freq_cumsum, max_quantile, side='left'), + ) + + # Get value of min/max quantile index. + min_value, max_value = ( + self._hist_mids[min_quantile_idx], + self._hist_mids[max_quantile_idx], + ) + + return min_value, max_value + + +@_implements(_CalibrationMethod.CALIBRATION_METHOD_HISTOGRAM_MSE_BRUTEFORCE) +class _HistogramMseBruteforce(_HistogramCalibrationAlgorithmBase): + """HistogramMseBruteforce for calculating min and max values of calibration result.""" + + def get_min_max_value(self) -> tuple[float, float]: + """Finds the optimal quant_min and quant_max by testing all possible cases. + + It guarantees optimal quant_min and quant_max for the representative + dataset, but not for the test dataset. + + Returns: + (min_value, max_value): Min and max calculated using + HistogramMseBruteforce. + """ + if self._num_bins > 512: + logging.warning( + 'num_bins=%d is too large. The HISTOGRAM_MSE_BRUTEFORCE method tests' + ' all histogram mid value pairs, so it may take a long time.', + self._num_bins, + ) + # Tuple of (mse_error, quant_min, quant_max). + mse_min = (float('inf'), float('inf'), float('inf')) + + # Calculate the error for all hist_mid pairs. + for left, right in itertools.combinations(range(self._num_bins), 2): + quant_min, quant_max = self._hist_mids[left], self._hist_mids[right] + mse_tuple = self._get_weighted_mean_squared_error(quant_min, quant_max) + mse_min = min(mse_tuple, mse_min) + min_value, max_value = mse_min[1], mse_min[2] + + return min_value, max_value + + +@_implements(_CalibrationMethod.CALIBRATION_METHOD_HISTOGRAM_MSE_MAX_FREQUENCY) +class _HistogramMseMaxFrequency(_HistogramCalibrationAlgorithmBase): + """HistogramMseMaxFrequency for calculating min and max values of calibration result.""" + + def get_min_max_value(self) -> tuple[float, float]: + """Finds min and max starting from the index of the max frequency. + + The HistogramMseMaxFrequency method starts from the bin with the highest + frequency and expands the range to both sides. This performs well when data + is well spread on both sides of the max frequency. + + Returns: + (min_value, max_value): Min and max calculated using method to expand the + range based on max frequency. + """ + # Find the index of max frequency. + freq_max_idx = np.argmax(self._hist_freq) + return self._get_min_max_value_by_expanding_range(freq_max_idx) + + +@_implements(_CalibrationMethod.CALIBRATION_METHOD_HISTOGRAM_MSE_SYMMETRIC) +class _HistogramMseSymmetric(_HistogramCalibrationAlgorithmBase): + """HistogramMseSymmetric for calculating min and max values of calibration result.""" + + def get_min_max_value(self) -> tuple[float, float]: + """Finds min and max starting from the center index. + + The HistogramMseSymmetric method starts from the center bin and expands the + range to both sides. This works better when the data is well-centered. + + Returns: + (min_value, max_value): Min and max calculated using the method starting + from center and expanding. + """ + + # This function is currently only called in this method, but will be used in + # other methods in the future. + return self._get_min_max_value_by_expanding_range(self._num_bins // 2) + + +def get_min_max_value( + statistics: calib_stats_pb2.CalibrationStatistics, + calib_opts: quant_opts_pb2.CalibrationOptions, +) -> tuple[float, float]: + """Calculates min and max from statistics using calibration options. + + Args: + statistics: Collected calibration statistics. + calib_opts: Calibration options used for calculating min and max. + + Returns: + (min_value, max_value): Min and max calculated using calib_opts. + + Raises: + ValueError: Unsupported calibration method is given. + """ + calib_method = calib_opts.calibration_method + if calib_method not in _REGISTRY: + raise ValueError(f'Unsupported calibration method: {calib_method}') + + calibration_algorithm = _REGISTRY[calib_method](statistics, calib_opts) + return calibration_algorithm.get_min_max_value() diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/calibrator/calibration_statistics_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/calibrator/calibration_statistics_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..df5929d1bab49045b0ae00aa3f43ea9be0fce5f9 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/calibrator/calibration_statistics_pb2.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/compiler/mlir/quantization/tensorflow/calibrator/calibration_statistics.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\nXtensorflow/compiler/mlir/quantization/tensorflow/calibrator/calibration_statistics.proto\x12\x15tensorflow.calibrator\"\x9c\x04\n\x15\x43\x61librationStatistics\x12Y\n\x12min_max_statistics\x18\x01 \x01(\x0b\x32=.tensorflow.calibrator.CalibrationStatistics.MinMaxStatistics\x12h\n\x1a\x61verage_min_max_statistics\x18\x02 \x01(\x0b\x32\x44.tensorflow.calibrator.CalibrationStatistics.AverageMinMaxStatistics\x12^\n\x14histogram_statistics\x18\x03 \x01(\x0b\x32@.tensorflow.calibrator.CalibrationStatistics.HistogramStatistics\x1a:\n\x10MinMaxStatistics\x12\x12\n\nglobal_min\x18\x01 \x01(\x02\x12\x12\n\nglobal_max\x18\x02 \x01(\x02\x1aP\n\x17\x41verageMinMaxStatistics\x12\x0f\n\x07min_sum\x18\x01 \x01(\x02\x12\x0f\n\x07max_sum\x18\x02 \x01(\x02\x12\x13\n\x0bnum_samples\x18\x03 \x01(\x05\x1aP\n\x13HistogramStatistics\x12\x11\n\tbin_width\x18\x01 \x01(\x02\x12\x13\n\x0blower_bound\x18\x02 \x01(\x02\x12\x11\n\thist_freq\x18\x03 \x03(\x03\x42\x03\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.compiler.mlir.quantization.tensorflow.calibrator.calibration_statistics_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\370\001\001' + _CALIBRATIONSTATISTICS._serialized_start=116 + _CALIBRATIONSTATISTICS._serialized_end=656 + _CALIBRATIONSTATISTICS_MINMAXSTATISTICS._serialized_start=434 + _CALIBRATIONSTATISTICS_MINMAXSTATISTICS._serialized_end=492 + _CALIBRATIONSTATISTICS_AVERAGEMINMAXSTATISTICS._serialized_start=494 + _CALIBRATIONSTATISTICS_AVERAGEMINMAXSTATISTICS._serialized_end=574 + _CALIBRATIONSTATISTICS_HISTOGRAMSTATISTICS._serialized_start=576 + _CALIBRATIONSTATISTICS_HISTOGRAMSTATISTICS._serialized_end=656 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/exported_model_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/exported_model_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..45d3f9c0b26523fa356814d7ca5c35c77bcf71f8 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/exported_model_pb2.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/compiler/mlir/quantization/tensorflow/exported_model.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import graph_pb2 as tensorflow_dot_core_dot_framework_dot_graph__pb2 +from tensorflow.core.protobuf import meta_graph_pb2 as tensorflow_dot_core_dot_protobuf_dot_meta__graph__pb2 +from tensorflow.core.protobuf import saver_pb2 as tensorflow_dot_core_dot_protobuf_dot_saver__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\nEtensorflow/compiler/mlir/quantization/tensorflow/exported_model.proto\x12\x17tensorflow.quantization\x1a%tensorflow/core/framework/graph.proto\x1a)tensorflow/core/protobuf/meta_graph.proto\x1a$tensorflow/core/protobuf/saver.proto\"\xbe\x03\n\rExportedModel\x12\'\n\tgraph_def\x18\x01 \x01(\x0b\x32\x14.tensorflow.GraphDef\x12\x16\n\x0einit_node_name\x18\x02 \x01(\t\x12\x16\n\x0e\x63heckpoint_dir\x18\x05 \x01(\t\x12U\n\x10\x66unction_aliases\x18\x06 \x03(\x0b\x32;.tensorflow.quantization.ExportedModel.FunctionAliasesEntry\x12\x31\n\x0f\x61sset_file_defs\x18\x08 \x03(\x0b\x32\x18.tensorflow.AssetFileDef\x12\'\n\tsaver_def\x18\n \x01(\x0b\x32\x14.tensorflow.SaverDef\x1a\x36\n\x14\x46unctionAliasesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01J\x04\x08\x03\x10\x04J\x04\x08\x04\x10\x05J\x04\x08\x07\x10\x08J\x04\x08\t\x10\nR\x15variable_shared_namesR\x11restore_node_nameR\x0esave_node_nameR\x17\x66ile_prefix_tensor_nameB\x03\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.compiler.mlir.quantization.tensorflow.exported_model_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\370\001\001' + _EXPORTEDMODEL_FUNCTIONALIASESENTRY._options = None + _EXPORTEDMODEL_FUNCTIONALIASESENTRY._serialized_options = b'8\001' + _EXPORTEDMODEL._serialized_start=219 + _EXPORTEDMODEL._serialized_end=665 + _EXPORTEDMODEL_FUNCTIONALIASESENTRY._serialized_start=504 + _EXPORTEDMODEL_FUNCTIONALIASESENTRY._serialized_end=558 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/python/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/python/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/python/quantize_model.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/python/quantize_model.py new file mode 100644 index 0000000000000000000000000000000000000000..43dbd283a67fdf779fa320acf95cd3cd31fcec07 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/python/quantize_model.py @@ -0,0 +1,1609 @@ +# Copyright 2022 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. +# ============================================================================== +"""Defines TF Quantization API from SavedModel to SavedModel.""" + +import collections.abc +import tempfile +from typing import Callable, Collection, Dict, Mapping, Optional, Sequence +import uuid + +from absl import logging +import numpy as np + +from tensorflow.compiler.mlir.quantization.tensorflow import exported_model_pb2 +from tensorflow.compiler.mlir.quantization.tensorflow import quantization_options_pb2 as quant_opts_pb2 +from tensorflow.compiler.mlir.quantization.tensorflow.calibrator import calibration_algorithm +from tensorflow.compiler.mlir.quantization.tensorflow.calibrator import calibration_statistics_pb2 as calib_stats_pb2 +from tensorflow.compiler.mlir.quantization.tensorflow.python import pywrap_quantize_model +from tensorflow.compiler.mlir.quantization.tensorflow.python import representative_dataset as repr_dataset +from tensorflow.compiler.mlir.quantization.tensorflow.python import save_model +from tensorflow.core.framework import graph_pb2 +from tensorflow.core.protobuf import meta_graph_pb2 +from tensorflow.core.protobuf import saver_pb2 +from tensorflow.python.client import session +from tensorflow.python.eager import context +from tensorflow.python.eager import wrap_function +from tensorflow.python.framework import ops +from tensorflow.python.framework import tensor_conversion +from tensorflow.python.lib.io import file_io +from tensorflow.python.saved_model import load as saved_model_load +from tensorflow.python.saved_model import loader_impl as saved_model_loader +from tensorflow.python.saved_model import signature_constants +from tensorflow.python.saved_model import tag_constants +from tensorflow.python.trackable import autotrackable +from tensorflow.python.types import core +from tensorflow.python.util import tf_export + +# Type aliases for quant_opts_pb2 messages. +_QuantizationOptions = tf_export.tf_export( + 'quantization.experimental.QuantizationOptions' +)(quant_opts_pb2.QuantizationOptions) + +_QuantizationMethod = tf_export.tf_export( + 'quantization.experimental.QuantizationMethod' +)(quant_opts_pb2.QuantizationMethod) + +_QuantizationComponentSpec = tf_export.tf_export( + 'quantization.experimental.QuantizationComponentSpec' +)(quant_opts_pb2.QuantizationComponentSpec) + +_UnitWiseQuantizationSpec = tf_export.tf_export( + 'quantization.experimental.UnitWiseQuantizationSpec' +)(quant_opts_pb2.UnitWiseQuantizationSpec) + +_PresetMethod = _QuantizationMethod.PresetMethod +_CalibrationMethod = quant_opts_pb2.CalibrationOptions.CalibrationMethod + +_QuantizationComponent = _QuantizationComponentSpec.QuantizationComponent +_TensorType = _QuantizationComponentSpec.TensorType + +# Mapping of signature def key -> SignatureDef. +_SignatureDefMap = Mapping[str, meta_graph_pb2.SignatureDef] + +# Default minimum number of elements in the weights for them to be quantized +# during dynamic range quantization (DRQ) and weight-only quantization. +_DYNAMIC_RANGE_DEFAULT_MIN_NUM_ELEMENTS_FOR_WEIGHTS = 1024 + +# Name of the saved model assets directory. +_ASSETS_DIR = 'assets' +_ASSETS_EXTRA_DIR = 'assets.extra' + + +def _is_qat_saved_model(saved_model_path: str): + """Checks if the SavedModel is QAT-enabled by looking for 'FakeQuant' ops.""" + saved_model_proto = saved_model_loader.parse_saved_model(saved_model_path) + for meta_graph in saved_model_proto.meta_graphs: + if any( + node.op.startswith('FakeQuant') for node in meta_graph.graph_def.node + ): + return True + for function in meta_graph.graph_def.library.function: + if any(node.op.startswith('FakeQuant') for node in function.node_def): + return True + return False + + +def _create_sample_validator( + expected_input_keys: Collection[str], +) -> Callable[ + [repr_dataset.RepresentativeSample], repr_dataset.RepresentativeSample +]: + """Creates a validator function for a representative sample. + + Args: + expected_input_keys: Input keys (keyword argument names) that the function + the sample will be used for is expecting to receive. + + Returns: + A callable that validates a `RepresentativeSample`. + """ + + def validator( + sample: repr_dataset.RepresentativeSample, + ) -> repr_dataset.RepresentativeSample: + """Validates a single instance of representative sample. + + This provides a simple check for `sample` that this is a mapping of + {input_key: input_value}. + + Args: + sample: A `RepresentativeSample` to validate. + + Returns: + `sample` iff it is valid. + + Raises: + ValueError: iff the sample isn't an instance of `Mapping`. + KeyError: iff the sample does not have the set of input keys that match + the input keys of the function. + """ + if not isinstance(sample, collections.abc.Mapping): + raise ValueError( + 'Invalid representative sample type. Provide a mapping ' + '(usually a dict) of {input_key: input_value}. ' + f'Got type: {type(sample)} instead.' + ) + + if set(sample.keys()) != expected_input_keys: + raise KeyError( + 'Invalid input keys for representative sample. The function expects ' + f'input keys of: {set(expected_input_keys)}. ' + f'Got: {set(sample.keys())}. Please provide correct input keys for ' + 'representative samples.' + ) + + return sample + + return validator + + +def _validate_representative_dataset( + representative_dataset: repr_dataset.RepresentativeDatasetOrMapping, + signature_keys: Collection[str], +) -> None: + """Validates the representative dataset, based on the signature keys. + + Representative dataset can be provided in two different forms: a single + instance of `RepresentativeDataset` or a map of signature key to the + corresponding `RepresentativeDataset`. These have a relationship with + `signature_keys`. + + This function validates the following conditions: + * If `len(signature_keys) > 1`, then `representative_dataset` should be a + mapping where the keys exactly match the elements in `signature_keys`. + * If `len(signature_keys) == 1`, then both a mapping and a single instance of + `RepresentativeDataset` are allowed. + * This function also assumes `len(signature_keys) > 0`. + + Args: + representative_dataset: A `RepresentativeDataset` or a map of string to + `RepresentativeDataset` to be validated. + signature_keys: A collection of strings that contains the signature keys, + each identifying a `SignatureDef`. + + Raises: + ValueError: Iff `representative_dataset` does not satisfy the conditions + above. + """ + if isinstance(representative_dataset, collections.abc.Mapping): + if set(signature_keys) != set(representative_dataset.keys()): + raise ValueError( + 'The signature keys and the keys of representative dataset map ' + f'do not match. Signature keys: {set(signature_keys)}, ' + f'representative dataset map: {set(representative_dataset.keys())}.' + ) + else: + if len(signature_keys) > 1: + raise ValueError( + 'Representative dataset is not a mapping ' + f'(got: {type(representative_dataset)}), ' + 'but there is more than one signature key provided. ' + 'Please provide a map of {signature_key -> dataset} ' + 'with more than one signature key.' + ) + + +def _convert_values_to_tf_tensors( + sample: repr_dataset.RepresentativeSample, +) -> Mapping[str, core.Tensor]: + """Converts TensorLike values of `sample` to Tensors. + + Creates a copy of `sample`, where each value is converted to Tensors + unless it is already a Tensor. + The values are not converted in-place (i.e. `sample` is not mutated). + + Args: + sample: A representative sample, which is a map of {name -> tensorlike + value}. + + Returns: + Converted map of {name -> tensor}. + """ + tensor_mapping = {} + for name, tensorlike_value in sample.items(): + if isinstance(tensorlike_value, core.Tensor): + tensor_value = tensorlike_value + else: + tensor_value = tensor_conversion.convert_to_tensor_v2_with_dispatch( + tensorlike_value + ) + + tensor_mapping[name] = tensor_value + + return tensor_mapping + + +def _create_feed_dict_from_input_data( + input_data: repr_dataset.RepresentativeSample, + signature_def: meta_graph_pb2.SignatureDef, +) -> Dict[str, np.ndarray]: + """Constructs a feed_dict from input data. + + Note: This function should only be used in graph mode. + + This is a helper function that converts an 'input key -> input value' mapping + to a feed dict. A feed dict is an 'input tensor name -> input value' mapping + and can be directly passed to the `feed_dict` argument of `sess.run()`. + + Args: + input_data: Input key -> input value mapping. The input keys should match + the input keys of `signature_def`. + signature_def: A SignatureDef representing the function that `input_data` is + an input to. + + Returns: + Feed dict, which is intended to be used as input for `sess.run`. It is + essentially a mapping: input tensor name -> input value. Note that the input + value in the feed dict is not a `Tensor`. + """ + feed_dict = {} + for input_key, input_value in input_data.items(): + input_tensor_name = signature_def.inputs[input_key].name + + value = input_value + if isinstance(input_value, core.Tensor): + # Take the data out of the tensor. + value = input_value.eval() + + feed_dict[input_tensor_name] = value + + return feed_dict + + +# TODO(b/249918070): Implement a progress bar. +def _log_sample_num_for_calibration( + representative_dataset: repr_dataset.RepresentativeDataset, +) -> repr_dataset.RepresentativeDataset: + """Logs the sample number for calibration. + + If in debug logging level, the "sample number / total num samples" is logged + for every 5 iterations. + + This is often useful when tracking the progress of the calibration step which + is often slow and may look stale if there's no logs being printed. + + Args: + representative_dataset: The representative dataset. + + Yields: + The representative samples from `representative_dataset` without any + modification. + """ + num_samples: Optional[int] = repr_dataset.get_num_samples( + representative_dataset + ) + if num_samples is None: + total_num_samples = '?' + logging.info('Representative dataset size unknown.') + else: + total_num_samples = str(num_samples) + logging.info('Using representative dataset of size: %s', total_num_samples) + + sample_num = 0 + for sample in representative_dataset: + sample_num += 1 + + # Log the sample number for every 5 iterations. + logging.log_every_n( + logging.DEBUG, + 'Running representative sample for calibration: %d / %s', + 5, + sample_num, + total_num_samples, + ) + yield sample + + logging.info( + 'Running representative samples complete: %d / %s', + sample_num, + total_num_samples, + ) + + +def _run_function_for_calibration_graph_mode( + sess: session.Session, + signature_def: meta_graph_pb2.SignatureDef, + representative_dataset: repr_dataset.RepresentativeDataset, +) -> None: + """Runs the representative dataset through a function for calibration. + + NOTE: This is intended to be run in graph mode (TF1). + + The function is identified by the SignatureDef. + + Args: + sess: The Session object to run the function in. + signature_def: A SignatureDef that identifies a function by specifying the + inputs and outputs. + representative_dataset: The representative dataset to run through the + function. + """ + output_tensor_names = [ + output_tensor_info.name + for output_tensor_info in signature_def.outputs.values() + ] + + sample_validator = _create_sample_validator( + expected_input_keys=signature_def.inputs.keys() + ) + + for sample in map( + sample_validator, _log_sample_num_for_calibration(representative_dataset) + ): + # Create a mapping from input tensor name to the input tensor value. + # ex) "Placeholder:0" -> [0, 1, 2] + feed_dict = _create_feed_dict_from_input_data(sample, signature_def) + sess.run(output_tensor_names, feed_dict=feed_dict) + + +def _replace_tensors_by_numpy_ndarrays( + repr_ds_map: repr_dataset.RepresentativeDatasetMapping, +) -> None: + """Replaces tf.Tensors by their evaluated numpy arrays. + + This assumes that tf.Tensors in representative samples are created in the + default Graph. It will raise an error if tensors are created in a different + graph. + + Args: + repr_ds_map: SignatureDef key -> RepresentativeDataset mapping. + """ + with session.Session() as sess: + for signature_def_key in repr_ds_map: + # Replaces the dataset with a new dataset where tf.Tensors are replaced + # by their evaluated values. + ds = repr_ds_map[signature_def_key] + repr_ds_map[signature_def_key] = ( + repr_dataset.replace_tensors_by_numpy_ndarrays(ds, sess) + ) + + +def _run_graph_for_calibration_graph_mode( + model_dir: str, + tags: Collection[str], + representative_dataset_map: repr_dataset.RepresentativeDatasetMapping, +) -> None: + """Runs the graph for calibration in graph mode. + + This function assumes _graph mode_ (used when legacy TF1 is used or when eager + mode is explicitly disabled) when running the graph. This step is used in + order to collect the statistics in CustomAggregatorOp for quantization using + the representative dataset for the actual data provided for inference. + + Args: + model_dir: Path to SavedModel directory. + tags: Collection of tags identifying the MetaGraphDef within the SavedModel. + representative_dataset_map: A map where signature keys are mapped to + corresponding representative datasets. + + Raises: + ValueError: When running the function with the representative dataset fails. + """ + # Replace tf.Tensors by numpy ndarrays in order to reuse the samples in a + # different graph when running the calibration. + _replace_tensors_by_numpy_ndarrays(representative_dataset_map) + + # Run the calibration in a new graph to avoid name collision, which could + # happen when the same model is loaded multiple times in the default graph. + with ops.Graph().as_default(), session.Session() as sess: + meta_graph: meta_graph_pb2.MetaGraphDef = saved_model_loader.load( + sess, tags, export_dir=model_dir + ) + + for signature_key, repr_ds in representative_dataset_map.items(): + sig_def = meta_graph.signature_def[signature_key] + + try: + _run_function_for_calibration_graph_mode( + sess, signature_def=sig_def, representative_dataset=repr_ds + ) + except Exception as ex: + raise ValueError( + 'Failed to run representative dataset through the ' + f'function with the signature key: {signature_key}.' + ) from ex + + +def _run_function_for_calibration_eager_mode( + func: wrap_function.WrappedFunction, + representative_dataset: repr_dataset.RepresentativeDataset, +) -> None: + """Runs the representative dataset through a function for calibration. + + NOTE: This is intended to be run in eager mode (TF2). + + Args: + func: The function to run the representative samples through. + representative_dataset: Representative dataset used for calibration. The + input keys and input values of the representative samples should match the + keyword arguments of `func`. + """ + _, keyword_args = func.structured_input_signature + sample_validator = _create_sample_validator( + expected_input_keys=keyword_args.keys() + ) + + for sample in map( + sample_validator, _log_sample_num_for_calibration(representative_dataset) + ): + # Convert any non-Tensor values from the sample to Tensors. + # This conversion is required because the model saved in `model_dir` is + # saved using TF1 SavedModelBuilder, which doesn't save the + # SavedObjectGraph. + # TODO(b/236795224): Remove the need for this conversion by keeping the + # FunctionSpec (object graph) in the SavedModel. Related: b/213406917. + func_kwargs = _convert_values_to_tf_tensors(sample) + func(**func_kwargs) + + +def _run_graph_for_calibration_eager_mode( + model_dir: str, + tags: Collection[str], + representative_dataset_map: repr_dataset.RepresentativeDatasetMapping, +) -> None: + """Runs the graph for calibration in eager mode. + + This function assumes _eager mode_ (enabled in TF2 by default) when running + the graph. This step is used in order to collect the statistics in + CustomAggregatorOp for quantization using the representative dataset for the + actual data provided for inference. + + Args: + model_dir: Path to SavedModel directory. + tags: Collection of tags identifying the MetaGraphDef within the SavedModel. + representative_dataset_map: A map where signature keys are mapped to + corresponding representative datasets. + + Raises: + ValueError: When running the function with the representative dataset fails. + """ + root: autotrackable.AutoTrackable = saved_model_load.load(model_dir, tags) + for signature_key, repr_ds in representative_dataset_map.items(): + try: + _run_function_for_calibration_eager_mode( + func=root.signatures[signature_key], representative_dataset=repr_ds + ) + except Exception as ex: + raise ValueError( + 'Failed to run representative dataset through the ' + f'function with the signature key: {signature_key}.' + ) from ex + + +def _run_graph_for_calibration( + float_model_dir: str, + signature_keys: Sequence[str], + tags: Collection[str], + representative_dataset: repr_dataset.RepresentativeDatasetOrMapping, + force_graph_mode_calibration: bool, +) -> None: + """Runs the graph for calibration using representative datasets. + + Args: + float_model_dir: Path to the model to calibrate. + signature_keys: Sequence of keys identifying SignatureDef containing inputs + and outputs. + tags: Collection of tags identifying the MetaGraphDef within the SavedModel + to analyze. + representative_dataset: An iterator that returns a dictionary of {input_key: + input_value} or a mapping from signature keys to such iterators. When + `signature_keys` contains more than one signature key, + `representative_datsaet` should be a mapping that maps each signature keys + to the corresponding representative dataset. + force_graph_mode_calibration: If set to true, it forces calibration in graph + model instead of eager mode when the context is in eager mode. + + Raises: + ValueError iff: + * The representative dataset format is invalid. + * It fails to run the functions using the representative datasets. + """ + try: + _validate_representative_dataset(representative_dataset, signature_keys) + except Exception as ex: + raise ValueError('Invalid representative dataset.') from ex + + # If `representative_dataset` is not a mapping, convert to a mapping for the + # following functions to handle representative datasets more conveniently. + representative_dataset_map = representative_dataset + if not isinstance(representative_dataset, collections.abc.Mapping): + # `signature_keys` is guaranteed to have only one element after the + # validation. + representative_dataset_map = {signature_keys[0]: representative_dataset} + + try: + if context.executing_eagerly() and not force_graph_mode_calibration: + logging.info('Calibration step is executed in eager mode.') + _run_graph_for_calibration_eager_mode( + float_model_dir, tags, representative_dataset_map + ) + else: + logging.info('Calibration step is executed in graph mode.') + _run_graph_for_calibration_graph_mode( + float_model_dir, tags, representative_dataset_map + ) + except Exception as ex: + raise ValueError( + 'Failed to run graph for post-training quantization calibration.' + ) from ex + + logging.info('Calibration step complete.') + + +def _copy_assets(src_path: str, dst_path: str) -> None: + """Copies the assets directory of the saved model. + + Clones the contents of the assets/ directory from the source saved model + directory to the destination saved model directory. Nothing will be copied if + there are no assets directory in the source directory. + + Args: + src_path: Source saved model directory. + dst_path: Destination saved model directory. This directory must exist. + """ + for assets_dir_name in [_ASSETS_DIR, _ASSETS_EXTRA_DIR]: + src_assets_path = file_io.join(src_path, assets_dir_name) + if not file_io.file_exists_v2(src_assets_path): + # Do nothing if the source assets path does not exist. + continue + + dst_assets_path = file_io.join(dst_path, assets_dir_name) + file_io.create_dir_v2(dst_assets_path) + + for curr_dir, _, files in file_io.walk_v2(src_assets_path): + for asset_file_name in files: + src_asset_file = file_io.join(curr_dir, asset_file_name) + + # Construct the destination assets file path. + curr_dst_dir = curr_dir.replace(src_assets_path, dst_assets_path) + dst_asset_file = file_io.join(curr_dst_dir, asset_file_name) + + file_io.copy_v2(src_asset_file, dst_asset_file) + logging.info( + 'Copied asset file: %s -> %s', src_asset_file, dst_asset_file + ) + + +def _run_static_range_qat( + src_saved_model_path: str, + dst_saved_model_path: str, + quant_opts: _QuantizationOptions, + signature_def_map: _SignatureDefMap, +) -> None: + """Runs static-range quantization for a Quantization-Aware Trained model. + + Runs the quantization for a model trained using QAT. + + Args: + src_saved_model_path: Path to the source SavedModel directory. + dst_saved_model_path: Path to the destination SavedModel directory. + quant_opts: Quantization options. + signature_def_map: Signature def key -> SignatureDef mapping. + """ + logging.info('Running static-range quantization for QAT model.') + + loader = saved_model_loader.SavedModelLoader(src_saved_model_path) + function_aliases = loader.get_meta_graph_def_from_tags( + quant_opts.tags + ).meta_info_def.function_aliases + + exported_model_serialized = pywrap_quantize_model.quantize_qat_model( + src_saved_model_path, + list(quant_opts.signature_keys), + set(quant_opts.tags), + quant_opts.SerializeToString(), + dict(function_aliases), + ) + + exported_model = exported_model_pb2.ExportedModel.FromString( + exported_model_serialized + ) + + save_model.save_model_v1( + exported_model.graph_def, + dst_saved_model_path, + signature_def_map, + quant_opts.tags, + init_op_name=exported_model.init_node_name, + saver_def=_get_saver_def_or_none(exported_model), + checkpoint_dir=exported_model.checkpoint_dir, + function_aliases=exported_model.function_aliases, + asset_file_defs=exported_model.asset_file_defs, + ) + + _copy_assets(src_saved_model_path, dst_saved_model_path) + + +def _get_min_max_from_calibrator( + node_id: bytes, + calib_opts: quant_opts_pb2.CalibrationOptions, +) -> tuple[float, float]: + """Calculate min and max from statistics using calibration options. + + Args: + node_id: bytes of node id. + calib_opts: Calibration options used for calculating min and max. + + Returns: + (min_value, max_value): Min and max calculated using calib_opts. + + Raises: + ValueError: Unsupported calibration method is given. + """ + statistics: calib_stats_pb2.CalibrationStatistics = ( + pywrap_quantize_model.get_statistics_from_calibrator(node_id) + ) + min_value, max_value = calibration_algorithm.get_min_max_value( + statistics, calib_opts + ) + return min_value, max_value + + +def _add_calibration_statistics( + graph_def: graph_pb2.GraphDef, + calib_opts: quant_opts_pb2.CalibrationOptions, +) -> None: + """Adds calibration statistics to the graph def. + + This function must be run after running the graph with a representative + dataset. Retrieves calibration statistics from the global calibrator and adds + them to the corresponding nodes as attributes. + + Args: + graph_def: GraphDef to add calibration statistics to. + calib_opts: Calibration options to calculate min and max. + """ + for function_def in graph_def.library.function: + for node_def in function_def.node_def: + if node_def.op != 'CustomAggregator': + continue + + node_id = node_def.attr['id'].s + try: + min_value, max_value = _get_min_max_from_calibrator(node_id, calib_opts) + pywrap_quantize_model.clear_data_from_calibrator(node_id) + + node_def.attr['min'].f = min_value + node_def.attr['max'].f = max_value + except ValueError: + logging.warning( + ( + 'CustomAggregator id "%s" from FunctionDef "%s" does not have ' + 'min or max values. Parts of this function are not quantized.' + ), + node_id.decode('utf-8'), + function_def.signature.name, + ) + + +def _enable_dump_tensor(graph_def: graph_pb2.GraphDef) -> None: + """Enable DumpTensor in the graph def. + + DumpTensor is disabled by default to avoid logging data during calibration. + This function is called after calibration to enable DumpTensor. + + Args: + graph_def: GraphDef to enable DumpTensor + """ + for function_def in graph_def.library.function: + for node_def in function_def.node_def: + if node_def.op != 'DumpTensor': + continue + + node_def.attr['enabled'].b = True + + +def _change_dump_tensor_file_name(graph_def: graph_pb2.GraphDef) -> None: + """Change file_name used by DumpTensor to quantized_tensor_data.pb. + + In whole model verify, DumpTensor in unquantized model uses file_name + unquantized_tensor_data.pb. + After unquantized dump model is created, this function allows quantized dump + model to use quantized_tensor_data.pb as file_name. + + Args: + graph_def: GraphDef to change file_name of DumpTensor + """ + for function_def in graph_def.library.function: + for node_def in function_def.node_def: + if node_def.op != 'DumpTensor': + continue + + node_def.attr['file_name'].s = 'quantized_tensor_data.pb'.encode('utf-8') + + +def _get_saver_def_or_none( + exported_model: exported_model_pb2.ExportedModel, +) -> Optional[saver_pb2.SaverDef]: + """Returns the SaverDef from ExportedModel, None otherwise. + + Args: + exported_model: ExportedModel to take the SaverDef from. + + Returns: + SaverDef instance if the field `saver_def` is set. None otherwise. + """ + if exported_model.HasField('saver_def'): + return exported_model.saver_def + return None + + +def _run_static_range_ptq( + src_saved_model_path: str, + dst_saved_model_path: str, + quant_opts: _QuantizationOptions, + representative_dataset: repr_dataset.RepresentativeDatasetOrMapping, + signature_def_map: _SignatureDefMap, +) -> None: + """Runs static-range Post-Training Quantization. + + Runs static-range PTQ for the model. Runs the calibration step with + `representative_dataset` to collect statistics required for quantization. This + produces the quantized GraphDef along with the SignatureDefs which might have + been modified according to the changes in the graph. + + Args: + src_saved_model_path: Path to the source SavedModel directory. + dst_saved_model_path: Path to the destination SavedModel directory. + quant_opts: Quantization options. + representative_dataset: Representative dataset used for the calibration + step. Representative datasets should exist for each signature def key in + `signature_def_keys`. + signature_def_map: Signature def key -> SignatureDef mapping. + + Raises: + ValueError if the graph doesn't contain a valid signature. + """ + logging.info('Running post-training quantization pre-calibration step.') + + loader = saved_model_loader.SavedModelLoader(src_saved_model_path) + function_aliases = loader.get_meta_graph_def_from_tags( + quant_opts.tags + ).meta_info_def.function_aliases + + exported_model_serialized = ( + pywrap_quantize_model.quantize_ptq_model_pre_calibration( + src_saved_model_path, + list(quant_opts.signature_keys), + set(quant_opts.tags), + quant_opts.SerializeToString(), + dict(function_aliases), + ) + ) + + exported_model = exported_model_pb2.ExportedModel.FromString( + exported_model_serialized + ) + + graph_def = exported_model.graph_def + for function_def in graph_def.library.function: + for node_def in function_def.node_def: + if node_def.op == 'CustomAggregator': + node_def.attr['id'].s = uuid.uuid4().hex.encode('ascii') + + pre_calib_output_model_path = tempfile.mkdtemp() + save_model.save_model_v1( + graph_def, + pre_calib_output_model_path, + signature_def_map, + quant_opts.tags, + exported_model.init_node_name, + _get_saver_def_or_none(exported_model), + exported_model.checkpoint_dir, + exported_model.function_aliases, + asset_file_defs=exported_model.asset_file_defs, + ) + + _copy_assets(src_saved_model_path, pre_calib_output_model_path) + + # Uses the representative dataset to collect statistics for calibration. + # Handles the graph mode execution separately in case TF2 is disabled or + # eager execution is disabled. The min & max values are stored separately + # in a global CalibratorSingleton instance. + _run_graph_for_calibration( + pre_calib_output_model_path, + quant_opts.signature_keys, + quant_opts.tags, + representative_dataset, + quant_opts.force_graph_mode_calibration, + ) + + _add_calibration_statistics(graph_def, quant_opts.calibration_options) + + if quant_opts.HasField('debugger_options'): + # Since DumpTensor was disabled by default, we need to enable them. + _enable_dump_tensor(graph_def) + + if ( + quant_opts.debugger_options.debugger_type + == quant_opts_pb2.DebuggerOptions.DebuggerType.DEBUGGER_TYPE_WHOLE_MODEL + ): + # TODO: b/295139417 - Remove CustomAggregator op in unquantized dump model + # TODO: b/296916287 - Create a separate function for saving unquantized + # dump model + save_model.save_model_v1( + graph_def, + quant_opts.debugger_options.unquantized_dump_model_path, + signature_def_map, + quant_opts.tags, + exported_model.init_node_name, + _get_saver_def_or_none(exported_model), + exported_model.checkpoint_dir, + exported_model.function_aliases, + asset_file_defs=exported_model.asset_file_defs, + ) + + _copy_assets( + src_saved_model_path, + quant_opts.debugger_options.unquantized_dump_model_path, + ) + + _change_dump_tensor_file_name(graph_def) + + calibrated_model_path = tempfile.mkdtemp() + save_model.save_model_v1( + graph_def, + calibrated_model_path, + signature_def_map, + quant_opts.tags, + exported_model.init_node_name, + _get_saver_def_or_none(exported_model), + exported_model.checkpoint_dir, + asset_file_defs=exported_model.asset_file_defs, + ) + + _copy_assets(pre_calib_output_model_path, calibrated_model_path) + + logging.info('Running post-training quantization post-calibration step.') + exported_model_serialized = ( + pywrap_quantize_model.quantize_ptq_model_post_calibration( + calibrated_model_path, + list(quant_opts.signature_keys), + set(quant_opts.tags), + quant_opts.SerializeToString(), + dict(exported_model.function_aliases), + ) + ) + + exported_model = exported_model_pb2.ExportedModel.FromString( + exported_model_serialized + ) + + save_model.save_model_v1( + exported_model.graph_def, + dst_saved_model_path, + signature_def_map, + quant_opts.tags, + init_op_name=exported_model.init_node_name, + saver_def=_get_saver_def_or_none(exported_model), + checkpoint_dir=exported_model.checkpoint_dir, + function_aliases=exported_model.function_aliases, + asset_file_defs=exported_model.asset_file_defs, + ) + + _copy_assets(calibrated_model_path, dst_saved_model_path) + + +def _static_range_quantize( + saved_model_path: str, + output_directory: str, + quantization_options: _QuantizationOptions, + representative_dataset: Optional[ + repr_dataset.RepresentativeDatasetOrMapping + ] = None, +) -> autotrackable.AutoTrackable: + """Quantizes the given SavedModel via static range quantization. + + If the model is not trained with Quantization-Aware Training (QAT) technique, + it requires `representative_dataset` to collect statistics required for + quantization. If non-None `representative_dataset` is provided with a QAT + model input, `representative_dataset` will be ignored. + + Args: + saved_model_path: Path to the saved model. When representative_dataset is + not provided, this should be a model trained with QAT. + output_directory: The path to save the output SavedModel. The directory will + be overwritten if not empty. + quantization_options: QuantizationOptions proto describing quantization + related config. + representative_dataset: a generator that returns a dictionary in {input_key: + input_value} format or a tuple with signature key and a dictionary in + {input_key: input_value} format that feeds calibration data for quantizing + model. This should be provided when the model is not a QAT model. + + Returns: + A SavedModel object with TF quantization applied. + + Raises: + ValueError: when representative_dataset is not provided for non-QAT model. + RuntimeError: When a MetaGraphDef could not be found associated with `tags` + in the SavedModel. + """ + logging.info( + 'Running static range quantization on model: %s', saved_model_path + ) + logging.info('QuantizationOptions: \n%s', quantization_options) + + is_qat_saved_model_or_method_no_quantize = _is_qat_saved_model( + saved_model_path + ) or ( + quantization_options.quantization_method.preset_method + == _QuantizationMethod.METHOD_NO_QUANTIZE + ) + signature_def_map = save_model.get_signatures_from_saved_model( + saved_model_path, + quantization_options.signature_keys, + set(quantization_options.tags), + ) + + # Checks if the model is from QAT or method is METHOD_NO_QUANTIZE. + if ( + representative_dataset is None + and not is_qat_saved_model_or_method_no_quantize + ): + raise ValueError( + 'When `representative_dataset` is not provided, the model should be ' + 'trained with quantization-aware training (QAT).' + ) + if quantization_options.min_num_elements_for_weights > 0: + logging.warn( + 'min_num_elements_for_weights is set but is not supported for the ' + 'Post-training static range quantization. ' + 'The flag is ignored.' + ) + + if is_qat_saved_model_or_method_no_quantize: + _run_static_range_qat( + saved_model_path, + output_directory, + quantization_options, + signature_def_map, + ) + else: + _run_static_range_ptq( + saved_model_path, + output_directory, + quantization_options, + representative_dataset, + signature_def_map, + ) + + return saved_model_load.load(output_directory) + + +def _dynamic_range_quantize( + saved_model_path: str, + output_directory: str, + quantization_options: _QuantizationOptions, +) -> autotrackable.AutoTrackable: + """Quantizes the given SavedModel via post-training dynamic range quantization. + + Args: + saved_model_path: Path to the saved model. + output_directory: The path to save the output SavedModel. The directory will + be overwritten if not empty. + quantization_options: QuantizationOptions proto describing quantization + related config. + + Returns: + A SavedModel object with TF quantization applied. + + Raises: + ValueError: when the model is QAT model. + """ + mode_str = 'dynamic-range quantization' + if _is_qat_saved_model(saved_model_path): + raise ValueError( + 'The models trained with quantization-aware training (QAT) is not ' + 'supported for %s.' % mode_str + ) + + logging.info( + 'Running post-training %s on model: %s', mode_str, saved_model_path + ) + logging.info('QuantizationOptions: \n%s', quantization_options) + + loader = saved_model_loader.SavedModelLoader(saved_model_path) + + function_aliases = loader.get_meta_graph_def_from_tags( + quantization_options.tags + ).meta_info_def.function_aliases + + # Apply post-training dynamic range quantization to the model. + exported_model_serialized = pywrap_quantize_model.quantize_ptq_dynamic_range( + saved_model_path, + list(quantization_options.signature_keys), + set(quantization_options.tags), + quantization_options.SerializeToString(), + dict(function_aliases), + ) + + exported_model = exported_model_pb2.ExportedModel.FromString( + exported_model_serialized + ) + signature_def_map = save_model.get_signatures_from_saved_model( + saved_model_path, + quantization_options.signature_keys, + quantization_options.tags, + ) + + save_model.save_model_v1( + exported_model.graph_def, + output_directory, + signature_def_map, + quantization_options.tags, + init_op_name=exported_model.init_node_name, + saver_def=_get_saver_def_or_none(exported_model), + checkpoint_dir=exported_model.checkpoint_dir, + function_aliases=exported_model.function_aliases, + asset_file_defs=exported_model.asset_file_defs, + ) + _copy_assets(saved_model_path, output_directory) + + return saved_model_load.load(output_directory) + + +def _weight_only_quantize( + saved_model_path: str, + output_directory: str, + quantization_options: quant_opts_pb2.QuantizationOptions, +) -> autotrackable.AutoTrackable: + """Quantizes the given SavedModel via weight-only quantization. + + Args: + saved_model_path: Path to the saved model. + output_directory: The path to save the output SavedModel. The directory will + be overwritten if not empty. + quantization_options: QuantizationOptions proto describing quantization + related config. + + Returns: + A SavedModel object with TF quantization applied. + + Raises: + ValueError: when the model is QAT model. + """ + mode_str = 'weight-only quantization' + + # QAT weight-only is not supported yet. + if _is_qat_saved_model(saved_model_path): + raise ValueError( + 'The models trained with quantization-aware training (QAT) is not ' + 'supported for %s.' % mode_str + ) + + logging.info( + 'Running post-training %s on model: %s', mode_str, saved_model_path + ) + logging.info('QuantizationOptions: \n%s', quantization_options) + + loader = saved_model_loader.SavedModelLoader(saved_model_path) + + function_aliases = loader.get_meta_graph_def_from_tags( + quantization_options.tags + ).meta_info_def.function_aliases + + exported_model_serialized = pywrap_quantize_model.quantize_weight_only( + saved_model_path, + quantization_options.SerializeToString(), + dict(function_aliases), + ) + + exported_model = exported_model_pb2.ExportedModel.FromString( + exported_model_serialized + ) + signature_def_map = save_model.get_signatures_from_saved_model( + saved_model_path, + list(quantization_options.signature_keys), + set(quantization_options.tags), + ) + + save_model.save_model_v1( + exported_model.graph_def, + output_directory, + signature_def_map, + quantization_options.tags, + init_op_name=exported_model.init_node_name, + saver_def=_get_saver_def_or_none(exported_model), + checkpoint_dir=exported_model.checkpoint_dir, + function_aliases=exported_model.function_aliases, + asset_file_defs=exported_model.asset_file_defs, + ) + _copy_assets(saved_model_path, output_directory) + + return saved_model_load.load(output_directory) + + +def _verify_output_dir(output_dir: Optional[str], overwrite: bool) -> None: + """Verifies the output directory. + + Raises an error if `output_dir` is not suitable for writing the output saved + model. + + Args: + output_dir: Output directory. + overwrite: An option allowing to overwrite the existing output directory if + set to true. Does not actually create or modify the `output_dir` in this + function. + + Raises: + FileExistsError: Iff `output_dir` is not empty and `overwrite` is false. + """ + dir_not_empty = ( + output_dir is not None + and file_io.file_exists_v2(output_dir) + and file_io.list_directory_v2(output_dir) + ) + + if dir_not_empty and not overwrite: + raise FileExistsError( + f'Output directory already exists: {output_dir} . ' + 'Please set overwrite_output_directory to true to ' + 'overwrite the existing directory.' + ) + + +def _populate_quantization_component_spec( + quant_method: _QuantizationMethod, +) -> None: + """Populates default values for QuantizationComponentSpec. + + Args: + quant_method: The quantization method to be updated. + """ + # Make sure creating one spec per component. + updated_component_spec = dict() + + # Populate default configuration. + if ( + quant_method.preset_method == _PresetMethod.METHOD_STATIC_RANGE_INT8 + or quant_method.preset_method == _PresetMethod.METHOD_DYNAMIC_RANGE_INT8 + ): + updated_component_spec[_QuantizationComponent.COMPONENT_ACTIVATION] = ( + _QuantizationComponentSpec( + quantization_component=_QuantizationComponent.COMPONENT_ACTIVATION, + tensor_type=_TensorType.TENSORTYPE_INT_8, + ) + ) + updated_component_spec[_QuantizationComponent.COMPONENT_WEIGHT] = ( + _QuantizationComponentSpec( + quantization_component=_QuantizationComponent.COMPONENT_WEIGHT, + tensor_type=_TensorType.TENSORTYPE_INT_8, + ) + ) + updated_component_spec[_QuantizationComponent.COMPONENT_BIAS] = ( + _QuantizationComponentSpec( + quantization_component=_QuantizationComponent.COMPONENT_BIAS, + tensor_type=_TensorType.TENSORTYPE_INT_32, + ) + ) + elif ( + quant_method.preset_method + == _PresetMethod.METHOD_STATIC_RANGE_WEIGHT_ONLY_INT8 + ): + updated_component_spec[_QuantizationComponent.COMPONENT_WEIGHT] = ( + _QuantizationComponentSpec( + quantization_component=_QuantizationComponent.COMPONENT_WEIGHT, + tensor_type=_TensorType.TENSORTYPE_INT_8, + ) + ) + + # Override if quantization_component_spec is specified. + if quant_method.quantization_component_specs: + # Check if the component spec is supported configuration in TF-Quant. + for component_spec in quant_method.quantization_component_specs: + if component_spec.quantization_component in [ + _QuantizationComponent.COMPONENT_WEIGHT, + _QuantizationComponent.COMPONENT_ACTIVATION, + ]: + if component_spec.tensor_type != _TensorType.TENSORTYPE_INT_8: + raise ValueError( + 'Only int8 precision is supported for input operands.' + ) + else: + if component_spec.tensor_type != _TensorType.TENSORTYPE_INT_32: + raise ValueError('Only int32 precision is supported for bias.') + # Update with the custom spec. + updated_component_spec[component_spec.quantization_component] = ( + component_spec + ) + + # Update the componet spec + del quant_method.quantization_component_specs[:] + quant_method.quantization_component_specs.extend( + updated_component_spec.values() + ) + + if ( + quant_method.preset_method == _PresetMethod.METHOD_STATIC_RANGE_INT8 + or quant_method.preset_method == _PresetMethod.METHOD_DYNAMIC_RANGE_INT8 + ) and (len(quant_method.quantization_component_specs) != 3): + raise ValueError('Only 3 components are needed for', quant_method) + elif ( + quant_method.preset_method + == _PresetMethod.METHOD_STATIC_RANGE_WEIGHT_ONLY_INT8 + ) and len(quant_method.quantization_component_specs) != 1: + raise ValueError('At least one component spec needs to be specified.') + + +def _populate_unitwise_quantization_specs( + quantization_options: _QuantizationOptions, +) -> None: + """Verifies and pupulates unitwise quantization specs.""" + if not quantization_options.unit_wise_quantization_specs: + return + + sorted_top_level_component_specs = sorted( + quantization_options.quantization_method.quantization_component_specs, + key=lambda x: x.quantization_component, + ) + + for unitwise_spec in quantization_options.unit_wise_quantization_specs: + if not unitwise_spec.unit: + raise ValueError( + 'UnitWiseQuantizationSpec must contain at least one unit.' + ) + + for unit in unitwise_spec.unit: + if not unit.op_type and not unit.node_name: + raise ValueError('Either `op_type` or `node_name` must be specified.') + + _populate_quantization_component_spec(unitwise_spec.quantization_method) + + component_specs = ( + unitwise_spec.quantization_method.quantization_component_specs + ) + if component_specs and ( + sorted_top_level_component_specs + != sorted(component_specs, key=lambda x: x.quantization_component) + ): + raise ValueError( + 'Currently unit-wise quantization spec only supports NO_QUANTIZE and' + ' same quantization method as the top-level `quantization_method`' + ) + + +def _populate_calibration_options( + quantization_options: quant_opts_pb2.QuantizationOptions, +): + """Populates default values for CalibrationOptions. + + Args: + quantization_options: An instance of QuantizationOptions with a field + specifying CalibrationOptions + """ + + calib_opts = quantization_options.calibration_options + if ( + calib_opts.calibration_method + == _CalibrationMethod.CALIBRATION_METHOD_UNSPECIFIED + ): + calib_opts.calibration_method = ( + _CalibrationMethod.CALIBRATION_METHOD_MIN_MAX + ) + elif ( + calib_opts.calibration_method + == _CalibrationMethod.CALIBRATION_METHOD_HISTOGRAM_PERCENTILE + ): + if not calib_opts.calibration_parameters.initial_num_bins: + calib_opts.calibration_parameters.initial_num_bins = 256 + if not calib_opts.calibration_parameters.min_percentile: + calib_opts.calibration_parameters.min_percentile = 0.001 + if not calib_opts.calibration_parameters.max_percentile: + calib_opts.calibration_parameters.max_percentile = 99.999 + # Check the activation_tensor_type of HISTOGRAM_MSE methods. + elif calib_opts.calibration_method in [ + _CalibrationMethod.CALIBRATION_METHOD_HISTOGRAM_MSE_BRUTEFORCE, + _CalibrationMethod.CALIBRATION_METHOD_HISTOGRAM_MSE_MAX_FREQUENCY, + _CalibrationMethod.CALIBRATION_METHOD_HISTOGRAM_MSE_SYMMETRIC, + ]: + activation_tensor_type = ( + quantization_options.quantization_method.quantization_component_specs[ + _QuantizationComponent.COMPONENT_ACTIVATION + ].tensor_type + ) + # Unlike the HISTOGRAM_PERCENTILE method, the HISTOGRAM_MSE method uses + # num_bits because it actually quantizes and dequantizes values. + if activation_tensor_type != _TensorType.TENSORTYPE_INT_8: + raise ValueError( + 'Only TENSORTYPE_INT_8 is supported for HISTOGRAM_MSE calibration' + f' methods. calibration_method={calib_opts.calibration_method}' + ) + + if not calib_opts.calibration_parameters.initial_num_bins: + calib_opts.calibration_parameters.initial_num_bins = 256 + + +def _populate_quantization_options_default_values( + quantization_options: _QuantizationOptions, +) -> None: + """Populates default values for QuantizationOptions. + + Populates unspecified or unset fields of QuantizationOptions with the default + values. + + * If `op_set` is unspecified, it defaults to `OpSet.XLA`. + * If `freeze_all_variables` is not set, it defaults to `True`. + * Check if configurations are set correctly: + - Per-channel quantization is supported for Uniform Quantized opset only. + + Args: + quantization_options: An instance of QuantizationOptions. + """ + if quantization_options.op_set == quant_opts_pb2.OpSet.OP_SET_UNSPECIFIED: + quantization_options.op_set = quant_opts_pb2.OpSet.XLA + + if not quantization_options.tags: + quantization_options.tags.append(tag_constants.SERVING) + + if not quantization_options.signature_keys: + quantization_options.signature_keys.append( + signature_constants.DEFAULT_SERVING_SIGNATURE_DEF_KEY + ) + + if not quantization_options.HasField('freeze_all_variables'): + quantization_options.freeze_all_variables = True + + if quantization_options.enable_legacy_weight_only: + raise ValueError( + 'Legacy weight-only is deprecated. Use weight-only quantization method.' + ) + + # Check default quantization option values for weight-only quantization. + # TODO(b/242805842): Find good minimum_elements_for_weights number for server. + # please also update default value in tflite converter: + # tensorflow/compiler/mlir/lite/tf_to_tfl_flatbuffer.cc;l=201 + if ( + quantization_options.quantization_method.preset_method + == _PresetMethod.METHOD_STATIC_RANGE_WEIGHT_ONLY_INT8 + ) or ( + quantization_options.quantization_method.preset_method + == _PresetMethod.METHOD_DYNAMIC_RANGE_INT8 + ): + if quantization_options.min_num_elements_for_weights == 0: + quantization_options.min_num_elements_for_weights = ( + _DYNAMIC_RANGE_DEFAULT_MIN_NUM_ELEMENTS_FOR_WEIGHTS + ) + logging.warn( + ( + 'QuantizationOptions.min_num_elements_for_weights is not set (0).' + ' Setting to the default value: %d.' + ), + _DYNAMIC_RANGE_DEFAULT_MIN_NUM_ELEMENTS_FOR_WEIGHTS, + ) + + # TODO(b/281595329): Implement static range quantization per-channel support + if quantization_options.enable_per_channel_quantization and not ( + quantization_options.op_set == quant_opts_pb2.OpSet.UNIFORM_QUANTIZED + or quantization_options.quantization_method.preset_method + == _PresetMethod.METHOD_STATIC_RANGE_WEIGHT_ONLY_INT8 + ): + raise ValueError( + 'Currently, per-channel quantization is supported for Uniform ' + 'Quantized opset and Weight-only.' + ) + + if ( + quantization_options.quantization_method.preset_method + == _PresetMethod.METHOD_STATIC_RANGE_WEIGHT_ONLY_INT8 + and ( + quantization_options.op_set == quant_opts_pb2.OpSet.UNIFORM_QUANTIZED + or quantization_options.op_set == quant_opts_pb2.OpSet.TF + ) + ): + raise ValueError('TF/Uniform quantized opset does not support weight-only.') + + if (quantization_options.op_set == quant_opts_pb2.OpSet.STABLEHLO) and ( + quantization_options.quantization_method.preset_method + != _PresetMethod.METHOD_STATIC_RANGE_INT8 + ): + raise ValueError( + 'StableHLO quantized opset currently only supports static range' + ' quantization via TF Quantizer.' + ) + + # Converter assumes options are specified. So set SRQ explicitly. + if ( + quantization_options.quantization_method.preset_method + == _PresetMethod.METHOD_UNSPECIFIED + ): + logging.debug( + '"preset_method" for QuantizationMethod is not specified.' + 'Static range quantization is used by default.' + ) + quantization_options.quantization_method.preset_method = ( + _PresetMethod.METHOD_STATIC_RANGE_INT8 + ) + + if quantization_options.HasField('debugger_options'): + if not quantization_options.debugger_options.log_dir_path: + quantization_options.debugger_options.log_dir_path = '/tmp/dumps' + + if ( + quantization_options.debugger_options.debugger_type + == quant_opts_pb2.DebuggerOptions.DebuggerType.DEBUGGER_TYPE_UNSPECIFIED + ): + raise ValueError( + 'Debugger is enabled but debugger type was not specified.' + ) + + if ( + quantization_options.debugger_options.debugger_type + == quant_opts_pb2.DebuggerOptions.DebuggerType.DEBUGGER_TYPE_WHOLE_MODEL + and not quantization_options.debugger_options.unquantized_dump_model_path + ): + raise ValueError( + 'Debugger type whole model verify was used but' + ' unquantized_dump_model_path was not specified.' + ) + + # Check and populate quantization component spec. + _populate_quantization_component_spec( + quantization_options.quantization_method + ) + # Verify and populate unit-wise quantization specs. + _populate_unitwise_quantization_specs(quantization_options) + + if ( + quantization_options.quantization_method.preset_method + == _PresetMethod.METHOD_STATIC_RANGE_INT8 + ): + # Check and populate calibration options. + _populate_calibration_options(quantization_options) + + +@tf_export.tf_export('quantization.experimental.quantize_saved_model') +def quantize( + saved_model_path: str, + output_directory: Optional[str] = None, + quantization_options: Optional[_QuantizationOptions] = None, + representative_dataset: Optional[ + repr_dataset.RepresentativeDatasetOrMapping + ] = None, + *, + overwrite_output_directory: bool = False, +) -> autotrackable.AutoTrackable: + """Quantizes the SavedModel with the given quantization options. + + Example usage: + ```python + # Quantizing a model trained with QAT. + quantization_options = tf.quantization.experimental.QuantizationOptions( + signature_keys=['your_signature_key'], + ) + tf.quantization.experimental.quantize_saved_model( + '/tmp/input_model', + '/tmp/output_model', + quantization_options=quantization_options, + ) + + # When quantizing a model trained without QAT (Post-Training Quantization), + # a representative dataset is required. + representative_dataset = [{"input": tf.random.uniform(shape=(3, 3))} + for _ in range(256)] + tf.quantization.experimental.quantize_saved_model( + '/tmp/input_model', + '/tmp/output_model', + quantization_options=quantization_options, + representative_dataset={'your_signature_key': representative_dataset}, + ) + + # In addition to preset quantization methods, fine-grained control of + # quantization for each component is also supported. + _QuantizationComponentSpec = ( + tf.quantization.experimental.QuantizationComponentSpec + ) + quantization_options = tf.quantization.experimental.QuantizationOptions( + signature_keys=['your_signature_key'], + quantization_method=tf.quantization.experimental.QuantizationMethod( + quantization_component_specs=[ + _QuantizationComponentSpec( + quantization_component=( + _QuantizationComponentSpec.COMPONENT_ACTIVATION + ), + tensor_type=_QuantizationComponentSpec.TENSORTYPE_INT_8, + ) + ] + ) + ) + tf.quantization.experimental.quantize_saved_model( + '/tmp/input_model', + '/tmp/output_model', + quantization_options=quantization_options, + ) + ``` + + Args: + saved_model_path: Path to the saved model. When representative_dataset is + not provided, this should be a model trained with QAT. + output_directory: The path to save the output SavedModel. Set + `overwrite_output_directory` to `True` to overwrite any existing contents + in the directory if not empty. + quantization_options: A set of options for quantization. If None, it uses + post-training static range quantization with XLA opset by default. + representative_dataset: an iterator that returns a dictionary of {input_key: + input_value} or a map from signature key to a dictionary of {input_key: + input_value} that feeds calibration data for quantizing model. The + representative should be provided when the model is a PTQ model. It can be + provided either via this parameter or via the `representative_datasets` + field in `QuantizationOptions`. + overwrite_output_directory: If set to true, overwrites the output directory + iff it isn't empty. The default value is false. + + Returns: + A SavedModel object with TF quantization applied, or None if no quantization + is performed. + + Raises: + ValueError: When 1) representative_dataset is not provided for non QAT model + for enabling static range quantization, 2) invalid value is provided as + a quantization method, or 3) provide representative dataset via both + argument and QuantizationOptions. + ValueError: When the specified quantization method is not yet supported. + """ + _verify_output_dir(output_directory, overwrite_output_directory) + + # Set default values for None arguments. + if output_directory is None: + output_directory = tempfile.mkdtemp() + + if quantization_options is None: + quantization_options = _QuantizationOptions() + + _populate_quantization_options_default_values(quantization_options) + + if ( + representative_dataset is not None + and quantization_options.representative_datasets + ): + raise ValueError( + 'Do not specify both the `representative_dataset` argument and' + ' the `representative_datasets` field in `QuantizationOptions`.' + ) + + if quantization_options.representative_datasets: + representative_dataset = repr_dataset.RepresentativeDatasetLoader( + quantization_options.representative_datasets + ).load() + + method: _QuantizationMethod = quantization_options.quantization_method + if ( + method.preset_method == _PresetMethod.METHOD_STATIC_RANGE_INT8 + or method.preset_method == _PresetMethod.METHOD_NO_QUANTIZE + ): + return _static_range_quantize( + saved_model_path, + output_directory, + quantization_options, + representative_dataset, + ) + elif method.preset_method == _PresetMethod.METHOD_DYNAMIC_RANGE_INT8: + return _dynamic_range_quantize( + saved_model_path, + output_directory, + quantization_options, + ) + elif ( + method.preset_method == _PresetMethod.METHOD_STATIC_RANGE_WEIGHT_ONLY_INT8 + ): + return _weight_only_quantize( + saved_model_path, + output_directory, + quantization_options, + ) + else: + raise ValueError( + 'Quantization method {method.preset_method} is not supported.' + ) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/python/representative_dataset.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/python/representative_dataset.py new file mode 100644 index 0000000000000000000000000000000000000000..f3e8cc9d6bcb508c467ca51847cea7e78315009d --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/python/representative_dataset.py @@ -0,0 +1,304 @@ +# Copyright 2022 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. +# ============================================================================== +"""Defines types required for representative datasets for quantization.""" + +import collections.abc +import os +from typing import Iterable, Mapping, Optional, Union + +from tensorflow.compiler.mlir.quantization.tensorflow import quantization_options_pb2 +from tensorflow.python.client import session +from tensorflow.python.data.ops import readers +from tensorflow.python.eager import context +from tensorflow.python.framework import tensor_util +from tensorflow.python.lib.io import python_io +from tensorflow.python.platform import tf_logging as logging +from tensorflow.python.types import core +from tensorflow.python.util import tf_export + +# A representative sample is a map of: input_key -> input_value. +# Ex.: {'dense_input': tf.constant([1, 2, 3])} +# Ex.: {'x1': np.ndarray([4, 5, 6]} +RepresentativeSample = Mapping[str, core.TensorLike] + +# A representative dataset is an iterable of representative samples. +RepresentativeDataset = Iterable[RepresentativeSample] + +# A type representing a map from: signature key -> representative dataset. +# Ex.: {'serving_default': [tf.constant([1, 2, 3]), tf.constant([4, 5, 6])], +# 'other_signature_key': [tf.constant([[2, 2], [9, 9]])]} +RepresentativeDatasetMapping = Mapping[str, RepresentativeDataset] + +# A type alias expressing that it can be either a RepresentativeDataset or +# a mapping of signature key to RepresentativeDataset. +RepresentativeDatasetOrMapping = Union[ + RepresentativeDataset, RepresentativeDatasetMapping +] + +# Type aliases for quantization_options_pb2 messages. +_RepresentativeDataSample = quantization_options_pb2.RepresentativeDataSample +_RepresentativeDatasetFile = quantization_options_pb2.RepresentativeDatasetFile + + +class RepresentativeDatasetSaver: + """Representative dataset saver. + + Exposes a single method `save` that saves the provided representative dataset + into files. + + This is useful when you would like to keep a snapshot of your representative + dataset at a file system or when you need to pass the representative dataset + as files. + """ + + def save( + self, representative_dataset: RepresentativeDatasetMapping + ) -> Mapping[str, _RepresentativeDatasetFile]: + """Saves the representative dataset. + + Args: + representative_dataset: RepresentativeDatasetMapping which is a + signature_def_key -> representative dataset mapping. + """ + raise NotImplementedError('Method "save" is not implemented.') + + +@tf_export.tf_export( + 'quantization.experimental.TfRecordRepresentativeDatasetSaver' +) +class TfRecordRepresentativeDatasetSaver(RepresentativeDatasetSaver): + """Representative dataset saver in TFRecord format. + + Saves representative datasets for quantization calibration in TFRecord format. + The samples are serialized as `RepresentativeDataSample`. + + The `save` method return a signature key to `RepresentativeDatasetFile` map, + which can be used for QuantizationOptions. + + Example usage: + + ```python + # Creating the representative dataset. + representative_dataset = [{"input": tf.random.uniform(shape=(3, 3))} + for _ in range(256)] + + # Saving to a TFRecord file. + dataset_file_map = ( + tf.quantization.experimental.TfRecordRepresentativeDatasetSaver( + path_map={'serving_default': '/tmp/representative_dataset_path'} + ).save({'serving_default': representative_dataset}) + ) + + # Using in QuantizationOptions. + quantization_options = tf.quantization.experimental.QuantizationOptions( + signature_keys=['serving_default'], + representative_datasets=dataset_file_map, + ) + tf.quantization.experimental.quantize_saved_model( + '/tmp/input_model', + '/tmp/output_model', + quantization_options=quantization_options, + ) + ``` + """ + + def __init__(self, path_map: Mapping[str, os.PathLike[str]]): + """Initializes TFRecord represenatative dataset saver. + + Args: + path_map: Signature def key -> path mapping. Each path is a TFRecord file + to which a `RepresentativeDataset` is saved. The signature def keys + should be a subset of the `SignatureDef` keys of the + `representative_dataset` argument of the `save()` call. + """ + self.path_map: Mapping[str, os.PathLike[str]] = path_map + + def _save_tf_record_dataset( + self, + repr_ds: RepresentativeDataset, + signature_def_key: str, + ) -> _RepresentativeDatasetFile: + """Saves `repr_ds` to a TFRecord file. + + Each sample in `repr_ds` is serialized as `RepresentativeDataSample`. + + Args: + repr_ds: `RepresentativeDataset` to save. + signature_def_key: The signature def key associated with `repr_ds`. + + Returns: + a RepresentativeDatasetFile instance contains the path to the saved file. + """ + tfrecord_file_path = self.path_map[signature_def_key] + with python_io.TFRecordWriter(tfrecord_file_path) as writer: + for repr_sample in repr_ds: + sample = _RepresentativeDataSample() + for input_name, input_value in repr_sample.items(): + sample.tensor_proto_inputs[input_name].CopyFrom( + tensor_util.make_tensor_proto(input_value) + ) + + writer.write(sample.SerializeToString()) + + logging.info( + 'Saved representative dataset for signature def: %s to: %s', + signature_def_key, + tfrecord_file_path, + ) + return _RepresentativeDatasetFile( + tfrecord_file_path=str(tfrecord_file_path) + ) + + def save( + self, representative_dataset: RepresentativeDatasetMapping + ) -> Mapping[str, _RepresentativeDatasetFile]: + """Saves the representative dataset. + + Args: + representative_dataset: Signature def key -> representative dataset + mapping. Each dataset is saved in a separate TFRecord file whose path + matches the signature def key of `path_map`. + + Raises: + ValueError: When the signature def key in `representative_dataset` is not + present in the `path_map`. + + Returns: + A map from signature key to the RepresentativeDatasetFile instance + contains the path to the saved file. + """ + dataset_file_map = {} + for signature_def_key, repr_ds in representative_dataset.items(): + if signature_def_key not in self.path_map: + raise ValueError( + 'SignatureDef key does not exist in the provided path_map:' + f' {signature_def_key}' + ) + + dataset_file_map[signature_def_key] = self._save_tf_record_dataset( + repr_ds, signature_def_key + ) + return dataset_file_map + + +class RepresentativeDatasetLoader: + """Representative dataset loader. + + Exposes the `load` method that loads the representative dataset from files. + """ + + def __init__( + self, + dataset_file_map: Mapping[str, _RepresentativeDatasetFile], + ) -> None: + """Initializes TFRecord represenatative dataset loader. + + Args: + dataset_file_map: Signature key -> `RepresentativeDatasetFile` mapping. + + Raises: + DecodeError: If the sample is not RepresentativeDataSample. + """ + self.dataset_file_map = dataset_file_map + + def _load_tf_record(self, tf_record_path: str) -> RepresentativeDataset: + """Loads TFRecord containing samples of type`RepresentativeDataSample`.""" + samples = [] + with context.eager_mode(): + for sample_bytes in readers.TFRecordDatasetV2(filenames=[tf_record_path]): + sample_proto = _RepresentativeDataSample.FromString( + sample_bytes.numpy() + ) + sample = {} + for input_key, tensor_proto in sample_proto.tensor_proto_inputs.items(): + sample[input_key] = tensor_util.MakeNdarray(tensor_proto) + samples.append(sample) + return samples + + def load(self) -> RepresentativeDatasetMapping: + """Loads the representative datasets. + + Returns: + representative dataset mapping: A signature def key -> representative + mapping. The loader loads `RepresentativeDataset` for each path in + `self.dataset_file_map` and associates the loaded dataset to the + corresponding signature def key. + """ + repr_dataset_map = {} + for signature_def_key, dataset_file in self.dataset_file_map.items(): + if dataset_file.HasField('tfrecord_file_path'): + repr_dataset_map[signature_def_key] = self._load_tf_record( + dataset_file.tfrecord_file_path + ) + else: + raise ValueError('Unsupported Representative Dataset filetype') + + return repr_dataset_map + + +def replace_tensors_by_numpy_ndarrays( + repr_ds: RepresentativeDataset, sess: session.Session +) -> RepresentativeDataset: + """Replaces tf.Tensors in samples by their evaluated numpy arrays. + + Note: This should be run in graph mode (default in TF1) only. + + Args: + repr_ds: Representative dataset to replace the tf.Tensors with their + evaluated values. `repr_ds` is iterated through, so it may not be reusable + (e.g. if it is a generator object). + sess: Session instance used to evaluate tf.Tensors. + + Returns: + The new representative dataset where each tf.Tensor is replaced by its + evaluated numpy ndarrays. + """ + new_repr_ds = [] + for sample in repr_ds: + new_sample = {} + for input_key, input_data in sample.items(): + # Evaluate the Tensor to get the actual value. + if isinstance(input_data, core.Tensor): + input_data = input_data.eval(session=sess) + + new_sample[input_key] = input_data + + new_repr_ds.append(new_sample) + return new_repr_ds + + +def get_num_samples(repr_ds: RepresentativeDataset) -> Optional[int]: + """Returns the number of samples if known. + + Args: + repr_ds: Representative dataset. + + Returns: + Returns the total number of samples in `repr_ds` if it can be determined + without iterating the entier dataset. Returns None iff otherwise. When it + returns None it does not mean the representative dataset is infinite or it + is malformed; it simply means the size cannot be determined without + iterating the whole dataset. + """ + if isinstance(repr_ds, collections.abc.Sized): + try: + return len(repr_ds) + except Exception as ex: # pylint: disable=broad-except + # There are some cases where calling __len__() raises an exception. + # Handle this as if the size is unknown. + logging.info('Cannot determine the size of the dataset (%s).', ex) + return None + else: + return None diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/python/save_model.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/python/save_model.py new file mode 100644 index 0000000000000000000000000000000000000000..4b4ac4f65fe157de6c58624eafa9af0298f0d2a4 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/python/save_model.py @@ -0,0 +1,343 @@ +# Copyright 2022 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. +# ============================================================================== +"""Defines utilities involving SavedModel.""" +from typing import Collection, Dict, Mapping, Optional, Sequence + +from absl import logging + +# pylint: disable=g-importing-member +from google.protobuf.any_pb2 import Any +# pylint: enable=g-importing-member +from tensorflow.core.framework import graph_pb2 +from tensorflow.core.protobuf import meta_graph_pb2 +from tensorflow.core.protobuf import saver_pb2 +from tensorflow.python.client import session +from tensorflow.python.framework import importer +from tensorflow.python.framework import ops +from tensorflow.python.lib.io import file_io +from tensorflow.python.saved_model import builder +from tensorflow.python.saved_model import constants as saved_model_constants +from tensorflow.python.saved_model import loader_impl as saved_model_loader +from tensorflow.python.saved_model import tag_constants +from tensorflow.python.training import saver + +# Mapping of signature def key -> SignatureDef. +_SignatureDefMap = Mapping[str, meta_graph_pb2.SignatureDef] + + +def get_signatures_from_saved_model( + saved_model_path: str, + signature_keys: Optional[Sequence[str]] = None, + tags: Optional[Collection[str]] = None, +) -> Dict[str, meta_graph_pb2.SignatureDef]: + """Gets a map from signature keys to their SignatureDef. + + Args: + saved_model_path: Path to the saved model. + signature_keys: List of keys identifying SignatureDef to retrieve. If None, + retrieve all except the init signature. + tags: Set of tags identifying the MetaGraphDef within the SavedModel. + + Returns: + A map from signature_key to its SignatureDef. + """ + if tags is None: + tags = {tag_constants.SERVING} + + loader = saved_model_loader.SavedModelLoader(saved_model_path) + meta_graphdef = loader.get_meta_graph_def_from_tags(tags) + signatures = {} + for key, signature_def in meta_graphdef.signature_def.items(): + if key == saved_model_constants.INIT_OP_SIGNATURE_KEY: + continue + if signature_keys is not None and key not in signature_keys: + continue + signatures[key] = signature_def + + return signatures + + +def _restore_output_tensor_names( + graph_def: graph_pb2.GraphDef, +) -> graph_pb2.GraphDef: + """Restores the output tensor names of the converted model. + + During the conversion, the output tensor names of the original model are + embedded in the `tf_saved_model.index_path` attribute of the RetVal nodes and + might become the name of Retval nodes as well (with an index suffix if there + are multiple output tensors from one node). Since Retval nodes are not used in + SavedModel, this function removes them and restore the names to the actual + output tensors. + + Args: + graph_def: the converted GraphDef. + + Returns: + The GraphDef with Retval nodes removed and output tensor names restored. + """ + output_renaming_map = {} + with session.Session(graph=ops.Graph()): + importer.import_graph_def(graph_def, name='') + graph = ops.get_default_graph() + for op in graph.get_operations(): + if op.type == '_Retval': + expected_node_name = op.name + if op.get_attr('tf_saved_model.index_path') is not None: + index_path_name = op.get_attr('tf_saved_model.index_path')[0] + index_path_name = index_path_name.decode('utf-8').split(':')[0] + try: + # Only use the index_path name if it points to a Retval node. + index_path_node = graph.get_operation_by_name(index_path_name) + if index_path_node.type == '_Retval': + expected_node_name = index_path_name + except KeyError: + pass + retval_input_node_name = op.inputs[0].op.name + output_renaming_map[retval_input_node_name] = expected_node_name + + for node in reversed(graph_def.node): + if node.name in output_renaming_map: + node.name = output_renaming_map[node.name] + elif node.op == '_Retval': + graph_def.node.remove(node) + else: + # Update the inputs referring to the pre-renaming node. + for idx, input_name in enumerate(node.input): + if input_name in output_renaming_map: + node.input[idx] = output_renaming_map[input_name] + # Update the control inputs referring to the pre-renaming node. + updating_inputs = [] + for input_name in reversed(node.input): + if input_name.startswith('^') and input_name[1:] in output_renaming_map: + updating_inputs.append(input_name[1:]) + node.input.remove(input_name) + for updating_input in updating_inputs: + node.input.append('^' + output_renaming_map[updating_input]) + return graph_def + + +def _create_empty_output_dir(output_directory: str) -> None: + """Creates the `output_directory`. + + If `output_directory` already exists, it recursively deletes all contents + inside the directory. + + Also creates the parent & intermediate directories. + + Args: + output_directory: Output directory. + """ + if file_io.file_exists_v2(output_directory): + logging.info( + 'Deleting existing directory for quantized model output: %s .', + output_directory, + ) + file_io.delete_recursively_v2(output_directory) + + file_io.recursive_create_dir_v2(output_directory) + + +def _validate_signatures( + signature_def_map: _SignatureDefMap, exported_graph: ops.Graph +) -> _SignatureDefMap: + """Validates if the tensor names in signatures are consistent with the graph. + + This function checks if the input and output tensor names in the signatures + exist if the graph. The output tensor names might change during conversion, + we try to fix that with `_restore_output_tensor_names`. Besides, if there + are duplicated tensor names, they we will be prefixed with the signature name. + However, if that doesn't work the signatures can't be used with the converted + graph. + + Args: + signature_def_map: the signatures to validate. + exported_graph: The PTQ-exported GraphDef. + + Returns: + The signatures with tensor names prefixed with signature name if necessary. + + Raises: + ValueError: Iff the signatures are not consistent with the graph. + """ + for signature_key, signature_def in signature_def_map.items(): + for tensor_info in signature_def.inputs.values(): + try: + exported_graph.get_tensor_by_name(tensor_info.name) + except KeyError as exc: + try: + prefixed_name = signature_key + '_' + tensor_info.name + exported_graph.get_tensor_by_name(prefixed_name) + tensor_info.name = prefixed_name + except KeyError: + raise ValueError( + 'Cannot find the input tensor with name %s in the graph.' + % tensor_info.name + ) from exc + + for tensor_info in signature_def.outputs.values(): + try: + exported_graph.get_tensor_by_name(tensor_info.name) + except KeyError as exc: + try: + prefixed_name = signature_key + '_' + tensor_info.name + exported_graph.get_tensor_by_name(prefixed_name) + tensor_info.name = prefixed_name + except KeyError: + raise ValueError( + 'Cannot find the output tensor with name %s in the graph.' + % tensor_info.name + ) from exc + + return signature_def_map + + +def _find_op( + graph: ops.Graph, op_name: Optional[str] +) -> Optional[ops.Operation]: + """Finds the operation with `op_name`. + + Args: + graph: The graph to find from. + op_name: Name of the node. + + Returns: + The operation that corresponds to `op_name`. Returns None iff op_name is an + empty string or None. + + Raises: + ValueError: `op_name` is malformed. + """ + if not op_name: + return None + + init_op = graph.get_operation_by_name(op_name) + logging.debug('Op found in the graph: %s', op_name) + + return init_op + + +def _save_function_alias( + saved_model_dir: str, + tags: Collection[str], + function_aliases: Mapping[str, str], +) -> None: + """Saves the function alias to the SavedModel. + + SavedModelBuilder (TF1 saved model saver) does not support saving function + aliases, so this function loads the SavedModel proto and adds the + `function_aliases` field. + + Args: + saved_model_dir: Path to the saved model directory. + tags: A collection of tags to specify the meta graph. + function_aliases: Function name -> function alias mapping. + """ + loader = saved_model_loader.SavedModelLoader(saved_model_dir) + meta_graph_def = loader.get_meta_graph_def_from_tags(tags) + + for function_name, function_alias in function_aliases.items(): + meta_graph_def.meta_info_def.function_aliases[function_name] = ( + function_alias + ) + + saved_model_proto_serialized = loader.saved_model.SerializeToString() + + # TODO(b/266015731): Also update and set the SavedModel fingerprint. + path = file_io.join( + saved_model_dir, saved_model_constants.SAVED_MODEL_FILENAME_PB + ) + file_io.atomic_write_string_to_file(path, saved_model_proto_serialized) + + +def save_model_v1( + graph_def: graph_pb2.GraphDef, + output_dir: str, + signature_def_map: _SignatureDefMap, + tags: Collection[str], + init_op_name: Optional[str] = None, + saver_def: Optional[saver_pb2.SaverDef] = None, + checkpoint_dir: Optional[str] = None, + function_aliases: Optional[Mapping[str, str]] = None, + asset_file_defs: Sequence[meta_graph_pb2.AssetFileDef] = (), +) -> None: + """Saves the model. + + Saves the provided graph def as SavedModel. + Uses TF1 SavedModel semantics (i.e. no object graph). + + Args: + graph_def: Graph to save. + output_dir: Output directory for the SavedModel. + signature_def_map: Mapping of signature def key -> SignatureDef. + tags: Tags for the meta graph def. + init_op_name: Name of the node for initialization. + saver_def: `saver_pb2.SaverDef` to create a `saver.Saver` from. The created + saver will be used to save and load variables. This may be `None` if no + variables exist in the graph. + checkpoint_dir: Path to checkpoint file where variable values are saved. + function_aliases: Function name -> function alias mapping. + asset_file_defs: `AssetFileDef`s that associates the asset files and the + name of the tensors to which the asset file names should be fed. The + caller should make sure the asset files exist in the output saved model + directory. + + Raises: + ValueError iff the graph does not contain a valid signature or the file + prefix tensor is not found in the graph. + """ + _create_empty_output_dir(output_dir) + v1_builder = builder.SavedModelBuilder(output_dir) + + graph_def = _restore_output_tensor_names(graph_def) + with session.Session(graph=ops.Graph()) as sess: + importer.import_graph_def(graph_def, name='') + + signature_def_map = _validate_signatures( + signature_def_map, ops.get_default_graph() + ) + + # Add `AssetFileDef`s to the collection so that correct values are fed to + # the tensors that accept asset file paths. + for asset_file_def in asset_file_defs: + asset_any_proto = Any() + asset_any_proto.Pack(asset_file_def) + ops.add_to_collection( + saved_model_constants.ASSETS_KEY, + asset_any_proto, + ) + + model_saver = None + # If `saver_def` is not None, it means there are variables in the graph. + if saver_def: + model_saver = saver.Saver(saver_def=saver_def) + logging.info('Saver created with SaverDef: %s', saver_def) + + # Variables should be restored once before exporting as saved model + # because the variables are not initialized when the GraphDef was + # imported. + model_saver.restore(sess, checkpoint_dir) + + v1_builder.add_meta_graph_and_variables( + sess, + tags, + signature_def_map=signature_def_map, + main_op=_find_op(sess.graph, op_name=init_op_name), + saver=model_saver, + ) + + v1_builder.save() + + if function_aliases: + _save_function_alias(output_dir, tags, function_aliases) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/quantization_options_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/quantization_options_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..f7acc3afca5b47d19999b84c4310d735963279ad --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/quantization_options_pb2.py @@ -0,0 +1,65 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/compiler/mlir/quantization/tensorflow/quantization_options.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\nKtensorflow/compiler/mlir/quantization/tensorflow/quantization_options.proto\x12\x17tensorflow.quantization\x1a&tensorflow/core/framework/tensor.proto\"\xed\x02\n\x12QuantizationMethod\x12O\n\rpreset_method\x18\x04 \x01(\x0e\x32\x38.tensorflow.quantization.QuantizationMethod.PresetMethod\x12X\n\x1cquantization_component_specs\x18\x03 \x03(\x0b\x32\x32.tensorflow.quantization.QuantizationComponentSpec\"\xa5\x01\n\x0cPresetMethod\x12\x16\n\x12METHOD_UNSPECIFIED\x10\x00\x12\x16\n\x12METHOD_NO_QUANTIZE\x10\x01\x12\x1c\n\x18METHOD_STATIC_RANGE_INT8\x10\x02\x12\x1d\n\x19METHOD_DYNAMIC_RANGE_INT8\x10\x03\x12(\n$METHOD_STATIC_RANGE_WEIGHT_ONLY_INT8\x10\x04J\x04\x08\x01\x10\x03\"\xbe\x03\n\x19QuantizationComponentSpec\x12h\n\x16quantization_component\x18\x01 \x01(\x0e\x32H.tensorflow.quantization.QuantizationComponentSpec.QuantizationComponent\x12R\n\x0btensor_type\x18\x02 \x01(\x0e\x32=.tensorflow.quantization.QuantizationComponentSpec.TensorType\"v\n\x15QuantizationComponent\x12\x19\n\x15\x43OMPONENT_UNSPECIFIED\x10\x00\x12\x18\n\x14\x43OMPONENT_ACTIVATION\x10\x01\x12\x14\n\x10\x43OMPONENT_WEIGHT\x10\x02\x12\x12\n\x0e\x43OMPONENT_BIAS\x10\x03\"k\n\nTensorType\x12\x1a\n\x16TENSORTYPE_UNSPECIFIED\x10\x00\x12\x14\n\x10TENSORTYPE_INT_4\x10\x01\x12\x14\n\x10TENSORTYPE_INT_8\x10\x02\x12\x15\n\x11TENSORTYPE_INT_32\x10\x03\"\x87\x02\n\x18UnitWiseQuantizationSpec\x12P\n\x04unit\x18\x05 \x03(\x0b\x32\x42.tensorflow.quantization.UnitWiseQuantizationSpec.QuantizationUnit\x12H\n\x13quantization_method\x18\x06 \x01(\x0b\x32+.tensorflow.quantization.QuantizationMethod\x1aI\n\x10QuantizationUnit\x12\x0f\n\x07op_type\x18\x01 \x01(\t\x12\x11\n\tnode_name\x18\x02 \x01(\t\x12\x11\n\tfunc_name\x18\x03 \x01(\tJ\x04\x08\x01\x10\x05\"\xf9\x04\n\x12\x43\x61librationOptions\x12Y\n\x12\x63\x61libration_method\x18\x01 \x01(\x0e\x32=.tensorflow.quantization.CalibrationOptions.CalibrationMethod\x12\x61\n\x16\x63\x61libration_parameters\x18\x02 \x01(\x0b\x32\x41.tensorflow.quantization.CalibrationOptions.CalibrationParameters\x1a\x61\n\x15\x43\x61librationParameters\x12\x18\n\x10initial_num_bins\x18\x01 \x01(\x05\x12\x16\n\x0emin_percentile\x18\x02 \x01(\x02\x12\x16\n\x0emax_percentile\x18\x03 \x01(\x02\"\xc1\x02\n\x11\x43\x61librationMethod\x12\"\n\x1e\x43\x41LIBRATION_METHOD_UNSPECIFIED\x10\x00\x12\x1e\n\x1a\x43\x41LIBRATION_METHOD_MIN_MAX\x10\x01\x12&\n\"CALIBRATION_METHOD_AVERAGE_MIN_MAX\x10\x02\x12+\n\'CALIBRATION_METHOD_HISTOGRAM_PERCENTILE\x10\x03\x12/\n+CALIBRATION_METHOD_HISTOGRAM_MSE_BRUTEFORCE\x10\x04\x12\x32\n.CALIBRATION_METHOD_HISTOGRAM_MSE_MAX_FREQUENCY\x10\x05\x12.\n*CALIBRATION_METHOD_HISTOGRAM_MSE_SYMMETRIC\x10\x06\"\xd4\x01\n\x18RepresentativeDataSample\x12\x65\n\x13tensor_proto_inputs\x18\x02 \x03(\x0b\x32H.tensorflow.quantization.RepresentativeDataSample.TensorProtoInputsEntry\x1aQ\n\x16TensorProtoInputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.tensorflow.TensorProto:\x02\x38\x01\"I\n\x19RepresentativeDatasetFile\x12\x1c\n\x12tfrecord_file_path\x18\x01 \x01(\tH\x00\x42\x0e\n\x0c\x64\x61taset_file\"\x85\x02\n\x0f\x44\x65\x62uggerOptions\x12L\n\rdebugger_type\x18\x01 \x01(\x0e\x32\x35.tensorflow.quantization.DebuggerOptions.DebuggerType\x12#\n\x1bunquantized_dump_model_path\x18\x02 \x01(\t\x12\x14\n\x0clog_dir_path\x18\x03 \x01(\t\"i\n\x0c\x44\x65\x62uggerType\x12\x1d\n\x19\x44\x45\x42UGGER_TYPE_UNSPECIFIED\x10\x00\x12\x1d\n\x19\x44\x45\x42UGGER_TYPE_WHOLE_MODEL\x10\x01\x12\x1b\n\x17\x44\x45\x42UGGER_TYPE_PER_LAYER\x10\x02\"\xa5\x07\n\x13QuantizationOptions\x12H\n\x13quantization_method\x18\x01 \x01(\x0b\x32+.tensorflow.quantization.QuantizationMethod\x12.\n\x06op_set\x18\x02 \x01(\x0e\x32\x1e.tensorflow.quantization.OpSet\x12W\n\x1cunit_wise_quantization_specs\x18\x11 \x03(\x0b\x32\x31.tensorflow.quantization.UnitWiseQuantizationSpec\x12\x0c\n\x04tags\x18\x05 \x03(\t\x12\x16\n\x0esignature_keys\x18\x06 \x03(\t\x12i\n\x17representative_datasets\x18\x07 \x03(\x0b\x32H.tensorflow.quantization.QuantizationOptions.RepresentativeDatasetsEntry\x12$\n\x1cmin_num_elements_for_weights\x18\x08 \x01(\x03\x12!\n\x14\x66reeze_all_variables\x18\t \x01(\x08H\x00\x88\x01\x01\x12\'\n\x1f\x65nable_per_channel_quantization\x18\n \x01(\x08\x12 \n\x18\x65nable_two_input_tensors\x18\x0b \x01(\x08\x12-\n%experimental_enable_tpu_model_support\x18\x0c \x01(\x08\x12!\n\x19\x65nable_legacy_weight_only\x18\r \x01(\x08\x12$\n\x1c\x66orce_graph_mode_calibration\x18\x0e \x01(\x08\x12H\n\x13\x63\x61libration_options\x18\x0f \x01(\x0b\x32+.tensorflow.quantization.CalibrationOptions\x12\x42\n\x10\x64\x65\x62ugger_options\x18\x10 \x01(\x0b\x32(.tensorflow.quantization.DebuggerOptions\x1aq\n\x1bRepresentativeDatasetsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x41\n\x05value\x18\x02 \x01(\x0b\x32\x32.tensorflow.quantization.RepresentativeDatasetFile:\x02\x38\x01\x42\x17\n\x15_freeze_all_variablesJ\x04\x08\x03\x10\x04*V\n\x05OpSet\x12\x16\n\x12OP_SET_UNSPECIFIED\x10\x00\x12\x06\n\x02TF\x10\x01\x12\x07\n\x03XLA\x10\x02\x12\x15\n\x11UNIFORM_QUANTIZED\x10\x03\x12\r\n\tSTABLEHLO\x10\x04\x42\x03\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.compiler.mlir.quantization.tensorflow.quantization_options_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\370\001\001' + _REPRESENTATIVEDATASAMPLE_TENSORPROTOINPUTSENTRY._options = None + _REPRESENTATIVEDATASAMPLE_TENSORPROTOINPUTSENTRY._serialized_options = b'8\001' + _QUANTIZATIONOPTIONS_REPRESENTATIVEDATASETSENTRY._options = None + _QUANTIZATIONOPTIONS_REPRESENTATIVEDATASETSENTRY._serialized_options = b'8\001' + _OPSET._serialized_start=3353 + _OPSET._serialized_end=3439 + _QUANTIZATIONMETHOD._serialized_start=145 + _QUANTIZATIONMETHOD._serialized_end=510 + _QUANTIZATIONMETHOD_PRESETMETHOD._serialized_start=339 + _QUANTIZATIONMETHOD_PRESETMETHOD._serialized_end=504 + _QUANTIZATIONCOMPONENTSPEC._serialized_start=513 + _QUANTIZATIONCOMPONENTSPEC._serialized_end=959 + _QUANTIZATIONCOMPONENTSPEC_QUANTIZATIONCOMPONENT._serialized_start=732 + _QUANTIZATIONCOMPONENTSPEC_QUANTIZATIONCOMPONENT._serialized_end=850 + _QUANTIZATIONCOMPONENTSPEC_TENSORTYPE._serialized_start=852 + _QUANTIZATIONCOMPONENTSPEC_TENSORTYPE._serialized_end=959 + _UNITWISEQUANTIZATIONSPEC._serialized_start=962 + _UNITWISEQUANTIZATIONSPEC._serialized_end=1225 + _UNITWISEQUANTIZATIONSPEC_QUANTIZATIONUNIT._serialized_start=1146 + _UNITWISEQUANTIZATIONSPEC_QUANTIZATIONUNIT._serialized_end=1219 + _CALIBRATIONOPTIONS._serialized_start=1228 + _CALIBRATIONOPTIONS._serialized_end=1861 + _CALIBRATIONOPTIONS_CALIBRATIONPARAMETERS._serialized_start=1440 + _CALIBRATIONOPTIONS_CALIBRATIONPARAMETERS._serialized_end=1537 + _CALIBRATIONOPTIONS_CALIBRATIONMETHOD._serialized_start=1540 + _CALIBRATIONOPTIONS_CALIBRATIONMETHOD._serialized_end=1861 + _REPRESENTATIVEDATASAMPLE._serialized_start=1864 + _REPRESENTATIVEDATASAMPLE._serialized_end=2076 + _REPRESENTATIVEDATASAMPLE_TENSORPROTOINPUTSENTRY._serialized_start=1995 + _REPRESENTATIVEDATASAMPLE_TENSORPROTOINPUTSENTRY._serialized_end=2076 + _REPRESENTATIVEDATASETFILE._serialized_start=2078 + _REPRESENTATIVEDATASETFILE._serialized_end=2151 + _DEBUGGEROPTIONS._serialized_start=2154 + _DEBUGGEROPTIONS._serialized_end=2415 + _DEBUGGEROPTIONS_DEBUGGERTYPE._serialized_start=2310 + _DEBUGGEROPTIONS_DEBUGGERTYPE._serialized_end=2415 + _QUANTIZATIONOPTIONS._serialized_start=2418 + _QUANTIZATIONOPTIONS._serialized_end=3351 + _QUANTIZATIONOPTIONS_REPRESENTATIVEDATASETSENTRY._serialized_start=3207 + _QUANTIZATIONOPTIONS_REPRESENTATIVEDATASETSENTRY._serialized_end=3320 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/stablehlo/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/stablehlo/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/stablehlo/stablehlo.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/stablehlo/stablehlo.py new file mode 100644 index 0000000000000000000000000000000000000000..64c3f1b7be30734d5066a0bcc3f372edaf39dad9 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/stablehlo/stablehlo.py @@ -0,0 +1,26 @@ +# Copyright 2023 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. +# ============================================================================== +"""StableHLO Portable Python APIs. + +This setup only exports the the StableHLO Portable C++ APIs, which have +signatures that do not rely on MLIR classes. + +Exporting all of MLIR Python bindings to TF OSS has high maintenance +implications, especially given the frequency that TF updates the revision of +LLVM used. +""" + +# pylint: disable=wildcard-import +from .stablehlo_extension import * diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/tensorflow/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/tensorflow/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/tensorflow/gen_mlir_passthrough_op.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/tensorflow/gen_mlir_passthrough_op.py new file mode 100644 index 0000000000000000000000000000000000000000..63f02ed16b5af0796dfc14c306e532af941fba3a --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/mlir/tensorflow/gen_mlir_passthrough_op.py @@ -0,0 +1,127 @@ +"""Python wrappers around TensorFlow ops. + +This file is MACHINE GENERATED! Do not edit. +""" + +import collections + +from tensorflow.python import pywrap_tfe as pywrap_tfe +from tensorflow.python.eager import context as _context +from tensorflow.python.eager import core as _core +from tensorflow.python.eager import execute as _execute +from tensorflow.python.framework import dtypes as _dtypes +from tensorflow.security.fuzzing.py import annotation_types as _atypes + +from tensorflow.python.framework import op_def_registry as _op_def_registry +from tensorflow.python.framework import ops as _ops +from tensorflow.python.framework import op_def_library as _op_def_library +from tensorflow.python.util.deprecation import deprecated_endpoints +from tensorflow.python.util import dispatch as _dispatch +from tensorflow.python.util.tf_export import tf_export + +from typing import TypeVar, List, Any +from typing_extensions import Annotated + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('mlir_passthrough_op') +def mlir_passthrough_op(inputs, mlir_module: str, Toutputs, name=None): + r"""TODO: add doc. + + Args: + inputs: A list of `Tensor` objects. + mlir_module: A `string`. + Toutputs: A list of `tf.DTypes`. + name: A name for the operation (optional). + + Returns: + A list of `Tensor` objects of type `Toutputs`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "MlirPassthroughOp", name, inputs, "mlir_module", mlir_module, + "Toutputs", Toutputs) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_mlir_passthrough_op( + (inputs, mlir_module, Toutputs, name,), None) + if _result is not NotImplemented: + return _result + return mlir_passthrough_op_eager_fallback( + inputs, mlir_module=mlir_module, Toutputs=Toutputs, name=name, + ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + mlir_passthrough_op, (), dict(inputs=inputs, + mlir_module=mlir_module, + Toutputs=Toutputs, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_mlir_passthrough_op( + (inputs, mlir_module, Toutputs, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + mlir_module = _execute.make_str(mlir_module, "mlir_module") + if not isinstance(Toutputs, (list, tuple)): + raise TypeError( + "Expected list for 'Toutputs' argument to " + "'mlir_passthrough_op' Op, not %r." % Toutputs) + Toutputs = [_execute.make_type(_t, "Toutputs") for _t in Toutputs] + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "MlirPassthroughOp", inputs=inputs, mlir_module=mlir_module, + Toutputs=Toutputs, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + mlir_passthrough_op, (), dict(inputs=inputs, + mlir_module=mlir_module, + Toutputs=Toutputs, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("mlir_module", _op.get_attr("mlir_module"), "Tinputs", + _op.get_attr("Tinputs"), "Toutputs", _op.get_attr("Toutputs")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "MlirPassthroughOp", _inputs_flat, _attrs, _result) + return _result + +MlirPassthroughOp = tf_export("raw_ops.MlirPassthroughOp")(_ops.to_raw_op(mlir_passthrough_op)) +_dispatcher_for_mlir_passthrough_op = mlir_passthrough_op._tf_type_based_dispatcher.Dispatch + + +def mlir_passthrough_op_eager_fallback(inputs, mlir_module: str, Toutputs, name, ctx): + mlir_module = _execute.make_str(mlir_module, "mlir_module") + if not isinstance(Toutputs, (list, tuple)): + raise TypeError( + "Expected list for 'Toutputs' argument to " + "'mlir_passthrough_op' Op, not %r." % Toutputs) + Toutputs = [_execute.make_type(_t, "Toutputs") for _t in Toutputs] + _attr_Tinputs, inputs = _execute.convert_to_mixed_eager_tensors(inputs, ctx) + _inputs_flat = list(inputs) + _attrs = ("mlir_module", mlir_module, "Tinputs", _attr_Tinputs, "Toutputs", + Toutputs) + _result = _execute.execute(b"MlirPassthroughOp", len(Toutputs), + inputs=_inputs_flat, attrs=_attrs, ctx=ctx, + name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "MlirPassthroughOp", _inputs_flat, _attrs, _result) + return _result + diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/tf2tensorrt/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/tf2tensorrt/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/tf2tensorrt/_pywrap_py_utils.pyi b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/tf2tensorrt/_pywrap_py_utils.pyi new file mode 100644 index 0000000000000000000000000000000000000000..1ef7abbd7d14b6cc491ad6b7f07dc371ae019141 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/tf2tensorrt/_pywrap_py_utils.pyi @@ -0,0 +1,19 @@ +# Copyright 2023 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. +# ============================================================================== + +def get_linked_tensorrt_version() -> tuple[int,int,int]: ... +def get_loaded_tensorrt_version() -> tuple[int,int,int]: ... +def get_registered_op_converters() -> list[str]: ... +def is_tensorrt_enabled() -> bool: ... diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/tf2tensorrt/ops/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/tf2tensorrt/ops/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/tf2tensorrt/ops/gen_trt_ops.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/tf2tensorrt/ops/gen_trt_ops.py new file mode 100644 index 0000000000000000000000000000000000000000..a792cd613ef2d65a9878a6b29344d9fd9dd11bbe --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/tf2tensorrt/ops/gen_trt_ops.py @@ -0,0 +1,713 @@ +"""Python wrappers around TensorFlow ops. + +This file is MACHINE GENERATED! Do not edit. +""" + +import collections + +from tensorflow.python import pywrap_tfe as pywrap_tfe +from tensorflow.python.eager import context as _context +from tensorflow.python.eager import core as _core +from tensorflow.python.eager import execute as _execute +from tensorflow.python.framework import dtypes as _dtypes +from tensorflow.security.fuzzing.py import annotation_types as _atypes + +from tensorflow.python.framework import op_def_registry as _op_def_registry +from tensorflow.python.framework import ops as _ops +from tensorflow.python.framework import op_def_library as _op_def_library +from tensorflow.python.util.deprecation import deprecated_endpoints +from tensorflow.python.util import dispatch as _dispatch +from tensorflow.python.util.tf_export import tf_export + +from typing import TypeVar, List, Any +from typing_extensions import Annotated + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('create_trt_resource_handle') +def create_trt_resource_handle(resource_name: str, name=None) -> Annotated[Any, _atypes.Resource]: + r"""TODO: add doc. + + Args: + resource_name: A `string`. + name: A name for the operation (optional). + + Returns: + A `Tensor` of type `resource`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "CreateTRTResourceHandle", name, "resource_name", resource_name) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_create_trt_resource_handle( + (resource_name, name,), None) + if _result is not NotImplemented: + return _result + return create_trt_resource_handle_eager_fallback( + resource_name=resource_name, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + create_trt_resource_handle, (), dict(resource_name=resource_name, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_create_trt_resource_handle( + (resource_name, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + resource_name = _execute.make_str(resource_name, "resource_name") + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "CreateTRTResourceHandle", resource_name=resource_name, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + create_trt_resource_handle, (), dict(resource_name=resource_name, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("resource_name", _op.get_attr("resource_name")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "CreateTRTResourceHandle", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +CreateTRTResourceHandle = tf_export("raw_ops.CreateTRTResourceHandle")(_ops.to_raw_op(create_trt_resource_handle)) +_dispatcher_for_create_trt_resource_handle = create_trt_resource_handle._tf_type_based_dispatcher.Dispatch + + +def create_trt_resource_handle_eager_fallback(resource_name: str, name, ctx) -> Annotated[Any, _atypes.Resource]: + resource_name = _execute.make_str(resource_name, "resource_name") + _inputs_flat = [] + _attrs = ("resource_name", resource_name) + _result = _execute.execute(b"CreateTRTResourceHandle", 1, + inputs=_inputs_flat, attrs=_attrs, ctx=ctx, + name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "CreateTRTResourceHandle", _inputs_flat, _attrs, _result) + _result, = _result + return _result + + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('get_calibration_data_op') +def get_calibration_data_op(resource_name: Annotated[Any, _atypes.String], name=None) -> Annotated[Any, _atypes.String]: + r"""Returns calibration data for the given resource name + + Args: + resource_name: A `Tensor` of type `string`. + name: A name for the operation (optional). + + Returns: + A `Tensor` of type `string`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "GetCalibrationDataOp", name, resource_name) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_get_calibration_data_op( + (resource_name, name,), None) + if _result is not NotImplemented: + return _result + return get_calibration_data_op_eager_fallback( + resource_name, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + get_calibration_data_op, (), dict(resource_name=resource_name, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_get_calibration_data_op( + (resource_name, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "GetCalibrationDataOp", resource_name=resource_name, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + get_calibration_data_op, (), dict(resource_name=resource_name, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = () + _inputs_flat = _op.inputs + _execute.record_gradient( + "GetCalibrationDataOp", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +GetCalibrationDataOp = tf_export("raw_ops.GetCalibrationDataOp")(_ops.to_raw_op(get_calibration_data_op)) +_dispatcher_for_get_calibration_data_op = get_calibration_data_op._tf_type_based_dispatcher.Dispatch + + +def get_calibration_data_op_eager_fallback(resource_name: Annotated[Any, _atypes.String], name, ctx) -> Annotated[Any, _atypes.String]: + resource_name = _ops.convert_to_tensor(resource_name, _dtypes.string) + _inputs_flat = [resource_name] + _attrs = None + _result = _execute.execute(b"GetCalibrationDataOp", 1, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "GetCalibrationDataOp", _inputs_flat, _attrs, _result) + _result, = _result + return _result + + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('initialize_trt_resource') +def initialize_trt_resource(resource_handle: Annotated[Any, _atypes.Resource], filename: Annotated[Any, _atypes.String], max_cached_engines_count:int=1, name=None): + r"""TODO: add doc. + + Args: + resource_handle: A `Tensor` of type `resource`. + filename: A `Tensor` of type `string`. + max_cached_engines_count: An optional `int`. Defaults to `1`. + name: A name for the operation (optional). + + Returns: + The created Operation. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "InitializeTRTResource", name, resource_handle, filename, + "max_cached_engines_count", max_cached_engines_count) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_initialize_trt_resource( + (resource_handle, filename, max_cached_engines_count, name,), None) + if _result is not NotImplemented: + return _result + return initialize_trt_resource_eager_fallback( + resource_handle, filename, + max_cached_engines_count=max_cached_engines_count, name=name, + ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + initialize_trt_resource, (), dict(resource_handle=resource_handle, + filename=filename, + max_cached_engines_count=max_cached_engines_count, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_initialize_trt_resource( + (resource_handle, filename, max_cached_engines_count, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + if max_cached_engines_count is None: + max_cached_engines_count = 1 + max_cached_engines_count = _execute.make_int(max_cached_engines_count, "max_cached_engines_count") + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "InitializeTRTResource", resource_handle=resource_handle, + filename=filename, + max_cached_engines_count=max_cached_engines_count, + name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + initialize_trt_resource, (), dict(resource_handle=resource_handle, + filename=filename, + max_cached_engines_count=max_cached_engines_count, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + return _op +InitializeTRTResource = tf_export("raw_ops.InitializeTRTResource")(_ops.to_raw_op(initialize_trt_resource)) +_dispatcher_for_initialize_trt_resource = initialize_trt_resource._tf_type_based_dispatcher.Dispatch + + +def initialize_trt_resource_eager_fallback(resource_handle: Annotated[Any, _atypes.Resource], filename: Annotated[Any, _atypes.String], max_cached_engines_count: int, name, ctx): + if max_cached_engines_count is None: + max_cached_engines_count = 1 + max_cached_engines_count = _execute.make_int(max_cached_engines_count, "max_cached_engines_count") + resource_handle = _ops.convert_to_tensor(resource_handle, _dtypes.resource) + filename = _ops.convert_to_tensor(filename, _dtypes.string) + _inputs_flat = [resource_handle, filename] + _attrs = ("max_cached_engines_count", max_cached_engines_count) + _result = _execute.execute(b"InitializeTRTResource", 0, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + _result = None + return _result + + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('serialize_trt_resource') +def serialize_trt_resource(resource_name: Annotated[Any, _atypes.String], filename: Annotated[Any, _atypes.String], delete_resource:bool=False, save_gpu_specific_engines:bool=True, name=None): + r"""TODO: add doc. + + Args: + resource_name: A `Tensor` of type `string`. + filename: A `Tensor` of type `string`. + delete_resource: An optional `bool`. Defaults to `False`. + save_gpu_specific_engines: An optional `bool`. Defaults to `True`. + name: A name for the operation (optional). + + Returns: + The created Operation. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "SerializeTRTResource", name, resource_name, filename, + "delete_resource", delete_resource, "save_gpu_specific_engines", + save_gpu_specific_engines) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_serialize_trt_resource( + (resource_name, filename, delete_resource, + save_gpu_specific_engines, name,), None) + if _result is not NotImplemented: + return _result + return serialize_trt_resource_eager_fallback( + resource_name, filename, delete_resource=delete_resource, + save_gpu_specific_engines=save_gpu_specific_engines, name=name, + ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + serialize_trt_resource, (), dict(resource_name=resource_name, + filename=filename, + delete_resource=delete_resource, + save_gpu_specific_engines=save_gpu_specific_engines, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_serialize_trt_resource( + (resource_name, filename, delete_resource, save_gpu_specific_engines, + name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + if delete_resource is None: + delete_resource = False + delete_resource = _execute.make_bool(delete_resource, "delete_resource") + if save_gpu_specific_engines is None: + save_gpu_specific_engines = True + save_gpu_specific_engines = _execute.make_bool(save_gpu_specific_engines, "save_gpu_specific_engines") + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "SerializeTRTResource", resource_name=resource_name, + filename=filename, + delete_resource=delete_resource, + save_gpu_specific_engines=save_gpu_specific_engines, + name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + serialize_trt_resource, (), dict(resource_name=resource_name, + filename=filename, + delete_resource=delete_resource, + save_gpu_specific_engines=save_gpu_specific_engines, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + return _op +SerializeTRTResource = tf_export("raw_ops.SerializeTRTResource")(_ops.to_raw_op(serialize_trt_resource)) +_dispatcher_for_serialize_trt_resource = serialize_trt_resource._tf_type_based_dispatcher.Dispatch + + +def serialize_trt_resource_eager_fallback(resource_name: Annotated[Any, _atypes.String], filename: Annotated[Any, _atypes.String], delete_resource: bool, save_gpu_specific_engines: bool, name, ctx): + if delete_resource is None: + delete_resource = False + delete_resource = _execute.make_bool(delete_resource, "delete_resource") + if save_gpu_specific_engines is None: + save_gpu_specific_engines = True + save_gpu_specific_engines = _execute.make_bool(save_gpu_specific_engines, "save_gpu_specific_engines") + resource_name = _ops.convert_to_tensor(resource_name, _dtypes.string) + filename = _ops.convert_to_tensor(filename, _dtypes.string) + _inputs_flat = [resource_name, filename] + _attrs = ("delete_resource", delete_resource, "save_gpu_specific_engines", + save_gpu_specific_engines) + _result = _execute.execute(b"SerializeTRTResource", 0, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + _result = None + return _result + + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('trt_engine_op') +def trt_engine_op(in_tensor, serialized_segment: str, OutT, workspace_size_bytes: int, precision_mode: str, segment_func="", input_shapes=[], output_shapes=[], max_cached_engines_count:int=1, max_batch_size:int=1, calibration_data:str="", use_calibration:bool=True, segment_funcdef_name:str="", cached_engine_batches=[], fixed_input_size:bool=True, static_engine:bool=True, profile_strategy:str="", use_explicit_precision:bool=False, name=None): + r"""TODO: add doc. + + Args: + in_tensor: A list of `Tensor` objects with types from: `bool`, `int8`, `half`, `float32`, `int32`, `resource`. + serialized_segment: A `string`. + OutT: A list of `tf.DTypes` from: `tf.bool, tf.int8, tf.half, tf.float32, tf.int32` that has length `>= 1`. + workspace_size_bytes: An `int`. + precision_mode: A `string` from: `"FP32", "FP16", "INT8"`. + segment_func: An optional function decorated with @Defun. Defaults to `""`. + input_shapes: An optional list of shapes (each a `tf.TensorShape` or list of `ints`). Defaults to `[]`. + output_shapes: An optional list of shapes (each a `tf.TensorShape` or list of `ints`). Defaults to `[]`. + max_cached_engines_count: An optional `int`. Defaults to `1`. + max_batch_size: An optional `int`. Defaults to `1`. + calibration_data: An optional `string`. Defaults to `""`. + use_calibration: An optional `bool`. Defaults to `True`. + segment_funcdef_name: An optional `string`. Defaults to `""`. + cached_engine_batches: An optional list of `ints`. Defaults to `[]`. + fixed_input_size: An optional `bool`. Defaults to `True`. + static_engine: An optional `bool`. Defaults to `True`. + profile_strategy: An optional `string`. Defaults to `""`. + use_explicit_precision: An optional `bool`. Defaults to `False`. + name: A name for the operation (optional). + + Returns: + A list of `Tensor` objects of type `OutT`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "TRTEngineOp", name, in_tensor, "serialized_segment", + serialized_segment, "segment_func", segment_func, "OutT", OutT, + "input_shapes", input_shapes, "output_shapes", output_shapes, + "max_cached_engines_count", max_cached_engines_count, + "max_batch_size", max_batch_size, "workspace_size_bytes", + workspace_size_bytes, "precision_mode", precision_mode, + "calibration_data", calibration_data, "use_calibration", + use_calibration, "segment_funcdef_name", segment_funcdef_name, + "cached_engine_batches", cached_engine_batches, "fixed_input_size", + fixed_input_size, "static_engine", static_engine, "profile_strategy", + profile_strategy, "use_explicit_precision", use_explicit_precision) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_trt_engine_op( + (in_tensor, serialized_segment, OutT, workspace_size_bytes, + precision_mode, segment_func, input_shapes, output_shapes, + max_cached_engines_count, max_batch_size, calibration_data, + use_calibration, segment_funcdef_name, cached_engine_batches, + fixed_input_size, static_engine, profile_strategy, + use_explicit_precision, name,), None) + if _result is not NotImplemented: + return _result + return trt_engine_op_eager_fallback( + in_tensor, serialized_segment=serialized_segment, + segment_func=segment_func, OutT=OutT, input_shapes=input_shapes, + output_shapes=output_shapes, + max_cached_engines_count=max_cached_engines_count, + max_batch_size=max_batch_size, + workspace_size_bytes=workspace_size_bytes, + precision_mode=precision_mode, calibration_data=calibration_data, + use_calibration=use_calibration, + segment_funcdef_name=segment_funcdef_name, + cached_engine_batches=cached_engine_batches, + fixed_input_size=fixed_input_size, static_engine=static_engine, + profile_strategy=profile_strategy, + use_explicit_precision=use_explicit_precision, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + trt_engine_op, (), dict(in_tensor=in_tensor, + serialized_segment=serialized_segment, + OutT=OutT, + workspace_size_bytes=workspace_size_bytes, + precision_mode=precision_mode, + segment_func=segment_func, + input_shapes=input_shapes, + output_shapes=output_shapes, + max_cached_engines_count=max_cached_engines_count, + max_batch_size=max_batch_size, + calibration_data=calibration_data, + use_calibration=use_calibration, + segment_funcdef_name=segment_funcdef_name, + cached_engine_batches=cached_engine_batches, + fixed_input_size=fixed_input_size, + static_engine=static_engine, + profile_strategy=profile_strategy, + use_explicit_precision=use_explicit_precision, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_trt_engine_op( + (in_tensor, serialized_segment, OutT, workspace_size_bytes, + precision_mode, segment_func, input_shapes, output_shapes, + max_cached_engines_count, max_batch_size, calibration_data, + use_calibration, segment_funcdef_name, cached_engine_batches, + fixed_input_size, static_engine, profile_strategy, + use_explicit_precision, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + serialized_segment = _execute.make_str(serialized_segment, "serialized_segment") + if not isinstance(OutT, (list, tuple)): + raise TypeError( + "Expected list for 'OutT' argument to " + "'trt_engine_op' Op, not %r." % OutT) + OutT = [_execute.make_type(_t, "OutT") for _t in OutT] + workspace_size_bytes = _execute.make_int(workspace_size_bytes, "workspace_size_bytes") + precision_mode = _execute.make_str(precision_mode, "precision_mode") + if segment_func is None: + segment_func = "" + if input_shapes is None: + input_shapes = [] + if not isinstance(input_shapes, (list, tuple)): + raise TypeError( + "Expected list for 'input_shapes' argument to " + "'trt_engine_op' Op, not %r." % input_shapes) + input_shapes = [_execute.make_shape(_s, "input_shapes") for _s in input_shapes] + if output_shapes is None: + output_shapes = [] + if not isinstance(output_shapes, (list, tuple)): + raise TypeError( + "Expected list for 'output_shapes' argument to " + "'trt_engine_op' Op, not %r." % output_shapes) + output_shapes = [_execute.make_shape(_s, "output_shapes") for _s in output_shapes] + if max_cached_engines_count is None: + max_cached_engines_count = 1 + max_cached_engines_count = _execute.make_int(max_cached_engines_count, "max_cached_engines_count") + if max_batch_size is None: + max_batch_size = 1 + max_batch_size = _execute.make_int(max_batch_size, "max_batch_size") + if calibration_data is None: + calibration_data = "" + calibration_data = _execute.make_str(calibration_data, "calibration_data") + if use_calibration is None: + use_calibration = True + use_calibration = _execute.make_bool(use_calibration, "use_calibration") + if segment_funcdef_name is None: + segment_funcdef_name = "" + segment_funcdef_name = _execute.make_str(segment_funcdef_name, "segment_funcdef_name") + if cached_engine_batches is None: + cached_engine_batches = [] + if not isinstance(cached_engine_batches, (list, tuple)): + raise TypeError( + "Expected list for 'cached_engine_batches' argument to " + "'trt_engine_op' Op, not %r." % cached_engine_batches) + cached_engine_batches = [_execute.make_int(_i, "cached_engine_batches") for _i in cached_engine_batches] + if fixed_input_size is None: + fixed_input_size = True + fixed_input_size = _execute.make_bool(fixed_input_size, "fixed_input_size") + if static_engine is None: + static_engine = True + static_engine = _execute.make_bool(static_engine, "static_engine") + if profile_strategy is None: + profile_strategy = "" + profile_strategy = _execute.make_str(profile_strategy, "profile_strategy") + if use_explicit_precision is None: + use_explicit_precision = False + use_explicit_precision = _execute.make_bool(use_explicit_precision, "use_explicit_precision") + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "TRTEngineOp", in_tensor=in_tensor, + serialized_segment=serialized_segment, OutT=OutT, + workspace_size_bytes=workspace_size_bytes, + precision_mode=precision_mode, + segment_func=segment_func, input_shapes=input_shapes, + output_shapes=output_shapes, + max_cached_engines_count=max_cached_engines_count, + max_batch_size=max_batch_size, + calibration_data=calibration_data, + use_calibration=use_calibration, + segment_funcdef_name=segment_funcdef_name, + cached_engine_batches=cached_engine_batches, + fixed_input_size=fixed_input_size, + static_engine=static_engine, + profile_strategy=profile_strategy, + use_explicit_precision=use_explicit_precision, + name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + trt_engine_op, (), dict(in_tensor=in_tensor, + serialized_segment=serialized_segment, + OutT=OutT, + workspace_size_bytes=workspace_size_bytes, + precision_mode=precision_mode, + segment_func=segment_func, + input_shapes=input_shapes, + output_shapes=output_shapes, + max_cached_engines_count=max_cached_engines_count, + max_batch_size=max_batch_size, + calibration_data=calibration_data, + use_calibration=use_calibration, + segment_funcdef_name=segment_funcdef_name, + cached_engine_batches=cached_engine_batches, + fixed_input_size=fixed_input_size, + static_engine=static_engine, + profile_strategy=profile_strategy, + use_explicit_precision=use_explicit_precision, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("serialized_segment", _op.get_attr("serialized_segment"), + "segment_func", _op.get_attr("segment_func"), "InT", + _op.get_attr("InT"), "OutT", _op.get_attr("OutT"), + "input_shapes", _op.get_attr("input_shapes"), "output_shapes", + _op.get_attr("output_shapes"), "max_cached_engines_count", + _op._get_attr_int("max_cached_engines_count"), "max_batch_size", + _op._get_attr_int("max_batch_size"), "workspace_size_bytes", + _op._get_attr_int("workspace_size_bytes"), "precision_mode", + _op.get_attr("precision_mode"), "calibration_data", + _op.get_attr("calibration_data"), "use_calibration", + _op._get_attr_bool("use_calibration"), "segment_funcdef_name", + _op.get_attr("segment_funcdef_name"), "cached_engine_batches", + _op.get_attr("cached_engine_batches"), "fixed_input_size", + _op._get_attr_bool("fixed_input_size"), "static_engine", + _op._get_attr_bool("static_engine"), "profile_strategy", + _op.get_attr("profile_strategy"), "use_explicit_precision", + _op._get_attr_bool("use_explicit_precision")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "TRTEngineOp", _inputs_flat, _attrs, _result) + return _result + +TRTEngineOp = tf_export("raw_ops.TRTEngineOp")(_ops.to_raw_op(trt_engine_op)) +_dispatcher_for_trt_engine_op = trt_engine_op._tf_type_based_dispatcher.Dispatch + + +def trt_engine_op_eager_fallback(in_tensor, serialized_segment: str, OutT, workspace_size_bytes: int, precision_mode: str, segment_func, input_shapes, output_shapes, max_cached_engines_count: int, max_batch_size: int, calibration_data: str, use_calibration: bool, segment_funcdef_name: str, cached_engine_batches, fixed_input_size: bool, static_engine: bool, profile_strategy: str, use_explicit_precision: bool, name, ctx): + serialized_segment = _execute.make_str(serialized_segment, "serialized_segment") + if not isinstance(OutT, (list, tuple)): + raise TypeError( + "Expected list for 'OutT' argument to " + "'trt_engine_op' Op, not %r." % OutT) + OutT = [_execute.make_type(_t, "OutT") for _t in OutT] + workspace_size_bytes = _execute.make_int(workspace_size_bytes, "workspace_size_bytes") + precision_mode = _execute.make_str(precision_mode, "precision_mode") + if segment_func is None: + segment_func = "" + if input_shapes is None: + input_shapes = [] + if not isinstance(input_shapes, (list, tuple)): + raise TypeError( + "Expected list for 'input_shapes' argument to " + "'trt_engine_op' Op, not %r." % input_shapes) + input_shapes = [_execute.make_shape(_s, "input_shapes") for _s in input_shapes] + if output_shapes is None: + output_shapes = [] + if not isinstance(output_shapes, (list, tuple)): + raise TypeError( + "Expected list for 'output_shapes' argument to " + "'trt_engine_op' Op, not %r." % output_shapes) + output_shapes = [_execute.make_shape(_s, "output_shapes") for _s in output_shapes] + if max_cached_engines_count is None: + max_cached_engines_count = 1 + max_cached_engines_count = _execute.make_int(max_cached_engines_count, "max_cached_engines_count") + if max_batch_size is None: + max_batch_size = 1 + max_batch_size = _execute.make_int(max_batch_size, "max_batch_size") + if calibration_data is None: + calibration_data = "" + calibration_data = _execute.make_str(calibration_data, "calibration_data") + if use_calibration is None: + use_calibration = True + use_calibration = _execute.make_bool(use_calibration, "use_calibration") + if segment_funcdef_name is None: + segment_funcdef_name = "" + segment_funcdef_name = _execute.make_str(segment_funcdef_name, "segment_funcdef_name") + if cached_engine_batches is None: + cached_engine_batches = [] + if not isinstance(cached_engine_batches, (list, tuple)): + raise TypeError( + "Expected list for 'cached_engine_batches' argument to " + "'trt_engine_op' Op, not %r." % cached_engine_batches) + cached_engine_batches = [_execute.make_int(_i, "cached_engine_batches") for _i in cached_engine_batches] + if fixed_input_size is None: + fixed_input_size = True + fixed_input_size = _execute.make_bool(fixed_input_size, "fixed_input_size") + if static_engine is None: + static_engine = True + static_engine = _execute.make_bool(static_engine, "static_engine") + if profile_strategy is None: + profile_strategy = "" + profile_strategy = _execute.make_str(profile_strategy, "profile_strategy") + if use_explicit_precision is None: + use_explicit_precision = False + use_explicit_precision = _execute.make_bool(use_explicit_precision, "use_explicit_precision") + _attr_InT, in_tensor = _execute.convert_to_mixed_eager_tensors(in_tensor, ctx) + _inputs_flat = list(in_tensor) + _attrs = ("serialized_segment", serialized_segment, "segment_func", + segment_func, "InT", _attr_InT, "OutT", OutT, "input_shapes", input_shapes, + "output_shapes", output_shapes, "max_cached_engines_count", + max_cached_engines_count, "max_batch_size", max_batch_size, + "workspace_size_bytes", workspace_size_bytes, "precision_mode", + precision_mode, "calibration_data", calibration_data, "use_calibration", + use_calibration, "segment_funcdef_name", segment_funcdef_name, + "cached_engine_batches", cached_engine_batches, "fixed_input_size", + fixed_input_size, "static_engine", static_engine, "profile_strategy", + profile_strategy, "use_explicit_precision", use_explicit_precision) + _result = _execute.execute(b"TRTEngineOp", len(OutT), inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "TRTEngineOp", _inputs_flat, _attrs, _result) + return _result + diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/ops/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/ops/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/ops/gen_xla_ops.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/ops/gen_xla_ops.py new file mode 100644 index 0000000000000000000000000000000000000000..cd3079cf0b1733c91f5996d9732faf03e843a5ac --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/ops/gen_xla_ops.py @@ -0,0 +1,4862 @@ +"""Python wrappers around TensorFlow ops. + +This file is MACHINE GENERATED! Do not edit. +""" + +import collections + +from tensorflow.python import pywrap_tfe as pywrap_tfe +from tensorflow.python.eager import context as _context +from tensorflow.python.eager import core as _core +from tensorflow.python.eager import execute as _execute +from tensorflow.python.framework import dtypes as _dtypes +from tensorflow.security.fuzzing.py import annotation_types as _atypes + +from tensorflow.python.framework import op_def_registry as _op_def_registry +from tensorflow.python.framework import ops as _ops +from tensorflow.python.framework import op_def_library as _op_def_library +from tensorflow.python.util.deprecation import deprecated_endpoints +from tensorflow.python.util import dispatch as _dispatch +from tensorflow.python.util.tf_export import tf_export + +from typing import TypeVar, List, Any +from typing_extensions import Annotated + +TV_XlaAllReduce_T = TypeVar("TV_XlaAllReduce_T", _atypes.BFloat16, _atypes.Float32, _atypes.Half, _atypes.Int32, _atypes.UInt32) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_all_reduce') +def xla_all_reduce(input: Annotated[Any, TV_XlaAllReduce_T], group_assignment: Annotated[Any, _atypes.Int32], reduce_op: str, mode: str, name=None) -> Annotated[Any, TV_XlaAllReduce_T]: + r"""Wraps the XLA AllReduce operator + + documented at https://www.tensorflow.org/xla/operation_semantics#allreduce. + + Args: + input: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `int32`, `uint32`. + Array or a non-empty tuple of arrays to reduce across replicas. + group_assignment: A `Tensor` of type `int32`. + Groups between which the reductions are performed. + reduce_op: A `string` from: `"Min", "Max", "Mul", "Add", "Mean"`. + Reduction computation. + mode: A `string` from: `"CrossReplica", "CrossReplicaAndPartition"`. + group mode. + CrossReplica: group_assignment contains replica_id. Each group contains the + replicas for the current partition. + CrossReplicaAndPartition: group_assignment contains replica_id. Each group + contains the replicas for all partitions. + name: A name for the operation (optional). + + Returns: + A `Tensor`. Has the same type as `input`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaAllReduce", name, input, group_assignment, "reduce_op", + reduce_op, "mode", mode) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_all_reduce( + (input, group_assignment, reduce_op, mode, name,), None) + if _result is not NotImplemented: + return _result + return xla_all_reduce_eager_fallback( + input, group_assignment, reduce_op=reduce_op, mode=mode, name=name, + ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_all_reduce, (), dict(input=input, + group_assignment=group_assignment, + reduce_op=reduce_op, mode=mode, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_all_reduce( + (input, group_assignment, reduce_op, mode, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + reduce_op = _execute.make_str(reduce_op, "reduce_op") + mode = _execute.make_str(mode, "mode") + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaAllReduce", input=input, group_assignment=group_assignment, + reduce_op=reduce_op, mode=mode, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_all_reduce, (), dict(input=input, + group_assignment=group_assignment, + reduce_op=reduce_op, mode=mode, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("T", _op._get_attr_type("T"), "reduce_op", + _op.get_attr("reduce_op"), "mode", _op.get_attr("mode")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaAllReduce", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +XlaAllReduce = tf_export("raw_ops.XlaAllReduce")(_ops.to_raw_op(xla_all_reduce)) +_dispatcher_for_xla_all_reduce = xla_all_reduce._tf_type_based_dispatcher.Dispatch + + +def xla_all_reduce_eager_fallback(input: Annotated[Any, TV_XlaAllReduce_T], group_assignment: Annotated[Any, _atypes.Int32], reduce_op: str, mode: str, name, ctx) -> Annotated[Any, TV_XlaAllReduce_T]: + reduce_op = _execute.make_str(reduce_op, "reduce_op") + mode = _execute.make_str(mode, "mode") + _attr_T, (input,) = _execute.args_to_matching_eager([input], ctx, [_dtypes.half, _dtypes.bfloat16, _dtypes.float32, _dtypes.int32, _dtypes.uint32, ]) + group_assignment = _ops.convert_to_tensor(group_assignment, _dtypes.int32) + _inputs_flat = [input, group_assignment] + _attrs = ("T", _attr_T, "reduce_op", reduce_op, "mode", mode) + _result = _execute.execute(b"XlaAllReduce", 1, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaAllReduce", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +_XlaBroadcastHelperOutput = collections.namedtuple( + "XlaBroadcastHelper", + ["lhs_output", "rhs_output"]) + + +TV_XlaBroadcastHelper_T = TypeVar("TV_XlaBroadcastHelper_T", _atypes.BFloat16, _atypes.Complex128, _atypes.Complex64, _atypes.Float32, _atypes.Float64, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.UInt16, _atypes.UInt32, _atypes.UInt64, _atypes.UInt8) +TV_XlaBroadcastHelper_Tindices = TypeVar("TV_XlaBroadcastHelper_Tindices", _atypes.Int32, _atypes.Int64) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_broadcast_helper') +def xla_broadcast_helper(lhs: Annotated[Any, TV_XlaBroadcastHelper_T], rhs: Annotated[Any, TV_XlaBroadcastHelper_T], broadcast_dims: Annotated[Any, TV_XlaBroadcastHelper_Tindices], name=None): + r"""Helper operator for performing XLA-style broadcasts + + Broadcasts `lhs` and `rhs` to the same rank, by adding size 1 dimensions to + whichever of `lhs` and `rhs` has the lower rank, using XLA's broadcasting rules + for binary operators. + + Args: + lhs: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `complex64`, `int64`, `qint8`, `quint8`, `qint32`, `bfloat16`, `qint16`, `quint16`, `uint16`, `complex128`, `half`, `uint32`, `uint64`. + the LHS input tensor + rhs: A `Tensor`. Must have the same type as `lhs`. the RHS input tensor + broadcast_dims: A `Tensor`. Must be one of the following types: `int32`, `int64`. + an XLA-style broadcast dimension specification + name: A name for the operation (optional). + + Returns: + A tuple of `Tensor` objects (lhs_output, rhs_output). + + lhs_output: A `Tensor`. Has the same type as `lhs`. the broadcasted LHS tensor + rhs_output: A `Tensor`. Has the same type as `lhs`. the broadcasted RHS tensor + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaBroadcastHelper", name, lhs, rhs, broadcast_dims) + _result = _XlaBroadcastHelperOutput._make(_result) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_broadcast_helper( + (lhs, rhs, broadcast_dims, name,), None) + if _result is not NotImplemented: + return _result + return xla_broadcast_helper_eager_fallback( + lhs, rhs, broadcast_dims, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_broadcast_helper, (), dict(lhs=lhs, rhs=rhs, + broadcast_dims=broadcast_dims, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_broadcast_helper( + (lhs, rhs, broadcast_dims, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaBroadcastHelper", lhs=lhs, rhs=rhs, broadcast_dims=broadcast_dims, + name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_broadcast_helper, (), dict(lhs=lhs, rhs=rhs, + broadcast_dims=broadcast_dims, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("T", _op._get_attr_type("T"), "Tindices", + _op._get_attr_type("Tindices")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaBroadcastHelper", _inputs_flat, _attrs, _result) + _result = _XlaBroadcastHelperOutput._make(_result) + return _result + +XlaBroadcastHelper = tf_export("raw_ops.XlaBroadcastHelper")(_ops.to_raw_op(xla_broadcast_helper)) +_dispatcher_for_xla_broadcast_helper = xla_broadcast_helper._tf_type_based_dispatcher.Dispatch + + +def xla_broadcast_helper_eager_fallback(lhs: Annotated[Any, TV_XlaBroadcastHelper_T], rhs: Annotated[Any, TV_XlaBroadcastHelper_T], broadcast_dims: Annotated[Any, TV_XlaBroadcastHelper_Tindices], name, ctx): + _attr_T, _inputs_T = _execute.args_to_matching_eager([lhs, rhs], ctx, [_dtypes.float32, _dtypes.float64, _dtypes.int32, _dtypes.uint8, _dtypes.int16, _dtypes.int8, _dtypes.complex64, _dtypes.int64, _dtypes.qint8, _dtypes.quint8, _dtypes.qint32, _dtypes.bfloat16, _dtypes.qint16, _dtypes.quint16, _dtypes.uint16, _dtypes.complex128, _dtypes.half, _dtypes.uint32, _dtypes.uint64, ]) + (lhs, rhs) = _inputs_T + _attr_Tindices, (broadcast_dims,) = _execute.args_to_matching_eager([broadcast_dims], ctx, [_dtypes.int32, _dtypes.int64, ]) + _inputs_flat = [lhs, rhs, broadcast_dims] + _attrs = ("T", _attr_T, "Tindices", _attr_Tindices) + _result = _execute.execute(b"XlaBroadcastHelper", 2, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaBroadcastHelper", _inputs_flat, _attrs, _result) + _result = _XlaBroadcastHelperOutput._make(_result) + return _result + + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_call_module') +def xla_call_module(args, version: int, module: str, Sout, Tout, dim_args_spec=[], platforms=[], function_list=[], has_token_input_output:bool=False, disabled_checks=[], name=None): + r"""Invokes a StableHLO module. + + This op is used with JAX native serialization in a TensorFlow context with + stability guarantees. + + Args: + args: A list of `Tensor` objects. + A list of `Tensor` with possibly different types to be passed as arguments + to the `module`. These are the actual arguments and do not include the + platform argument (see `platforms`) nor the dimension arguments (see + `dim_args_spec`). + version: An `int`. + Tracks changes the semantics of the op, to support backwards + compatibility. Minimum supported version is 2. From + version 2, the op carries a StableHLO text or bytecode `module`. From + version 3, the op also supports the `platforms` attribute. From version 4, + the op carries a StableHLO module with compatibility guarantees. From version + 5, XLACallModule can include `stablehlo.custom_call` op to execute tf + functions. From version 6 the op supports the `disabled_checks` attribute. + See more versioning details at https://github.com/search?q=repo%3Atensorflow%2Ftensorflow+path%3Axla_call_module+%22int+VERSION_MAXIMUM_SUPPORTED%22&type=code. + module: A `string`. + A serialized computation, a text or bytecode representation of + an mlir.Module. The return type must be a tuple if and only if the `Sout` is + a list with 0 or more than 1 elements. The length of `Tout` and + `Sout` must match. This op always returns a tuple of results, even if the + module returns a single result. + Sout: A list of shapes (each a `tf.TensorShape` or list of `ints`). + List of output tensor shapes. + Tout: A list of `tf.DTypes`. List of output tensor data types. + dim_args_spec: An optional list of `strings`. Defaults to `[]`. + in presence of dynamic shapes, this is the specification for the + dimension arguments. In absence of dynamic shapes this list is empty. The + `module` takes one 0-dimensional integer tensor dimension argument for each + element of `dim_spec_args`. The dimension arguments come after the platform + index argument and before the actual arguments. Each specification is a + string of the form "." that specifies that the value of + the corresponding dimension argument must be "args[arg_idx].shape[axis_idx]", + where "args" are the actual array arguments. + This attribute is not used anymore in modules serialized with version 5 + after March 28th, 2023 and JAX OSS versions higher than 0.4.6. + TODO(b/283439649): remove support for dim_args_spec. + platforms: An optional list of `strings`. Defaults to `[]`. + the list of platforms supported by `module`. The list can contain + the strings "CPU", "CUDA", "ROCM", or "TPU". It is an error to compile + this op for a platform that does not appear in the list. This check can be + disabled using `disabled_checks`. If the list contains more than + one platform, then the `module` takes one additional 0-dimensional + integer-tensor parameter in the first position, encoding the index in + `platforms` of the current compilation platform. This parameter has value 0 + if the plaform is not among `platforms` and the check has been disabled. + The list can be empty in old versions (earlier than 6) to denote that no + platform checking must be performed at loading time. + function_list: An optional list of functions decorated with @Defun. Defaults to `[]`. + This list contains the TensorFlow FunctionDefs that are used by + the XLACallModule. If the XLACallModule contains `stablehlo.custom_call` + operations, they can call TensorFlow graph functions outside of the + XLACallModule. This `function_list` attribute registers the dependency of the + XLACallModule on those functions. This attribute was added in version 5. + has_token_input_output: An optional `bool`. Defaults to `False`. + If true, the embedded StableHLO module's main function + must take a `!stablehlo.token` as its first argument and returns a token as + its first result. This can be used in conjunction with the TF2XLA's side + effect mechanism in order to model side effects. + disabled_checks: An optional list of `strings`. Defaults to `[]`. + A list of strings describing the safety checks that were + disabled at serialization time. This attribute was added in version 6. + For more details see + https://github.com/search?q=repo%3Agoogle%2Fjax+path%3Ajax_export+%22class+DisabledSafetyCheck%22&type=code. + This list, supplemented with a comma-separate list of directives specified + using the flag --tf_xla_call_module_disabled_checks, + is used at module loading time to skip the corresponding checks. + name: A name for the operation (optional). + + Returns: + A list of `Tensor` objects of type `Tout`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaCallModule", name, args, "version", version, "module", + module, "Sout", Sout, "Tout", Tout, "dim_args_spec", dim_args_spec, + "platforms", platforms, "function_list", function_list, + "has_token_input_output", has_token_input_output, "disabled_checks", + disabled_checks) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_call_module( + (args, version, module, Sout, Tout, dim_args_spec, platforms, + function_list, has_token_input_output, disabled_checks, name,), None) + if _result is not NotImplemented: + return _result + return xla_call_module_eager_fallback( + args, version=version, module=module, Sout=Sout, Tout=Tout, + dim_args_spec=dim_args_spec, platforms=platforms, + function_list=function_list, + has_token_input_output=has_token_input_output, + disabled_checks=disabled_checks, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_call_module, (), dict(args=args, version=version, + module=module, Sout=Sout, Tout=Tout, + dim_args_spec=dim_args_spec, + platforms=platforms, + function_list=function_list, + has_token_input_output=has_token_input_output, + disabled_checks=disabled_checks, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_call_module( + (args, version, module, Sout, Tout, dim_args_spec, platforms, + function_list, has_token_input_output, disabled_checks, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + version = _execute.make_int(version, "version") + module = _execute.make_str(module, "module") + if not isinstance(Sout, (list, tuple)): + raise TypeError( + "Expected list for 'Sout' argument to " + "'xla_call_module' Op, not %r." % Sout) + Sout = [_execute.make_shape(_s, "Sout") for _s in Sout] + if not isinstance(Tout, (list, tuple)): + raise TypeError( + "Expected list for 'Tout' argument to " + "'xla_call_module' Op, not %r." % Tout) + Tout = [_execute.make_type(_t, "Tout") for _t in Tout] + if dim_args_spec is None: + dim_args_spec = [] + if not isinstance(dim_args_spec, (list, tuple)): + raise TypeError( + "Expected list for 'dim_args_spec' argument to " + "'xla_call_module' Op, not %r." % dim_args_spec) + dim_args_spec = [_execute.make_str(_s, "dim_args_spec") for _s in dim_args_spec] + if platforms is None: + platforms = [] + if not isinstance(platforms, (list, tuple)): + raise TypeError( + "Expected list for 'platforms' argument to " + "'xla_call_module' Op, not %r." % platforms) + platforms = [_execute.make_str(_s, "platforms") for _s in platforms] + if function_list is None: + function_list = [] + if not isinstance(function_list, (list, tuple)): + raise TypeError( + "Expected list for 'function_list' argument to " + "'xla_call_module' Op, not %r." % function_list) + if has_token_input_output is None: + has_token_input_output = False + has_token_input_output = _execute.make_bool(has_token_input_output, "has_token_input_output") + if disabled_checks is None: + disabled_checks = [] + if not isinstance(disabled_checks, (list, tuple)): + raise TypeError( + "Expected list for 'disabled_checks' argument to " + "'xla_call_module' Op, not %r." % disabled_checks) + disabled_checks = [_execute.make_str(_s, "disabled_checks") for _s in disabled_checks] + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaCallModule", args=args, version=version, module=module, Sout=Sout, + Tout=Tout, dim_args_spec=dim_args_spec, + platforms=platforms, function_list=function_list, + has_token_input_output=has_token_input_output, + disabled_checks=disabled_checks, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_call_module, (), dict(args=args, version=version, module=module, + Sout=Sout, Tout=Tout, + dim_args_spec=dim_args_spec, + platforms=platforms, + function_list=function_list, + has_token_input_output=has_token_input_output, + disabled_checks=disabled_checks, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if not _result: + return _op + if _execute.must_record_gradient(): + _attrs = ("version", _op._get_attr_int("version"), "module", + _op.get_attr("module"), "Sout", _op.get_attr("Sout"), "Tout", + _op.get_attr("Tout"), "Tin", _op.get_attr("Tin"), + "dim_args_spec", _op.get_attr("dim_args_spec"), "platforms", + _op.get_attr("platforms"), "function_list", + _op.get_attr("function_list"), "has_token_input_output", + _op._get_attr_bool("has_token_input_output"), "disabled_checks", + _op.get_attr("disabled_checks")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaCallModule", _inputs_flat, _attrs, _result) + return _result + +XlaCallModule = tf_export("raw_ops.XlaCallModule")(_ops.to_raw_op(xla_call_module)) +_dispatcher_for_xla_call_module = xla_call_module._tf_type_based_dispatcher.Dispatch + + +def xla_call_module_eager_fallback(args, version: int, module: str, Sout, Tout, dim_args_spec, platforms, function_list, has_token_input_output: bool, disabled_checks, name, ctx): + version = _execute.make_int(version, "version") + module = _execute.make_str(module, "module") + if not isinstance(Sout, (list, tuple)): + raise TypeError( + "Expected list for 'Sout' argument to " + "'xla_call_module' Op, not %r." % Sout) + Sout = [_execute.make_shape(_s, "Sout") for _s in Sout] + if not isinstance(Tout, (list, tuple)): + raise TypeError( + "Expected list for 'Tout' argument to " + "'xla_call_module' Op, not %r." % Tout) + Tout = [_execute.make_type(_t, "Tout") for _t in Tout] + if dim_args_spec is None: + dim_args_spec = [] + if not isinstance(dim_args_spec, (list, tuple)): + raise TypeError( + "Expected list for 'dim_args_spec' argument to " + "'xla_call_module' Op, not %r." % dim_args_spec) + dim_args_spec = [_execute.make_str(_s, "dim_args_spec") for _s in dim_args_spec] + if platforms is None: + platforms = [] + if not isinstance(platforms, (list, tuple)): + raise TypeError( + "Expected list for 'platforms' argument to " + "'xla_call_module' Op, not %r." % platforms) + platforms = [_execute.make_str(_s, "platforms") for _s in platforms] + if function_list is None: + function_list = [] + if not isinstance(function_list, (list, tuple)): + raise TypeError( + "Expected list for 'function_list' argument to " + "'xla_call_module' Op, not %r." % function_list) + if has_token_input_output is None: + has_token_input_output = False + has_token_input_output = _execute.make_bool(has_token_input_output, "has_token_input_output") + if disabled_checks is None: + disabled_checks = [] + if not isinstance(disabled_checks, (list, tuple)): + raise TypeError( + "Expected list for 'disabled_checks' argument to " + "'xla_call_module' Op, not %r." % disabled_checks) + disabled_checks = [_execute.make_str(_s, "disabled_checks") for _s in disabled_checks] + _attr_Tin, args = _execute.convert_to_mixed_eager_tensors(args, ctx) + _inputs_flat = list(args) + _attrs = ("version", version, "module", module, "Sout", Sout, "Tout", Tout, + "Tin", _attr_Tin, "dim_args_spec", dim_args_spec, "platforms", platforms, + "function_list", function_list, "has_token_input_output", + has_token_input_output, "disabled_checks", disabled_checks) + _result = _execute.execute(b"XlaCallModule", len(Tout), inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaCallModule", _inputs_flat, _attrs, _result) + return _result + + +TV_XlaConv_T = TypeVar("TV_XlaConv_T", _atypes.BFloat16, _atypes.Complex128, _atypes.Complex64, _atypes.Float32, _atypes.Float64, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.UInt16, _atypes.UInt32, _atypes.UInt64, _atypes.UInt8) +TV_XlaConv_Tindices = TypeVar("TV_XlaConv_Tindices", _atypes.Int32, _atypes.Int64) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_conv') +def xla_conv(lhs: Annotated[Any, TV_XlaConv_T], rhs: Annotated[Any, TV_XlaConv_T], window_strides: Annotated[Any, TV_XlaConv_Tindices], padding: Annotated[Any, TV_XlaConv_Tindices], lhs_dilation: Annotated[Any, TV_XlaConv_Tindices], rhs_dilation: Annotated[Any, TV_XlaConv_Tindices], feature_group_count: Annotated[Any, TV_XlaConv_Tindices], dimension_numbers: str, precision_config: str, name=None) -> Annotated[Any, TV_XlaConv_T]: + r"""Wraps the XLA ConvGeneralDilated operator, documented at + + https://www.tensorflow.org/performance/xla/operation_semantics#conv_convolution + . + + Args: + lhs: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `complex64`, `int64`, `qint8`, `quint8`, `qint32`, `bfloat16`, `qint16`, `quint16`, `uint16`, `complex128`, `half`, `uint32`, `uint64`. + the input tensor + rhs: A `Tensor`. Must have the same type as `lhs`. the kernel tensor + window_strides: A `Tensor`. Must be one of the following types: `int32`, `int64`. + the inter-window strides + padding: A `Tensor`. Must have the same type as `window_strides`. + the padding to apply at the start and end of each input dimensions + lhs_dilation: A `Tensor`. Must have the same type as `window_strides`. + dilation to apply between input elements + rhs_dilation: A `Tensor`. Must have the same type as `window_strides`. + dilation to apply between kernel elements + feature_group_count: A `Tensor`. Must have the same type as `window_strides`. + number of feature groups for grouped convolution. + dimension_numbers: A `string`. + a serialized xla::ConvolutionDimensionNumbers proto. + precision_config: A `string`. a serialized xla::PrecisionConfig proto. + name: A name for the operation (optional). + + Returns: + A `Tensor`. Has the same type as `lhs`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaConv", name, lhs, rhs, window_strides, padding, + lhs_dilation, rhs_dilation, feature_group_count, "dimension_numbers", + dimension_numbers, "precision_config", precision_config) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_conv( + (lhs, rhs, window_strides, padding, lhs_dilation, rhs_dilation, + feature_group_count, dimension_numbers, precision_config, name,), + None) + if _result is not NotImplemented: + return _result + return xla_conv_eager_fallback( + lhs, rhs, window_strides, padding, lhs_dilation, rhs_dilation, + feature_group_count, dimension_numbers=dimension_numbers, + precision_config=precision_config, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_conv, (), dict(lhs=lhs, rhs=rhs, + window_strides=window_strides, padding=padding, + lhs_dilation=lhs_dilation, + rhs_dilation=rhs_dilation, + feature_group_count=feature_group_count, + dimension_numbers=dimension_numbers, + precision_config=precision_config, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_conv( + (lhs, rhs, window_strides, padding, lhs_dilation, rhs_dilation, + feature_group_count, dimension_numbers, precision_config, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + dimension_numbers = _execute.make_str(dimension_numbers, "dimension_numbers") + precision_config = _execute.make_str(precision_config, "precision_config") + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaConv", lhs=lhs, rhs=rhs, window_strides=window_strides, + padding=padding, lhs_dilation=lhs_dilation, + rhs_dilation=rhs_dilation, + feature_group_count=feature_group_count, + dimension_numbers=dimension_numbers, + precision_config=precision_config, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_conv, (), dict(lhs=lhs, rhs=rhs, window_strides=window_strides, + padding=padding, lhs_dilation=lhs_dilation, + rhs_dilation=rhs_dilation, + feature_group_count=feature_group_count, + dimension_numbers=dimension_numbers, + precision_config=precision_config, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("T", _op._get_attr_type("T"), "Tindices", + _op._get_attr_type("Tindices"), "dimension_numbers", + _op.get_attr("dimension_numbers"), "precision_config", + _op.get_attr("precision_config")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaConv", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +XlaConv = tf_export("raw_ops.XlaConv")(_ops.to_raw_op(xla_conv)) +_dispatcher_for_xla_conv = xla_conv._tf_type_based_dispatcher.Dispatch + + +def xla_conv_eager_fallback(lhs: Annotated[Any, TV_XlaConv_T], rhs: Annotated[Any, TV_XlaConv_T], window_strides: Annotated[Any, TV_XlaConv_Tindices], padding: Annotated[Any, TV_XlaConv_Tindices], lhs_dilation: Annotated[Any, TV_XlaConv_Tindices], rhs_dilation: Annotated[Any, TV_XlaConv_Tindices], feature_group_count: Annotated[Any, TV_XlaConv_Tindices], dimension_numbers: str, precision_config: str, name, ctx) -> Annotated[Any, TV_XlaConv_T]: + dimension_numbers = _execute.make_str(dimension_numbers, "dimension_numbers") + precision_config = _execute.make_str(precision_config, "precision_config") + _attr_T, _inputs_T = _execute.args_to_matching_eager([lhs, rhs], ctx, [_dtypes.float32, _dtypes.float64, _dtypes.int32, _dtypes.uint8, _dtypes.int16, _dtypes.int8, _dtypes.complex64, _dtypes.int64, _dtypes.qint8, _dtypes.quint8, _dtypes.qint32, _dtypes.bfloat16, _dtypes.qint16, _dtypes.quint16, _dtypes.uint16, _dtypes.complex128, _dtypes.half, _dtypes.uint32, _dtypes.uint64, ]) + (lhs, rhs) = _inputs_T + _attr_Tindices, _inputs_Tindices = _execute.args_to_matching_eager([window_strides, padding, lhs_dilation, rhs_dilation, feature_group_count], ctx, [_dtypes.int32, _dtypes.int64, ]) + (window_strides, padding, lhs_dilation, rhs_dilation, feature_group_count) = _inputs_Tindices + _inputs_flat = [lhs, rhs, window_strides, padding, lhs_dilation, rhs_dilation, feature_group_count] + _attrs = ("T", _attr_T, "Tindices", _attr_Tindices, "dimension_numbers", + dimension_numbers, "precision_config", precision_config) + _result = _execute.execute(b"XlaConv", 1, inputs=_inputs_flat, attrs=_attrs, + ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaConv", _inputs_flat, _attrs, _result) + _result, = _result + return _result + + +TV_XlaConvV2_LhsT = TypeVar("TV_XlaConvV2_LhsT", _atypes.BFloat16, _atypes.Complex128, _atypes.Complex64, _atypes.Float32, _atypes.Float64, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.UInt16, _atypes.UInt32, _atypes.UInt64, _atypes.UInt8) +TV_XlaConvV2_RhsT = TypeVar("TV_XlaConvV2_RhsT", _atypes.BFloat16, _atypes.Complex128, _atypes.Complex64, _atypes.Float32, _atypes.Float64, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.UInt16, _atypes.UInt32, _atypes.UInt64, _atypes.UInt8) +TV_XlaConvV2_Tindices = TypeVar("TV_XlaConvV2_Tindices", _atypes.Int32, _atypes.Int64) +TV_XlaConvV2_preferred_element_type = TypeVar("TV_XlaConvV2_preferred_element_type", _atypes.BFloat16, _atypes.Complex128, _atypes.Complex64, _atypes.Float32, _atypes.Float64, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.UInt16, _atypes.UInt32, _atypes.UInt64, _atypes.UInt8) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_conv_v2') +def xla_conv_v2(lhs: Annotated[Any, TV_XlaConvV2_LhsT], rhs: Annotated[Any, TV_XlaConvV2_RhsT], window_strides: Annotated[Any, TV_XlaConvV2_Tindices], padding: Annotated[Any, TV_XlaConvV2_Tindices], lhs_dilation: Annotated[Any, TV_XlaConvV2_Tindices], rhs_dilation: Annotated[Any, TV_XlaConvV2_Tindices], feature_group_count: Annotated[Any, TV_XlaConvV2_Tindices], dimension_numbers: str, precision_config: str, preferred_element_type: TV_XlaConvV2_preferred_element_type, batch_group_count:int=1, name=None) -> Annotated[Any, TV_XlaConvV2_preferred_element_type]: + r"""Wraps the XLA ConvGeneralDilated operator, documented at + + https://www.tensorflow.org/performance/xla/operation_semantics#conv_convolution + . + + Args: + lhs: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `complex64`, `int64`, `qint8`, `quint8`, `qint32`, `bfloat16`, `qint16`, `quint16`, `uint16`, `complex128`, `half`, `uint32`, `uint64`. + input tensor + rhs: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `complex64`, `int64`, `qint8`, `quint8`, `qint32`, `bfloat16`, `qint16`, `quint16`, `uint16`, `complex128`, `half`, `uint32`, `uint64`. + kernel tensor + window_strides: A `Tensor`. Must be one of the following types: `int32`, `int64`. + inter-window strides + padding: A `Tensor`. Must have the same type as `window_strides`. + padding to apply at the start and end of each input dimensions + lhs_dilation: A `Tensor`. Must have the same type as `window_strides`. + dilation to apply between input elements + rhs_dilation: A `Tensor`. Must have the same type as `window_strides`. + dilation to apply between kernel elements + feature_group_count: A `Tensor`. Must have the same type as `window_strides`. + number of feature groups for grouped convolution. + dimension_numbers: A `string`. + serialized xla::ConvolutionDimensionNumbers proto. + precision_config: A `string`. serialized xla::PrecisionConfig proto. + preferred_element_type: A `tf.DType` from: `tf.float32, tf.float64, tf.int32, tf.uint8, tf.int16, tf.int8, tf.complex64, tf.int64, tf.qint8, tf.quint8, tf.qint32, tf.bfloat16, tf.qint16, tf.quint16, tf.uint16, tf.complex128, tf.half, tf.uint32, tf.uint64`. + type of the tensor. + batch_group_count: An optional `int`. Defaults to `1`. + number of batch groups or grouped filters. + name: A name for the operation (optional). + + Returns: + A `Tensor` of type `preferred_element_type`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaConvV2", name, lhs, rhs, window_strides, padding, + lhs_dilation, rhs_dilation, feature_group_count, "dimension_numbers", + dimension_numbers, "precision_config", precision_config, + "preferred_element_type", preferred_element_type, "batch_group_count", + batch_group_count) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_conv_v2( + (lhs, rhs, window_strides, padding, lhs_dilation, rhs_dilation, + feature_group_count, dimension_numbers, precision_config, + preferred_element_type, batch_group_count, name,), None) + if _result is not NotImplemented: + return _result + return xla_conv_v2_eager_fallback( + lhs, rhs, window_strides, padding, lhs_dilation, rhs_dilation, + feature_group_count, dimension_numbers=dimension_numbers, + precision_config=precision_config, + preferred_element_type=preferred_element_type, + batch_group_count=batch_group_count, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_conv_v2, (), dict(lhs=lhs, rhs=rhs, + window_strides=window_strides, + padding=padding, lhs_dilation=lhs_dilation, + rhs_dilation=rhs_dilation, + feature_group_count=feature_group_count, + dimension_numbers=dimension_numbers, + precision_config=precision_config, + preferred_element_type=preferred_element_type, + batch_group_count=batch_group_count, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_conv_v2( + (lhs, rhs, window_strides, padding, lhs_dilation, rhs_dilation, + feature_group_count, dimension_numbers, precision_config, + preferred_element_type, batch_group_count, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + dimension_numbers = _execute.make_str(dimension_numbers, "dimension_numbers") + precision_config = _execute.make_str(precision_config, "precision_config") + preferred_element_type = _execute.make_type(preferred_element_type, "preferred_element_type") + if batch_group_count is None: + batch_group_count = 1 + batch_group_count = _execute.make_int(batch_group_count, "batch_group_count") + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaConvV2", lhs=lhs, rhs=rhs, window_strides=window_strides, + padding=padding, lhs_dilation=lhs_dilation, + rhs_dilation=rhs_dilation, + feature_group_count=feature_group_count, + dimension_numbers=dimension_numbers, + precision_config=precision_config, + preferred_element_type=preferred_element_type, + batch_group_count=batch_group_count, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_conv_v2, (), dict(lhs=lhs, rhs=rhs, + window_strides=window_strides, + padding=padding, lhs_dilation=lhs_dilation, + rhs_dilation=rhs_dilation, + feature_group_count=feature_group_count, + dimension_numbers=dimension_numbers, + precision_config=precision_config, + preferred_element_type=preferred_element_type, + batch_group_count=batch_group_count, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("LhsT", _op._get_attr_type("LhsT"), "RhsT", + _op._get_attr_type("RhsT"), "Tindices", + _op._get_attr_type("Tindices"), "dimension_numbers", + _op.get_attr("dimension_numbers"), "precision_config", + _op.get_attr("precision_config"), "preferred_element_type", + _op._get_attr_type("preferred_element_type"), + "batch_group_count", _op._get_attr_int("batch_group_count")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaConvV2", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +XlaConvV2 = tf_export("raw_ops.XlaConvV2")(_ops.to_raw_op(xla_conv_v2)) +_dispatcher_for_xla_conv_v2 = xla_conv_v2._tf_type_based_dispatcher.Dispatch + + +def xla_conv_v2_eager_fallback(lhs: Annotated[Any, TV_XlaConvV2_LhsT], rhs: Annotated[Any, TV_XlaConvV2_RhsT], window_strides: Annotated[Any, TV_XlaConvV2_Tindices], padding: Annotated[Any, TV_XlaConvV2_Tindices], lhs_dilation: Annotated[Any, TV_XlaConvV2_Tindices], rhs_dilation: Annotated[Any, TV_XlaConvV2_Tindices], feature_group_count: Annotated[Any, TV_XlaConvV2_Tindices], dimension_numbers: str, precision_config: str, preferred_element_type: TV_XlaConvV2_preferred_element_type, batch_group_count: int, name, ctx) -> Annotated[Any, TV_XlaConvV2_preferred_element_type]: + dimension_numbers = _execute.make_str(dimension_numbers, "dimension_numbers") + precision_config = _execute.make_str(precision_config, "precision_config") + preferred_element_type = _execute.make_type(preferred_element_type, "preferred_element_type") + if batch_group_count is None: + batch_group_count = 1 + batch_group_count = _execute.make_int(batch_group_count, "batch_group_count") + _attr_LhsT, (lhs,) = _execute.args_to_matching_eager([lhs], ctx, [_dtypes.float32, _dtypes.float64, _dtypes.int32, _dtypes.uint8, _dtypes.int16, _dtypes.int8, _dtypes.complex64, _dtypes.int64, _dtypes.qint8, _dtypes.quint8, _dtypes.qint32, _dtypes.bfloat16, _dtypes.qint16, _dtypes.quint16, _dtypes.uint16, _dtypes.complex128, _dtypes.half, _dtypes.uint32, _dtypes.uint64, ]) + _attr_RhsT, (rhs,) = _execute.args_to_matching_eager([rhs], ctx, [_dtypes.float32, _dtypes.float64, _dtypes.int32, _dtypes.uint8, _dtypes.int16, _dtypes.int8, _dtypes.complex64, _dtypes.int64, _dtypes.qint8, _dtypes.quint8, _dtypes.qint32, _dtypes.bfloat16, _dtypes.qint16, _dtypes.quint16, _dtypes.uint16, _dtypes.complex128, _dtypes.half, _dtypes.uint32, _dtypes.uint64, ]) + _attr_Tindices, _inputs_Tindices = _execute.args_to_matching_eager([window_strides, padding, lhs_dilation, rhs_dilation, feature_group_count], ctx, [_dtypes.int32, _dtypes.int64, ]) + (window_strides, padding, lhs_dilation, rhs_dilation, feature_group_count) = _inputs_Tindices + _inputs_flat = [lhs, rhs, window_strides, padding, lhs_dilation, rhs_dilation, feature_group_count] + _attrs = ("LhsT", _attr_LhsT, "RhsT", _attr_RhsT, "Tindices", + _attr_Tindices, "dimension_numbers", dimension_numbers, "precision_config", + precision_config, "preferred_element_type", preferred_element_type, + "batch_group_count", batch_group_count) + _result = _execute.execute(b"XlaConvV2", 1, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaConvV2", _inputs_flat, _attrs, _result) + _result, = _result + return _result + + +TV_XlaCustomCall_dtype = TypeVar("TV_XlaCustomCall_dtype", _atypes.BFloat16, _atypes.Bool, _atypes.Complex128, _atypes.Complex64, _atypes.Float16, _atypes.Float32, _atypes.Float64, _atypes.Float8e4m3fn, _atypes.Float8e5m2, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int4, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.Resource, _atypes.String, _atypes.UInt16, _atypes.UInt32, _atypes.UInt4, _atypes.UInt64, _atypes.UInt8, _atypes.Variant) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_custom_call') +def xla_custom_call(args, target_name: str, backend_config: str, dtype: TV_XlaCustomCall_dtype, shape, name=None) -> Annotated[Any, TV_XlaCustomCall_dtype]: + r"""Wraps the XLA CustomCall operator + + documented at https://www.tensorflow.org/xla/operation_semantics#customcall. + + Args: + args: A list of `Tensor` objects. + A list of `Tensor` with possibly different types. + target_name: A `string`. + Name of the function. A call instruction will be emitted which + targets this symbol name. + backend_config: A `string`. + String, used to encode serialized metadata to the backend. + dtype: A `tf.DType`. Output tensor data type. + shape: A `tf.TensorShape` or list of `ints`. Output tensor shape. + name: A name for the operation (optional). + + Returns: + A `Tensor` of type `dtype`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaCustomCall", name, args, "target_name", target_name, + "backend_config", backend_config, "dtype", dtype, "shape", shape) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_custom_call( + (args, target_name, backend_config, dtype, shape, name,), None) + if _result is not NotImplemented: + return _result + return xla_custom_call_eager_fallback( + args, target_name=target_name, backend_config=backend_config, + dtype=dtype, shape=shape, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_custom_call, (), dict(args=args, target_name=target_name, + backend_config=backend_config, + dtype=dtype, shape=shape, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_custom_call( + (args, target_name, backend_config, dtype, shape, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + target_name = _execute.make_str(target_name, "target_name") + backend_config = _execute.make_str(backend_config, "backend_config") + dtype = _execute.make_type(dtype, "dtype") + shape = _execute.make_shape(shape, "shape") + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaCustomCall", args=args, target_name=target_name, + backend_config=backend_config, dtype=dtype, + shape=shape, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_custom_call, (), dict(args=args, target_name=target_name, + backend_config=backend_config, + dtype=dtype, shape=shape, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("target_name", _op.get_attr("target_name"), "backend_config", + _op.get_attr("backend_config"), "T", _op.get_attr("T"), "dtype", + _op._get_attr_type("dtype"), "shape", _op.get_attr("shape")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaCustomCall", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +XlaCustomCall = tf_export("raw_ops.XlaCustomCall")(_ops.to_raw_op(xla_custom_call)) +_dispatcher_for_xla_custom_call = xla_custom_call._tf_type_based_dispatcher.Dispatch + + +def xla_custom_call_eager_fallback(args, target_name: str, backend_config: str, dtype: TV_XlaCustomCall_dtype, shape, name, ctx) -> Annotated[Any, TV_XlaCustomCall_dtype]: + target_name = _execute.make_str(target_name, "target_name") + backend_config = _execute.make_str(backend_config, "backend_config") + dtype = _execute.make_type(dtype, "dtype") + shape = _execute.make_shape(shape, "shape") + _attr_T, args = _execute.convert_to_mixed_eager_tensors(args, ctx) + _inputs_flat = list(args) + _attrs = ("target_name", target_name, "backend_config", backend_config, "T", + _attr_T, "dtype", dtype, "shape", shape) + _result = _execute.execute(b"XlaCustomCall", 1, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaCustomCall", _inputs_flat, _attrs, _result) + _result, = _result + return _result + + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_custom_call_v2') +def xla_custom_call_v2(operands, call_target_name: str, backend_config: str, has_side_effect: bool, result_dtypes, result_shapes, name=None): + r"""Emits an HLO `CustomCall` operation with multiple outputs. + + As opposed to `XlaCustomCall`, this operation supports multiple outputs. + + See `CustomCall` specification at + https://tensorflow.org/xla/operation_semantics#customcall, + and `mhlo.custom_call` specification at + https://tensorflow.org/mlir/hlo_ops#mhlocustom_call_mlirmhlocustomcallop. + + Args: + operands: A list of `Tensor` objects. + A sequence of tensors with possibly different types. + call_target_name: A `string`. + Name of the user function. The function signature must conform + to version 3 of the API, see `API_VERSION_STATUS_RETURNING_UNIFIED`. All + operands and results assumed to be in the default layout. + backend_config: A `string`. + A string that encodes a metadata for the backend. + has_side_effect: A `bool`. + Indicates whether the custom call has side effects. + result_dtypes: A list of `tf.DTypes`. Types of all results. + result_shapes: A list of shapes (each a `tf.TensorShape` or list of `ints`). + Shapes of all results. + name: A name for the operation (optional). + + Returns: + A list of `Tensor` objects of type `result_dtypes`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaCustomCallV2", name, operands, "call_target_name", + call_target_name, "backend_config", backend_config, "has_side_effect", + has_side_effect, "result_dtypes", result_dtypes, "result_shapes", + result_shapes) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_custom_call_v2( + (operands, call_target_name, backend_config, has_side_effect, + result_dtypes, result_shapes, name,), None) + if _result is not NotImplemented: + return _result + return xla_custom_call_v2_eager_fallback( + operands, call_target_name=call_target_name, + backend_config=backend_config, has_side_effect=has_side_effect, + result_dtypes=result_dtypes, result_shapes=result_shapes, name=name, + ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_custom_call_v2, (), dict(operands=operands, + call_target_name=call_target_name, + backend_config=backend_config, + has_side_effect=has_side_effect, + result_dtypes=result_dtypes, + result_shapes=result_shapes, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_custom_call_v2( + (operands, call_target_name, backend_config, has_side_effect, + result_dtypes, result_shapes, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + call_target_name = _execute.make_str(call_target_name, "call_target_name") + backend_config = _execute.make_str(backend_config, "backend_config") + has_side_effect = _execute.make_bool(has_side_effect, "has_side_effect") + if not isinstance(result_dtypes, (list, tuple)): + raise TypeError( + "Expected list for 'result_dtypes' argument to " + "'xla_custom_call_v2' Op, not %r." % result_dtypes) + result_dtypes = [_execute.make_type(_t, "result_dtypes") for _t in result_dtypes] + if not isinstance(result_shapes, (list, tuple)): + raise TypeError( + "Expected list for 'result_shapes' argument to " + "'xla_custom_call_v2' Op, not %r." % result_shapes) + result_shapes = [_execute.make_shape(_s, "result_shapes") for _s in result_shapes] + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaCustomCallV2", operands=operands, + call_target_name=call_target_name, + backend_config=backend_config, + has_side_effect=has_side_effect, + result_dtypes=result_dtypes, + result_shapes=result_shapes, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_custom_call_v2, (), dict(operands=operands, + call_target_name=call_target_name, + backend_config=backend_config, + has_side_effect=has_side_effect, + result_dtypes=result_dtypes, + result_shapes=result_shapes, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("call_target_name", _op.get_attr("call_target_name"), + "backend_config", _op.get_attr("backend_config"), + "has_side_effect", _op._get_attr_bool("has_side_effect"), + "operand_dtypes", _op.get_attr("operand_dtypes"), + "result_dtypes", _op.get_attr("result_dtypes"), "result_shapes", + _op.get_attr("result_shapes")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaCustomCallV2", _inputs_flat, _attrs, _result) + return _result + +XlaCustomCallV2 = tf_export("raw_ops.XlaCustomCallV2")(_ops.to_raw_op(xla_custom_call_v2)) +_dispatcher_for_xla_custom_call_v2 = xla_custom_call_v2._tf_type_based_dispatcher.Dispatch + + +def xla_custom_call_v2_eager_fallback(operands, call_target_name: str, backend_config: str, has_side_effect: bool, result_dtypes, result_shapes, name, ctx): + call_target_name = _execute.make_str(call_target_name, "call_target_name") + backend_config = _execute.make_str(backend_config, "backend_config") + has_side_effect = _execute.make_bool(has_side_effect, "has_side_effect") + if not isinstance(result_dtypes, (list, tuple)): + raise TypeError( + "Expected list for 'result_dtypes' argument to " + "'xla_custom_call_v2' Op, not %r." % result_dtypes) + result_dtypes = [_execute.make_type(_t, "result_dtypes") for _t in result_dtypes] + if not isinstance(result_shapes, (list, tuple)): + raise TypeError( + "Expected list for 'result_shapes' argument to " + "'xla_custom_call_v2' Op, not %r." % result_shapes) + result_shapes = [_execute.make_shape(_s, "result_shapes") for _s in result_shapes] + _attr_operand_dtypes, operands = _execute.convert_to_mixed_eager_tensors(operands, ctx) + _inputs_flat = list(operands) + _attrs = ("call_target_name", call_target_name, "backend_config", + backend_config, "has_side_effect", has_side_effect, "operand_dtypes", + _attr_operand_dtypes, "result_dtypes", result_dtypes, "result_shapes", + result_shapes) + _result = _execute.execute(b"XlaCustomCallV2", len(result_dtypes), + inputs=_inputs_flat, attrs=_attrs, ctx=ctx, + name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaCustomCallV2", _inputs_flat, _attrs, _result) + return _result + + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_dequantize') +def xla_dequantize(input: Annotated[Any, _atypes.UInt32], min_range: float, max_range: float, mode: str, transpose_output: bool, name=None) -> Annotated[Any, _atypes.BFloat16]: + r"""Takes the packed uint32 input and unpacks the input to uint8 to do + + Dequantization on device. + + Args: + input: A `Tensor` of type `uint32`. + Input tensors whose types is uint32, shape is [d0, ..., dn]. + min_range: A `float`. + The minimum scalar value possibly produced for the input. + max_range: A `float`. + The maximum scalar value possibly produced for the input. + mode: A `string`. + String to determine the dequantize mode in {"MIN_COMBINED", "MIN_FIRST", "SCALED"}. + transpose_output: A `bool`. + Boolean to determine if output is transposed. transpose_output + is faster when input is large and rank of input is higher than 1. + name: A name for the operation (optional). + + Returns: + A `Tensor` of type `bfloat16`. + Output tensors whose types is bfloat16. If transpose_output is true, + output shape is [dn * 4, dn-1, ..., d1, d0]. If transpose_output + is false, output shape is [d0,..., dn * 4]. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaDequantize", name, input, "min_range", min_range, + "max_range", max_range, "mode", mode, "transpose_output", + transpose_output) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_dequantize( + (input, min_range, max_range, mode, transpose_output, name,), None) + if _result is not NotImplemented: + return _result + return xla_dequantize_eager_fallback( + input, min_range=min_range, max_range=max_range, mode=mode, + transpose_output=transpose_output, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_dequantize, (), dict(input=input, min_range=min_range, + max_range=max_range, mode=mode, + transpose_output=transpose_output, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_dequantize( + (input, min_range, max_range, mode, transpose_output, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + min_range = _execute.make_float(min_range, "min_range") + max_range = _execute.make_float(max_range, "max_range") + mode = _execute.make_str(mode, "mode") + transpose_output = _execute.make_bool(transpose_output, "transpose_output") + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaDequantize", input=input, min_range=min_range, + max_range=max_range, mode=mode, + transpose_output=transpose_output, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_dequantize, (), dict(input=input, min_range=min_range, + max_range=max_range, mode=mode, + transpose_output=transpose_output, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("min_range", _op.get_attr("min_range"), "max_range", + _op.get_attr("max_range"), "mode", _op.get_attr("mode"), + "transpose_output", _op._get_attr_bool("transpose_output")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaDequantize", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +XlaDequantize = tf_export("raw_ops.XlaDequantize")(_ops.to_raw_op(xla_dequantize)) +_dispatcher_for_xla_dequantize = xla_dequantize._tf_type_based_dispatcher.Dispatch + + +def xla_dequantize_eager_fallback(input: Annotated[Any, _atypes.UInt32], min_range: float, max_range: float, mode: str, transpose_output: bool, name, ctx) -> Annotated[Any, _atypes.BFloat16]: + min_range = _execute.make_float(min_range, "min_range") + max_range = _execute.make_float(max_range, "max_range") + mode = _execute.make_str(mode, "mode") + transpose_output = _execute.make_bool(transpose_output, "transpose_output") + input = _ops.convert_to_tensor(input, _dtypes.uint32) + _inputs_flat = [input] + _attrs = ("min_range", min_range, "max_range", max_range, "mode", mode, + "transpose_output", transpose_output) + _result = _execute.execute(b"XlaDequantize", 1, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaDequantize", _inputs_flat, _attrs, _result) + _result, = _result + return _result + + +TV_XlaDot_T = TypeVar("TV_XlaDot_T", _atypes.BFloat16, _atypes.Complex128, _atypes.Complex64, _atypes.Float32, _atypes.Float64, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.UInt16, _atypes.UInt32, _atypes.UInt64, _atypes.UInt8) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_dot') +def xla_dot(lhs: Annotated[Any, TV_XlaDot_T], rhs: Annotated[Any, TV_XlaDot_T], dimension_numbers: str, precision_config: str, name=None) -> Annotated[Any, TV_XlaDot_T]: + r"""Wraps the XLA DotGeneral operator, documented at + + https://www.tensorflow.org/performance/xla/operation_semantics#dotgeneral + . + + Args: + lhs: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `complex64`, `int64`, `qint8`, `quint8`, `qint32`, `bfloat16`, `qint16`, `quint16`, `uint16`, `complex128`, `half`, `uint32`, `uint64`. + the LHS tensor + rhs: A `Tensor`. Must have the same type as `lhs`. the RHS tensor + dimension_numbers: A `string`. + a serialized xla::DotDimensionNumbers proto. + precision_config: A `string`. a serialized xla::PrecisionConfig proto. + name: A name for the operation (optional). + + Returns: + A `Tensor`. Has the same type as `lhs`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaDot", name, lhs, rhs, "dimension_numbers", + dimension_numbers, "precision_config", precision_config) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_dot( + (lhs, rhs, dimension_numbers, precision_config, name,), None) + if _result is not NotImplemented: + return _result + return xla_dot_eager_fallback( + lhs, rhs, dimension_numbers=dimension_numbers, + precision_config=precision_config, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_dot, (), dict(lhs=lhs, rhs=rhs, + dimension_numbers=dimension_numbers, + precision_config=precision_config, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_dot( + (lhs, rhs, dimension_numbers, precision_config, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + dimension_numbers = _execute.make_str(dimension_numbers, "dimension_numbers") + precision_config = _execute.make_str(precision_config, "precision_config") + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaDot", lhs=lhs, rhs=rhs, dimension_numbers=dimension_numbers, + precision_config=precision_config, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_dot, (), dict(lhs=lhs, rhs=rhs, + dimension_numbers=dimension_numbers, + precision_config=precision_config, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("T", _op._get_attr_type("T"), "dimension_numbers", + _op.get_attr("dimension_numbers"), "precision_config", + _op.get_attr("precision_config")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaDot", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +XlaDot = tf_export("raw_ops.XlaDot")(_ops.to_raw_op(xla_dot)) +_dispatcher_for_xla_dot = xla_dot._tf_type_based_dispatcher.Dispatch + + +def xla_dot_eager_fallback(lhs: Annotated[Any, TV_XlaDot_T], rhs: Annotated[Any, TV_XlaDot_T], dimension_numbers: str, precision_config: str, name, ctx) -> Annotated[Any, TV_XlaDot_T]: + dimension_numbers = _execute.make_str(dimension_numbers, "dimension_numbers") + precision_config = _execute.make_str(precision_config, "precision_config") + _attr_T, _inputs_T = _execute.args_to_matching_eager([lhs, rhs], ctx, [_dtypes.float32, _dtypes.float64, _dtypes.int32, _dtypes.uint8, _dtypes.int16, _dtypes.int8, _dtypes.complex64, _dtypes.int64, _dtypes.qint8, _dtypes.quint8, _dtypes.qint32, _dtypes.bfloat16, _dtypes.qint16, _dtypes.quint16, _dtypes.uint16, _dtypes.complex128, _dtypes.half, _dtypes.uint32, _dtypes.uint64, ]) + (lhs, rhs) = _inputs_T + _inputs_flat = [lhs, rhs] + _attrs = ("T", _attr_T, "dimension_numbers", dimension_numbers, + "precision_config", precision_config) + _result = _execute.execute(b"XlaDot", 1, inputs=_inputs_flat, attrs=_attrs, + ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaDot", _inputs_flat, _attrs, _result) + _result, = _result + return _result + + +TV_XlaDotV2_LhsT = TypeVar("TV_XlaDotV2_LhsT", _atypes.BFloat16, _atypes.Complex128, _atypes.Complex64, _atypes.Float32, _atypes.Float64, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.UInt16, _atypes.UInt32, _atypes.UInt64, _atypes.UInt8) +TV_XlaDotV2_RhsT = TypeVar("TV_XlaDotV2_RhsT", _atypes.BFloat16, _atypes.Complex128, _atypes.Complex64, _atypes.Float32, _atypes.Float64, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.UInt16, _atypes.UInt32, _atypes.UInt64, _atypes.UInt8) +TV_XlaDotV2_preferred_element_type = TypeVar("TV_XlaDotV2_preferred_element_type", _atypes.BFloat16, _atypes.Complex128, _atypes.Complex64, _atypes.Float32, _atypes.Float64, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.UInt16, _atypes.UInt32, _atypes.UInt64, _atypes.UInt8) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_dot_v2') +def xla_dot_v2(lhs: Annotated[Any, TV_XlaDotV2_LhsT], rhs: Annotated[Any, TV_XlaDotV2_RhsT], dimension_numbers: str, precision_config: str, preferred_element_type: TV_XlaDotV2_preferred_element_type, name=None) -> Annotated[Any, TV_XlaDotV2_preferred_element_type]: + r"""Wraps the XLA DotGeneral operator, documented at + + https://www.tensorflow.org/performance/xla/operation_semantics#dotgeneral + . + + Args: + lhs: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `complex64`, `int64`, `qint8`, `quint8`, `qint32`, `bfloat16`, `qint16`, `quint16`, `uint16`, `complex128`, `half`, `uint32`, `uint64`. + the LHS tensor + rhs: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `complex64`, `int64`, `qint8`, `quint8`, `qint32`, `bfloat16`, `qint16`, `quint16`, `uint16`, `complex128`, `half`, `uint32`, `uint64`. + the RHS tensor + dimension_numbers: A `string`. + a serialized xla::DotDimensionNumbers proto. + precision_config: A `string`. a serialized xla::PrecisionConfig proto. + preferred_element_type: A `tf.DType` from: `tf.float32, tf.float64, tf.int32, tf.uint8, tf.int16, tf.int8, tf.complex64, tf.int64, tf.qint8, tf.quint8, tf.qint32, tf.bfloat16, tf.qint16, tf.quint16, tf.uint16, tf.complex128, tf.half, tf.uint32, tf.uint64`. + The type of the tensor. + name: A name for the operation (optional). + + Returns: + A `Tensor` of type `preferred_element_type`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaDotV2", name, lhs, rhs, "dimension_numbers", + dimension_numbers, "precision_config", precision_config, + "preferred_element_type", preferred_element_type) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_dot_v2( + (lhs, rhs, dimension_numbers, precision_config, + preferred_element_type, name,), None) + if _result is not NotImplemented: + return _result + return xla_dot_v2_eager_fallback( + lhs, rhs, dimension_numbers=dimension_numbers, + precision_config=precision_config, + preferred_element_type=preferred_element_type, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_dot_v2, (), dict(lhs=lhs, rhs=rhs, + dimension_numbers=dimension_numbers, + precision_config=precision_config, + preferred_element_type=preferred_element_type, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_dot_v2( + (lhs, rhs, dimension_numbers, precision_config, + preferred_element_type, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + dimension_numbers = _execute.make_str(dimension_numbers, "dimension_numbers") + precision_config = _execute.make_str(precision_config, "precision_config") + preferred_element_type = _execute.make_type(preferred_element_type, "preferred_element_type") + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaDotV2", lhs=lhs, rhs=rhs, dimension_numbers=dimension_numbers, + precision_config=precision_config, + preferred_element_type=preferred_element_type, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_dot_v2, (), dict(lhs=lhs, rhs=rhs, + dimension_numbers=dimension_numbers, + precision_config=precision_config, + preferred_element_type=preferred_element_type, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("LhsT", _op._get_attr_type("LhsT"), "RhsT", + _op._get_attr_type("RhsT"), "dimension_numbers", + _op.get_attr("dimension_numbers"), "precision_config", + _op.get_attr("precision_config"), "preferred_element_type", + _op._get_attr_type("preferred_element_type")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaDotV2", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +XlaDotV2 = tf_export("raw_ops.XlaDotV2")(_ops.to_raw_op(xla_dot_v2)) +_dispatcher_for_xla_dot_v2 = xla_dot_v2._tf_type_based_dispatcher.Dispatch + + +def xla_dot_v2_eager_fallback(lhs: Annotated[Any, TV_XlaDotV2_LhsT], rhs: Annotated[Any, TV_XlaDotV2_RhsT], dimension_numbers: str, precision_config: str, preferred_element_type: TV_XlaDotV2_preferred_element_type, name, ctx) -> Annotated[Any, TV_XlaDotV2_preferred_element_type]: + dimension_numbers = _execute.make_str(dimension_numbers, "dimension_numbers") + precision_config = _execute.make_str(precision_config, "precision_config") + preferred_element_type = _execute.make_type(preferred_element_type, "preferred_element_type") + _attr_LhsT, (lhs,) = _execute.args_to_matching_eager([lhs], ctx, [_dtypes.float32, _dtypes.float64, _dtypes.int32, _dtypes.uint8, _dtypes.int16, _dtypes.int8, _dtypes.complex64, _dtypes.int64, _dtypes.qint8, _dtypes.quint8, _dtypes.qint32, _dtypes.bfloat16, _dtypes.qint16, _dtypes.quint16, _dtypes.uint16, _dtypes.complex128, _dtypes.half, _dtypes.uint32, _dtypes.uint64, ]) + _attr_RhsT, (rhs,) = _execute.args_to_matching_eager([rhs], ctx, [_dtypes.float32, _dtypes.float64, _dtypes.int32, _dtypes.uint8, _dtypes.int16, _dtypes.int8, _dtypes.complex64, _dtypes.int64, _dtypes.qint8, _dtypes.quint8, _dtypes.qint32, _dtypes.bfloat16, _dtypes.qint16, _dtypes.quint16, _dtypes.uint16, _dtypes.complex128, _dtypes.half, _dtypes.uint32, _dtypes.uint64, ]) + _inputs_flat = [lhs, rhs] + _attrs = ("LhsT", _attr_LhsT, "RhsT", _attr_RhsT, "dimension_numbers", + dimension_numbers, "precision_config", precision_config, + "preferred_element_type", preferred_element_type) + _result = _execute.execute(b"XlaDotV2", 1, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaDotV2", _inputs_flat, _attrs, _result) + _result, = _result + return _result + + +TV_XlaDynamicSlice_T = TypeVar("TV_XlaDynamicSlice_T", _atypes.BFloat16, _atypes.Bool, _atypes.Complex128, _atypes.Complex64, _atypes.Float16, _atypes.Float32, _atypes.Float64, _atypes.Float8e4m3fn, _atypes.Float8e5m2, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int4, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.Resource, _atypes.String, _atypes.UInt16, _atypes.UInt32, _atypes.UInt4, _atypes.UInt64, _atypes.UInt8, _atypes.Variant) +TV_XlaDynamicSlice_Tindices = TypeVar("TV_XlaDynamicSlice_Tindices", _atypes.Int32, _atypes.Int64) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_dynamic_slice') +def xla_dynamic_slice(input: Annotated[Any, TV_XlaDynamicSlice_T], start_indices: Annotated[Any, TV_XlaDynamicSlice_Tindices], size_indices: Annotated[Any, TV_XlaDynamicSlice_Tindices], name=None) -> Annotated[Any, TV_XlaDynamicSlice_T]: + r"""Wraps the XLA DynamicSlice operator, documented at + + https://www.tensorflow.org/performance/xla/operation_semantics#dynamicslice + . + + DynamicSlice extracts a sub-array from the input array at dynamic + start_indices. The size of the slice in each dimension is passed in + size_indices, which specify the end point of exclusive slice intervals in each + dimension -- [start, start + size). The shape of start_indices must have rank 1, + with dimension size equal to the rank of operand. + + Args: + input: A `Tensor`. A `Tensor` of type T. + start_indices: A `Tensor`. Must be one of the following types: `int32`, `int64`. + List of N integers containing the slice size for each + dimension. Each value must be strictly greater than zero, and start + size + must be less than or equal to the size of the dimension to avoid + implementation defined behavior. + size_indices: A `Tensor`. Must have the same type as `start_indices`. + name: A name for the operation (optional). + + Returns: + A `Tensor`. Has the same type as `input`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaDynamicSlice", name, input, start_indices, size_indices) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_dynamic_slice( + (input, start_indices, size_indices, name,), None) + if _result is not NotImplemented: + return _result + return xla_dynamic_slice_eager_fallback( + input, start_indices, size_indices, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_dynamic_slice, (), dict(input=input, + start_indices=start_indices, + size_indices=size_indices, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_dynamic_slice( + (input, start_indices, size_indices, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaDynamicSlice", input=input, start_indices=start_indices, + size_indices=size_indices, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_dynamic_slice, (), dict(input=input, + start_indices=start_indices, + size_indices=size_indices, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("T", _op._get_attr_type("T"), "Tindices", + _op._get_attr_type("Tindices")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaDynamicSlice", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +XlaDynamicSlice = tf_export("raw_ops.XlaDynamicSlice")(_ops.to_raw_op(xla_dynamic_slice)) +_dispatcher_for_xla_dynamic_slice = xla_dynamic_slice._tf_type_based_dispatcher.Dispatch + + +def xla_dynamic_slice_eager_fallback(input: Annotated[Any, TV_XlaDynamicSlice_T], start_indices: Annotated[Any, TV_XlaDynamicSlice_Tindices], size_indices: Annotated[Any, TV_XlaDynamicSlice_Tindices], name, ctx) -> Annotated[Any, TV_XlaDynamicSlice_T]: + _attr_T, (input,) = _execute.args_to_matching_eager([input], ctx, []) + _attr_Tindices, _inputs_Tindices = _execute.args_to_matching_eager([start_indices, size_indices], ctx, [_dtypes.int32, _dtypes.int64, ]) + (start_indices, size_indices) = _inputs_Tindices + _inputs_flat = [input, start_indices, size_indices] + _attrs = ("T", _attr_T, "Tindices", _attr_Tindices) + _result = _execute.execute(b"XlaDynamicSlice", 1, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaDynamicSlice", _inputs_flat, _attrs, _result) + _result, = _result + return _result + + +TV_XlaDynamicUpdateSlice_T = TypeVar("TV_XlaDynamicUpdateSlice_T", _atypes.BFloat16, _atypes.Bool, _atypes.Complex128, _atypes.Complex64, _atypes.Float16, _atypes.Float32, _atypes.Float64, _atypes.Float8e4m3fn, _atypes.Float8e5m2, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int4, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.Resource, _atypes.String, _atypes.UInt16, _atypes.UInt32, _atypes.UInt4, _atypes.UInt64, _atypes.UInt8, _atypes.Variant) +TV_XlaDynamicUpdateSlice_Tindices = TypeVar("TV_XlaDynamicUpdateSlice_Tindices", _atypes.Int32, _atypes.Int64) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_dynamic_update_slice') +def xla_dynamic_update_slice(input: Annotated[Any, TV_XlaDynamicUpdateSlice_T], update: Annotated[Any, TV_XlaDynamicUpdateSlice_T], indices: Annotated[Any, TV_XlaDynamicUpdateSlice_Tindices], name=None) -> Annotated[Any, TV_XlaDynamicUpdateSlice_T]: + r"""Wraps the XLA DynamicUpdateSlice operator, documented at + + https://www.tensorflow.org/performance/xla/operation_semantics#dynamicupdateslice + . + + XlaDynamicUpdateSlice generates a result which is the value of the `input` + operand, with a slice update overwritten at `indices`. The shape of `update` + determines the shape of the sub-array of the result which is updated. The shape + of indices must be rank == 1, with dimension size equal to the rank of `input`. + + Handling of out-of-bounds slice indices is implementation-defined. + + Args: + input: A `Tensor`. A `Tensor` of type T. + update: A `Tensor`. Must have the same type as `input`. + A `Tensor` of type T. Same rank as `input`. + indices: A `Tensor`. Must be one of the following types: `int32`, `int64`. + A vector of indices into `input`. Must have length equal to the rank of + `input`. + name: A name for the operation (optional). + + Returns: + A `Tensor`. Has the same type as `input`. A `Tensor` of type T. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaDynamicUpdateSlice", name, input, update, indices) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_dynamic_update_slice( + (input, update, indices, name,), None) + if _result is not NotImplemented: + return _result + return xla_dynamic_update_slice_eager_fallback( + input, update, indices, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_dynamic_update_slice, (), dict(input=input, update=update, + indices=indices, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_dynamic_update_slice( + (input, update, indices, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaDynamicUpdateSlice", input=input, update=update, indices=indices, + name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_dynamic_update_slice, (), dict(input=input, update=update, + indices=indices, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("T", _op._get_attr_type("T"), "Tindices", + _op._get_attr_type("Tindices")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaDynamicUpdateSlice", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +XlaDynamicUpdateSlice = tf_export("raw_ops.XlaDynamicUpdateSlice")(_ops.to_raw_op(xla_dynamic_update_slice)) +_dispatcher_for_xla_dynamic_update_slice = xla_dynamic_update_slice._tf_type_based_dispatcher.Dispatch + + +def xla_dynamic_update_slice_eager_fallback(input: Annotated[Any, TV_XlaDynamicUpdateSlice_T], update: Annotated[Any, TV_XlaDynamicUpdateSlice_T], indices: Annotated[Any, TV_XlaDynamicUpdateSlice_Tindices], name, ctx) -> Annotated[Any, TV_XlaDynamicUpdateSlice_T]: + _attr_T, _inputs_T = _execute.args_to_matching_eager([input, update], ctx, []) + (input, update) = _inputs_T + _attr_Tindices, (indices,) = _execute.args_to_matching_eager([indices], ctx, [_dtypes.int32, _dtypes.int64, ]) + _inputs_flat = [input, update, indices] + _attrs = ("T", _attr_T, "Tindices", _attr_Tindices) + _result = _execute.execute(b"XlaDynamicUpdateSlice", 1, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaDynamicUpdateSlice", _inputs_flat, _attrs, _result) + _result, = _result + return _result + + +TV_XlaEinsum_T = TypeVar("TV_XlaEinsum_T", _atypes.BFloat16, _atypes.Complex64, _atypes.Float32) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_einsum') +def xla_einsum(a: Annotated[Any, TV_XlaEinsum_T], b: Annotated[Any, TV_XlaEinsum_T], equation: str, name=None) -> Annotated[Any, TV_XlaEinsum_T]: + r"""An op which supports basic einsum op with 2 inputs and 1 output. + + This op has better TPU performance since it doesn't have explicitly reshape and + transpose operations as tf.einsum does. + + Args: + a: A `Tensor`. Must be one of the following types: `complex64`, `bfloat16`, `float32`. + b: A `Tensor`. Must have the same type as `a`. + equation: A `string`. + name: A name for the operation (optional). + + Returns: + A `Tensor`. Has the same type as `a`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaEinsum", name, a, b, "equation", equation) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_einsum( + (a, b, equation, name,), None) + if _result is not NotImplemented: + return _result + return xla_einsum_eager_fallback( + a, b, equation=equation, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_einsum, (), dict(a=a, b=b, equation=equation, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_einsum( + (a, b, equation, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + equation = _execute.make_str(equation, "equation") + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaEinsum", a=a, b=b, equation=equation, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_einsum, (), dict(a=a, b=b, equation=equation, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("equation", _op.get_attr("equation"), "T", + _op._get_attr_type("T")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaEinsum", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +XlaEinsum = tf_export("raw_ops.XlaEinsum")(_ops.to_raw_op(xla_einsum)) +_dispatcher_for_xla_einsum = xla_einsum._tf_type_based_dispatcher.Dispatch + + +def xla_einsum_eager_fallback(a: Annotated[Any, TV_XlaEinsum_T], b: Annotated[Any, TV_XlaEinsum_T], equation: str, name, ctx) -> Annotated[Any, TV_XlaEinsum_T]: + equation = _execute.make_str(equation, "equation") + _attr_T, _inputs_T = _execute.args_to_matching_eager([a, b], ctx, [_dtypes.complex64, _dtypes.bfloat16, _dtypes.float32, ]) + (a, b) = _inputs_T + _inputs_flat = [a, b] + _attrs = ("equation", equation, "T", _attr_T) + _result = _execute.execute(b"XlaEinsum", 1, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaEinsum", _inputs_flat, _attrs, _result) + _result, = _result + return _result + + +TV_XlaGather_T = TypeVar("TV_XlaGather_T", _atypes.BFloat16, _atypes.Bool, _atypes.Complex128, _atypes.Complex64, _atypes.Float32, _atypes.Float64, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.UInt16, _atypes.UInt32, _atypes.UInt64, _atypes.UInt8) +TV_XlaGather_Tindices = TypeVar("TV_XlaGather_Tindices", _atypes.Int32, _atypes.Int64) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_gather') +def xla_gather(operand: Annotated[Any, TV_XlaGather_T], start_indices: Annotated[Any, TV_XlaGather_Tindices], slice_sizes: Annotated[Any, TV_XlaGather_Tindices], dimension_numbers: str, indices_are_sorted: bool, name=None) -> Annotated[Any, TV_XlaGather_T]: + r"""Wraps the XLA Gather operator documented at + + https://www.tensorflow.org/xla/operation_semantics#gather + + Args: + operand: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `complex64`, `int64`, `qint8`, `quint8`, `qint32`, `bfloat16`, `qint16`, `quint16`, `uint16`, `complex128`, `half`, `uint32`, `uint64`, `bool`. + The array we're gathering from. + start_indices: A `Tensor`. Must be one of the following types: `int32`, `int64`. + Array containing the starting indices of the slices we gather. + slice_sizes: A `Tensor`. Must have the same type as `start_indices`. + slice_sizes[i] is the bounds for the slice on dimension i. + dimension_numbers: A `string`. + A serialized xla::GatherDimensionNumbers proto. + indices_are_sorted: A `bool`. + Boolean indicating if the indices are sorted. + name: A name for the operation (optional). + + Returns: + A `Tensor`. Has the same type as `operand`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaGather", name, operand, start_indices, slice_sizes, + "dimension_numbers", dimension_numbers, "indices_are_sorted", + indices_are_sorted) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_gather( + (operand, start_indices, slice_sizes, dimension_numbers, + indices_are_sorted, name,), None) + if _result is not NotImplemented: + return _result + return xla_gather_eager_fallback( + operand, start_indices, slice_sizes, + dimension_numbers=dimension_numbers, + indices_are_sorted=indices_are_sorted, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_gather, (), dict(operand=operand, start_indices=start_indices, + slice_sizes=slice_sizes, + dimension_numbers=dimension_numbers, + indices_are_sorted=indices_are_sorted, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_gather( + (operand, start_indices, slice_sizes, dimension_numbers, + indices_are_sorted, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + dimension_numbers = _execute.make_str(dimension_numbers, "dimension_numbers") + indices_are_sorted = _execute.make_bool(indices_are_sorted, "indices_are_sorted") + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaGather", operand=operand, start_indices=start_indices, + slice_sizes=slice_sizes, + dimension_numbers=dimension_numbers, + indices_are_sorted=indices_are_sorted, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_gather, (), dict(operand=operand, start_indices=start_indices, + slice_sizes=slice_sizes, + dimension_numbers=dimension_numbers, + indices_are_sorted=indices_are_sorted, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("dimension_numbers", _op.get_attr("dimension_numbers"), + "indices_are_sorted", _op._get_attr_bool("indices_are_sorted"), + "T", _op._get_attr_type("T"), "Tindices", + _op._get_attr_type("Tindices")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaGather", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +XlaGather = tf_export("raw_ops.XlaGather")(_ops.to_raw_op(xla_gather)) +_dispatcher_for_xla_gather = xla_gather._tf_type_based_dispatcher.Dispatch + + +def xla_gather_eager_fallback(operand: Annotated[Any, TV_XlaGather_T], start_indices: Annotated[Any, TV_XlaGather_Tindices], slice_sizes: Annotated[Any, TV_XlaGather_Tindices], dimension_numbers: str, indices_are_sorted: bool, name, ctx) -> Annotated[Any, TV_XlaGather_T]: + dimension_numbers = _execute.make_str(dimension_numbers, "dimension_numbers") + indices_are_sorted = _execute.make_bool(indices_are_sorted, "indices_are_sorted") + _attr_T, (operand,) = _execute.args_to_matching_eager([operand], ctx, [_dtypes.float32, _dtypes.float64, _dtypes.int32, _dtypes.uint8, _dtypes.int16, _dtypes.int8, _dtypes.complex64, _dtypes.int64, _dtypes.qint8, _dtypes.quint8, _dtypes.qint32, _dtypes.bfloat16, _dtypes.qint16, _dtypes.quint16, _dtypes.uint16, _dtypes.complex128, _dtypes.half, _dtypes.uint32, _dtypes.uint64, _dtypes.bool, ]) + _attr_Tindices, _inputs_Tindices = _execute.args_to_matching_eager([start_indices, slice_sizes], ctx, [_dtypes.int32, _dtypes.int64, ]) + (start_indices, slice_sizes) = _inputs_Tindices + _inputs_flat = [operand, start_indices, slice_sizes] + _attrs = ("dimension_numbers", dimension_numbers, "indices_are_sorted", + indices_are_sorted, "T", _attr_T, "Tindices", _attr_Tindices) + _result = _execute.execute(b"XlaGather", 1, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaGather", _inputs_flat, _attrs, _result) + _result, = _result + return _result + + +TV_XlaIf_Tcond = TypeVar("TV_XlaIf_Tcond", _atypes.BFloat16, _atypes.Bool, _atypes.Complex128, _atypes.Complex64, _atypes.Float16, _atypes.Float32, _atypes.Float64, _atypes.Float8e4m3fn, _atypes.Float8e5m2, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int4, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.Resource, _atypes.String, _atypes.UInt16, _atypes.UInt32, _atypes.UInt4, _atypes.UInt64, _atypes.UInt8, _atypes.Variant) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_if') +def xla_if(cond: Annotated[Any, TV_XlaIf_Tcond], inputs, then_branch, else_branch, Tout, name=None): + r"""output = cond ? then_branch(inputs) : else_branch(inputs). + + Args: + cond: A `Tensor`. A boolean scalar. + inputs: A list of `Tensor` objects. A list of input tensors. + then_branch: A function decorated with @Defun. + A function takes 'inputs' and returns a list of tensors, + whose types are the same as what else_branch returns. + else_branch: A function decorated with @Defun. + A function takes 'inputs' and returns a list of tensors. + whose types are the same as what then_branch returns. + Tout: A list of `tf.DTypes`. + name: A name for the operation (optional). + + Returns: + A list of `Tensor` objects of type `Tout`. + A list of tensors returned by either then_branch(inputs) or + else_branch(inputs). The input shapes of the then_branch and + else_branch must match. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaIf", name, cond, inputs, "then_branch", then_branch, + "else_branch", else_branch, "Tout", Tout) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_if( + (cond, inputs, then_branch, else_branch, Tout, name,), None) + if _result is not NotImplemented: + return _result + return xla_if_eager_fallback( + cond, inputs, then_branch=then_branch, else_branch=else_branch, + Tout=Tout, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_if, (), dict(cond=cond, inputs=inputs, + then_branch=then_branch, else_branch=else_branch, + Tout=Tout, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_if( + (cond, inputs, then_branch, else_branch, Tout, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + if not isinstance(Tout, (list, tuple)): + raise TypeError( + "Expected list for 'Tout' argument to " + "'xla_if' Op, not %r." % Tout) + Tout = [_execute.make_type(_t, "Tout") for _t in Tout] + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaIf", cond=cond, inputs=inputs, then_branch=then_branch, + else_branch=else_branch, Tout=Tout, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_if, (), dict(cond=cond, inputs=inputs, then_branch=then_branch, + else_branch=else_branch, Tout=Tout, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if not _result: + return _op + if _execute.must_record_gradient(): + _attrs = ("Tcond", _op._get_attr_type("Tcond"), "then_branch", + _op.get_attr("then_branch"), "else_branch", + _op.get_attr("else_branch"), "Tin", _op.get_attr("Tin"), "Tout", + _op.get_attr("Tout")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaIf", _inputs_flat, _attrs, _result) + return _result + +XlaIf = tf_export("raw_ops.XlaIf")(_ops.to_raw_op(xla_if)) +_dispatcher_for_xla_if = xla_if._tf_type_based_dispatcher.Dispatch + + +def xla_if_eager_fallback(cond: Annotated[Any, TV_XlaIf_Tcond], inputs, then_branch, else_branch, Tout, name, ctx): + if not isinstance(Tout, (list, tuple)): + raise TypeError( + "Expected list for 'Tout' argument to " + "'xla_if' Op, not %r." % Tout) + Tout = [_execute.make_type(_t, "Tout") for _t in Tout] + _attr_Tcond, (cond,) = _execute.args_to_matching_eager([cond], ctx, []) + _attr_Tin, inputs = _execute.convert_to_mixed_eager_tensors(inputs, ctx) + _inputs_flat = [cond] + list(inputs) + _attrs = ("Tcond", _attr_Tcond, "then_branch", then_branch, "else_branch", + else_branch, "Tin", _attr_Tin, "Tout", Tout) + _result = _execute.execute(b"XlaIf", len(Tout), inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaIf", _inputs_flat, _attrs, _result) + return _result + +_XlaKeyValueSortOutput = collections.namedtuple( + "XlaKeyValueSort", + ["sorted_keys", "sorted_values"]) + + +TV_XlaKeyValueSort_K = TypeVar("TV_XlaKeyValueSort_K", _atypes.BFloat16, _atypes.Float32, _atypes.Float64, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int64, _atypes.Int8, _atypes.UInt16, _atypes.UInt32, _atypes.UInt64, _atypes.UInt8) +TV_XlaKeyValueSort_V = TypeVar("TV_XlaKeyValueSort_V", _atypes.BFloat16, _atypes.Bool, _atypes.Complex128, _atypes.Complex64, _atypes.Float16, _atypes.Float32, _atypes.Float64, _atypes.Float8e4m3fn, _atypes.Float8e5m2, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int4, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.Resource, _atypes.String, _atypes.UInt16, _atypes.UInt32, _atypes.UInt4, _atypes.UInt64, _atypes.UInt8, _atypes.Variant) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_key_value_sort') +def xla_key_value_sort(keys: Annotated[Any, TV_XlaKeyValueSort_K], values: Annotated[Any, TV_XlaKeyValueSort_V], name=None): + r"""Wraps the XLA Sort operator, documented at + + https://www.tensorflow.org/performance/xla/operation_semantics#sort + . + + Sorts a tensor. Currently only sorts in ascending order are supported. + + Args: + keys: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `int64`, `bfloat16`, `uint16`, `half`, `uint32`, `uint64`. + A `Tensor` of type K. + values: A `Tensor`. A `Tensor` of type V. + name: A name for the operation (optional). + + Returns: + A tuple of `Tensor` objects (sorted_keys, sorted_values). + + sorted_keys: A `Tensor`. Has the same type as `keys`. A `Tensor` of type K. + sorted_values: A `Tensor`. Has the same type as `values`. A `Tensor` of type V. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaKeyValueSort", name, keys, values) + _result = _XlaKeyValueSortOutput._make(_result) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_key_value_sort( + (keys, values, name,), None) + if _result is not NotImplemented: + return _result + return xla_key_value_sort_eager_fallback( + keys, values, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_key_value_sort, (), dict(keys=keys, values=values, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_key_value_sort( + (keys, values, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaKeyValueSort", keys=keys, values=values, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_key_value_sort, (), dict(keys=keys, values=values, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("K", _op._get_attr_type("K"), "V", _op._get_attr_type("V")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaKeyValueSort", _inputs_flat, _attrs, _result) + _result = _XlaKeyValueSortOutput._make(_result) + return _result + +XlaKeyValueSort = tf_export("raw_ops.XlaKeyValueSort")(_ops.to_raw_op(xla_key_value_sort)) +_dispatcher_for_xla_key_value_sort = xla_key_value_sort._tf_type_based_dispatcher.Dispatch + + +def xla_key_value_sort_eager_fallback(keys: Annotated[Any, TV_XlaKeyValueSort_K], values: Annotated[Any, TV_XlaKeyValueSort_V], name, ctx): + _attr_K, (keys,) = _execute.args_to_matching_eager([keys], ctx, [_dtypes.float32, _dtypes.float64, _dtypes.int32, _dtypes.uint8, _dtypes.int16, _dtypes.int8, _dtypes.int64, _dtypes.bfloat16, _dtypes.uint16, _dtypes.half, _dtypes.uint32, _dtypes.uint64, ]) + _attr_V, (values,) = _execute.args_to_matching_eager([values], ctx, []) + _inputs_flat = [keys, values] + _attrs = ("K", _attr_K, "V", _attr_V) + _result = _execute.execute(b"XlaKeyValueSort", 2, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaKeyValueSort", _inputs_flat, _attrs, _result) + _result = _XlaKeyValueSortOutput._make(_result) + return _result + + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_optimization_barrier') +def xla_optimization_barrier(input, name=None): + r"""Wraps the XLA OptimizationBarrier operator. + + Documented at https://www.tensorflow.org/xla/operation_semantics#optimizationbarrier. + + Args: + input: A list of `Tensor` objects. A Tuple of Arrays of any type. + name: A name for the operation (optional). + + Returns: + A list of `Tensor` objects. Has the same type as `input`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaOptimizationBarrier", name, input) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_optimization_barrier( + (input, name,), None) + if _result is not NotImplemented: + return _result + return xla_optimization_barrier_eager_fallback( + input, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_optimization_barrier, (), dict(input=input, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_optimization_barrier( + (input, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaOptimizationBarrier", input=input, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_optimization_barrier, (), dict(input=input, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("T", _op.get_attr("T")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaOptimizationBarrier", _inputs_flat, _attrs, _result) + return _result + +XlaOptimizationBarrier = tf_export("raw_ops.XlaOptimizationBarrier")(_ops.to_raw_op(xla_optimization_barrier)) +_dispatcher_for_xla_optimization_barrier = xla_optimization_barrier._tf_type_based_dispatcher.Dispatch + + +def xla_optimization_barrier_eager_fallback(input, name, ctx): + _attr_T, input = _execute.convert_to_mixed_eager_tensors(input, ctx) + _inputs_flat = list(input) + _attrs = ("T", _attr_T) + _result = _execute.execute(b"XlaOptimizationBarrier", len(input), + inputs=_inputs_flat, attrs=_attrs, ctx=ctx, + name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaOptimizationBarrier", _inputs_flat, _attrs, _result) + return _result + + +TV_XlaPad_T = TypeVar("TV_XlaPad_T", _atypes.BFloat16, _atypes.Bool, _atypes.Complex128, _atypes.Complex64, _atypes.Float16, _atypes.Float32, _atypes.Float64, _atypes.Float8e4m3fn, _atypes.Float8e5m2, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int4, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.Resource, _atypes.String, _atypes.UInt16, _atypes.UInt32, _atypes.UInt4, _atypes.UInt64, _atypes.UInt8, _atypes.Variant) +TV_XlaPad_Tindices = TypeVar("TV_XlaPad_Tindices", _atypes.Int32, _atypes.Int64) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_pad') +def xla_pad(input: Annotated[Any, TV_XlaPad_T], padding_value: Annotated[Any, TV_XlaPad_T], padding_low: Annotated[Any, TV_XlaPad_Tindices], padding_high: Annotated[Any, TV_XlaPad_Tindices], padding_interior: Annotated[Any, TV_XlaPad_Tindices], name=None) -> Annotated[Any, TV_XlaPad_T]: + r"""Wraps the XLA Pad operator, documented at + + https://www.tensorflow.org/performance/xla/operation_semantics#pad + . + + Args: + input: A `Tensor`. A `Tensor` of type T. + padding_value: A `Tensor`. Must have the same type as `input`. + A scalar `Tensor` of type T. + padding_low: A `Tensor`. Must be one of the following types: `int32`, `int64`. + the padding to apply at the start of each input dimensions. Must + be a compile-time constant 1D tensor of length equal to rank of input. + padding_high: A `Tensor`. Must have the same type as `padding_low`. + the padding to apply at the end of each input dimension. Must + be a compile-time constant 1D tensor of length equal to rank of input. + padding_interior: A `Tensor`. Must have the same type as `padding_low`. + the padding to apply between each input element. Must + be a compile-time constant 1D tensor of length equal to rank of input, + containing only non-negative values. + name: A name for the operation (optional). + + Returns: + A `Tensor`. Has the same type as `input`. A `Tensor` of type T. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaPad", name, input, padding_value, padding_low, padding_high, + padding_interior) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_pad( + (input, padding_value, padding_low, padding_high, padding_interior, + name,), None) + if _result is not NotImplemented: + return _result + return xla_pad_eager_fallback( + input, padding_value, padding_low, padding_high, padding_interior, + name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_pad, (), dict(input=input, padding_value=padding_value, + padding_low=padding_low, + padding_high=padding_high, + padding_interior=padding_interior, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_pad( + (input, padding_value, padding_low, padding_high, padding_interior, + name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaPad", input=input, padding_value=padding_value, + padding_low=padding_low, padding_high=padding_high, + padding_interior=padding_interior, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_pad, (), dict(input=input, padding_value=padding_value, + padding_low=padding_low, + padding_high=padding_high, + padding_interior=padding_interior, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("T", _op._get_attr_type("T"), "Tindices", + _op._get_attr_type("Tindices")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaPad", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +XlaPad = tf_export("raw_ops.XlaPad")(_ops.to_raw_op(xla_pad)) +_dispatcher_for_xla_pad = xla_pad._tf_type_based_dispatcher.Dispatch + + +def xla_pad_eager_fallback(input: Annotated[Any, TV_XlaPad_T], padding_value: Annotated[Any, TV_XlaPad_T], padding_low: Annotated[Any, TV_XlaPad_Tindices], padding_high: Annotated[Any, TV_XlaPad_Tindices], padding_interior: Annotated[Any, TV_XlaPad_Tindices], name, ctx) -> Annotated[Any, TV_XlaPad_T]: + _attr_T, _inputs_T = _execute.args_to_matching_eager([input, padding_value], ctx, []) + (input, padding_value) = _inputs_T + _attr_Tindices, _inputs_Tindices = _execute.args_to_matching_eager([padding_low, padding_high, padding_interior], ctx, [_dtypes.int32, _dtypes.int64, ]) + (padding_low, padding_high, padding_interior) = _inputs_Tindices + _inputs_flat = [input, padding_value, padding_low, padding_high, padding_interior] + _attrs = ("T", _attr_T, "Tindices", _attr_Tindices) + _result = _execute.execute(b"XlaPad", 1, inputs=_inputs_flat, attrs=_attrs, + ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaPad", _inputs_flat, _attrs, _result) + _result, = _result + return _result + + +TV_XlaRecv_dtype = TypeVar("TV_XlaRecv_dtype", _atypes.BFloat16, _atypes.Bool, _atypes.Complex128, _atypes.Complex64, _atypes.Float16, _atypes.Float32, _atypes.Float64, _atypes.Float8e4m3fn, _atypes.Float8e5m2, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int4, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.Resource, _atypes.String, _atypes.UInt16, _atypes.UInt32, _atypes.UInt4, _atypes.UInt64, _atypes.UInt8, _atypes.Variant) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_recv') +def xla_recv(dtype: TV_XlaRecv_dtype, tensor_name: str, shape, name=None) -> Annotated[Any, TV_XlaRecv_dtype]: + r"""Receives the named tensor from another XLA computation. Wraps the XLA Recv + + operator documented at + https://www.tensorflow.org/performance/xla/operation_semantics#recv . + + Args: + dtype: A `tf.DType`. The type of the tensor. + tensor_name: A `string`. A string key that identifies the channel. + shape: A `tf.TensorShape` or list of `ints`. The shape of the tensor. + name: A name for the operation (optional). + + Returns: + A `Tensor` of type `dtype`. The tensor to receive. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaRecv", name, "dtype", dtype, "tensor_name", tensor_name, + "shape", shape) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_recv( + (dtype, tensor_name, shape, name,), None) + if _result is not NotImplemented: + return _result + return xla_recv_eager_fallback( + dtype=dtype, tensor_name=tensor_name, shape=shape, name=name, + ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_recv, (), dict(dtype=dtype, tensor_name=tensor_name, + shape=shape, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_recv( + (dtype, tensor_name, shape, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + dtype = _execute.make_type(dtype, "dtype") + tensor_name = _execute.make_str(tensor_name, "tensor_name") + shape = _execute.make_shape(shape, "shape") + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaRecv", dtype=dtype, tensor_name=tensor_name, shape=shape, + name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_recv, (), dict(dtype=dtype, tensor_name=tensor_name, + shape=shape, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("dtype", _op._get_attr_type("dtype"), "tensor_name", + _op.get_attr("tensor_name"), "shape", _op.get_attr("shape")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaRecv", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +XlaRecv = tf_export("raw_ops.XlaRecv")(_ops.to_raw_op(xla_recv)) +_dispatcher_for_xla_recv = xla_recv._tf_type_based_dispatcher.Dispatch + + +def xla_recv_eager_fallback(dtype: TV_XlaRecv_dtype, tensor_name: str, shape, name, ctx) -> Annotated[Any, TV_XlaRecv_dtype]: + dtype = _execute.make_type(dtype, "dtype") + tensor_name = _execute.make_str(tensor_name, "tensor_name") + shape = _execute.make_shape(shape, "shape") + _inputs_flat = [] + _attrs = ("dtype", dtype, "tensor_name", tensor_name, "shape", shape) + _result = _execute.execute(b"XlaRecv", 1, inputs=_inputs_flat, attrs=_attrs, + ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaRecv", _inputs_flat, _attrs, _result) + _result, = _result + return _result + + +TV_XlaReduce_T = TypeVar("TV_XlaReduce_T", _atypes.BFloat16, _atypes.Bool, _atypes.Complex128, _atypes.Complex64, _atypes.Float32, _atypes.Float64, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.UInt16, _atypes.UInt32, _atypes.UInt64, _atypes.UInt8) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_reduce') +def xla_reduce(input: Annotated[Any, TV_XlaReduce_T], init_value: Annotated[Any, TV_XlaReduce_T], dimensions_to_reduce, reducer, name=None) -> Annotated[Any, TV_XlaReduce_T]: + r"""Wraps the XLA Reduce operator, documented at + + https://www.tensorflow.org/performance/xla/operation_semantics#reduce . + + Args: + input: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `complex64`, `int64`, `qint8`, `quint8`, `qint32`, `bfloat16`, `qint16`, `quint16`, `uint16`, `complex128`, `half`, `uint32`, `uint64`, `bool`. + the input tensor + init_value: A `Tensor`. Must have the same type as `input`. + a scalar representing the initial value for the reduction + dimensions_to_reduce: A list of `ints`. + dimension numbers over which to reduce + reducer: A function decorated with @Defun. a reducer function to apply + name: A name for the operation (optional). + + Returns: + A `Tensor`. Has the same type as `input`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaReduce", name, input, init_value, "dimensions_to_reduce", + dimensions_to_reduce, "reducer", reducer) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_reduce( + (input, init_value, dimensions_to_reduce, reducer, name,), None) + if _result is not NotImplemented: + return _result + return xla_reduce_eager_fallback( + input, init_value, dimensions_to_reduce=dimensions_to_reduce, + reducer=reducer, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_reduce, (), dict(input=input, init_value=init_value, + dimensions_to_reduce=dimensions_to_reduce, + reducer=reducer, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_reduce( + (input, init_value, dimensions_to_reduce, reducer, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + if not isinstance(dimensions_to_reduce, (list, tuple)): + raise TypeError( + "Expected list for 'dimensions_to_reduce' argument to " + "'xla_reduce' Op, not %r." % dimensions_to_reduce) + dimensions_to_reduce = [_execute.make_int(_i, "dimensions_to_reduce") for _i in dimensions_to_reduce] + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaReduce", input=input, init_value=init_value, + dimensions_to_reduce=dimensions_to_reduce, + reducer=reducer, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_reduce, (), dict(input=input, init_value=init_value, + dimensions_to_reduce=dimensions_to_reduce, + reducer=reducer, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("T", _op._get_attr_type("T"), "dimensions_to_reduce", + _op.get_attr("dimensions_to_reduce"), "reducer", + _op.get_attr("reducer")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaReduce", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +XlaReduce = tf_export("raw_ops.XlaReduce")(_ops.to_raw_op(xla_reduce)) +_dispatcher_for_xla_reduce = xla_reduce._tf_type_based_dispatcher.Dispatch + + +def xla_reduce_eager_fallback(input: Annotated[Any, TV_XlaReduce_T], init_value: Annotated[Any, TV_XlaReduce_T], dimensions_to_reduce, reducer, name, ctx) -> Annotated[Any, TV_XlaReduce_T]: + if not isinstance(dimensions_to_reduce, (list, tuple)): + raise TypeError( + "Expected list for 'dimensions_to_reduce' argument to " + "'xla_reduce' Op, not %r." % dimensions_to_reduce) + dimensions_to_reduce = [_execute.make_int(_i, "dimensions_to_reduce") for _i in dimensions_to_reduce] + _attr_T, _inputs_T = _execute.args_to_matching_eager([input, init_value], ctx, [_dtypes.float32, _dtypes.float64, _dtypes.int32, _dtypes.uint8, _dtypes.int16, _dtypes.int8, _dtypes.complex64, _dtypes.int64, _dtypes.qint8, _dtypes.quint8, _dtypes.qint32, _dtypes.bfloat16, _dtypes.qint16, _dtypes.quint16, _dtypes.uint16, _dtypes.complex128, _dtypes.half, _dtypes.uint32, _dtypes.uint64, _dtypes.bool, ]) + (input, init_value) = _inputs_T + _inputs_flat = [input, init_value] + _attrs = ("T", _attr_T, "dimensions_to_reduce", dimensions_to_reduce, + "reducer", reducer) + _result = _execute.execute(b"XlaReduce", 1, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaReduce", _inputs_flat, _attrs, _result) + _result, = _result + return _result + + +TV_XlaReducePrecision_T = TypeVar("TV_XlaReducePrecision_T", _atypes.BFloat16, _atypes.Float32, _atypes.Float64, _atypes.Half) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_reduce_precision') +def xla_reduce_precision(operand: Annotated[Any, TV_XlaReducePrecision_T], exponent_bits: int, mantissa_bits: int, name=None) -> Annotated[Any, TV_XlaReducePrecision_T]: + r"""Wraps the XLA ReducePrecision operator + + documented at https://www.tensorflow.org/xla/operation_semantics#reduceprecision. + + Args: + operand: A `Tensor`. Must be one of the following types: `bfloat16`, `half`, `float32`, `float64`. + array of floating-point type. + exponent_bits: An `int`. number of exponent bits in lower-precision format + mantissa_bits: An `int`. number of mantissa bits in lower-precision format + name: A name for the operation (optional). + + Returns: + A `Tensor`. Has the same type as `operand`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaReducePrecision", name, operand, "exponent_bits", + exponent_bits, "mantissa_bits", mantissa_bits) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_reduce_precision( + (operand, exponent_bits, mantissa_bits, name,), None) + if _result is not NotImplemented: + return _result + return xla_reduce_precision_eager_fallback( + operand, exponent_bits=exponent_bits, mantissa_bits=mantissa_bits, + name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_reduce_precision, (), dict(operand=operand, + exponent_bits=exponent_bits, + mantissa_bits=mantissa_bits, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_reduce_precision( + (operand, exponent_bits, mantissa_bits, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + exponent_bits = _execute.make_int(exponent_bits, "exponent_bits") + mantissa_bits = _execute.make_int(mantissa_bits, "mantissa_bits") + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaReducePrecision", operand=operand, exponent_bits=exponent_bits, + mantissa_bits=mantissa_bits, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_reduce_precision, (), dict(operand=operand, + exponent_bits=exponent_bits, + mantissa_bits=mantissa_bits, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("T", _op._get_attr_type("T"), "exponent_bits", + _op._get_attr_int("exponent_bits"), "mantissa_bits", + _op._get_attr_int("mantissa_bits")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaReducePrecision", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +XlaReducePrecision = tf_export("raw_ops.XlaReducePrecision")(_ops.to_raw_op(xla_reduce_precision)) +_dispatcher_for_xla_reduce_precision = xla_reduce_precision._tf_type_based_dispatcher.Dispatch + + +def xla_reduce_precision_eager_fallback(operand: Annotated[Any, TV_XlaReducePrecision_T], exponent_bits: int, mantissa_bits: int, name, ctx) -> Annotated[Any, TV_XlaReducePrecision_T]: + exponent_bits = _execute.make_int(exponent_bits, "exponent_bits") + mantissa_bits = _execute.make_int(mantissa_bits, "mantissa_bits") + _attr_T, (operand,) = _execute.args_to_matching_eager([operand], ctx, [_dtypes.bfloat16, _dtypes.half, _dtypes.float32, _dtypes.float64, ]) + _inputs_flat = [operand] + _attrs = ("T", _attr_T, "exponent_bits", exponent_bits, "mantissa_bits", + mantissa_bits) + _result = _execute.execute(b"XlaReducePrecision", 1, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaReducePrecision", _inputs_flat, _attrs, _result) + _result, = _result + return _result + + +TV_XlaReduceScatter_T = TypeVar("TV_XlaReduceScatter_T", _atypes.BFloat16, _atypes.Float32, _atypes.Half, _atypes.Int32, _atypes.UInt32) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_reduce_scatter') +def xla_reduce_scatter(input: Annotated[Any, TV_XlaReduceScatter_T], group_assignment: Annotated[Any, _atypes.Int32], scatter_dimension: Annotated[Any, _atypes.Int32], reduce_op: str, name=None) -> Annotated[Any, TV_XlaReduceScatter_T]: + r"""Wraps the XLA ReduceScatter operator + + documented at https://www.tensorflow.org/xla/operation_semantics#reducescatter. + + Args: + input: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `int32`, `uint32`. + Array or a non-empty tuple of arrays to reduce across replicas. + group_assignment: A `Tensor` of type `int32`. + Groups between which the reductions are performed. + scatter_dimension: A `Tensor` of type `int32`. Dimension to scatter. + reduce_op: A `string` from: `"Min", "Max", "Mul", "Add", "Mean"`. + Reduction computation. + name: A name for the operation (optional). + + Returns: + A `Tensor`. Has the same type as `input`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaReduceScatter", name, input, group_assignment, + scatter_dimension, "reduce_op", reduce_op) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_reduce_scatter( + (input, group_assignment, scatter_dimension, reduce_op, name,), None) + if _result is not NotImplemented: + return _result + return xla_reduce_scatter_eager_fallback( + input, group_assignment, scatter_dimension, reduce_op=reduce_op, + name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_reduce_scatter, (), dict(input=input, + group_assignment=group_assignment, + scatter_dimension=scatter_dimension, + reduce_op=reduce_op, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_reduce_scatter( + (input, group_assignment, scatter_dimension, reduce_op, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + reduce_op = _execute.make_str(reduce_op, "reduce_op") + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaReduceScatter", input=input, group_assignment=group_assignment, + scatter_dimension=scatter_dimension, + reduce_op=reduce_op, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_reduce_scatter, (), dict(input=input, + group_assignment=group_assignment, + scatter_dimension=scatter_dimension, + reduce_op=reduce_op, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("T", _op._get_attr_type("T"), "reduce_op", + _op.get_attr("reduce_op")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaReduceScatter", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +XlaReduceScatter = tf_export("raw_ops.XlaReduceScatter")(_ops.to_raw_op(xla_reduce_scatter)) +_dispatcher_for_xla_reduce_scatter = xla_reduce_scatter._tf_type_based_dispatcher.Dispatch + + +def xla_reduce_scatter_eager_fallback(input: Annotated[Any, TV_XlaReduceScatter_T], group_assignment: Annotated[Any, _atypes.Int32], scatter_dimension: Annotated[Any, _atypes.Int32], reduce_op: str, name, ctx) -> Annotated[Any, TV_XlaReduceScatter_T]: + reduce_op = _execute.make_str(reduce_op, "reduce_op") + _attr_T, (input,) = _execute.args_to_matching_eager([input], ctx, [_dtypes.half, _dtypes.bfloat16, _dtypes.float32, _dtypes.int32, _dtypes.uint32, ]) + group_assignment = _ops.convert_to_tensor(group_assignment, _dtypes.int32) + scatter_dimension = _ops.convert_to_tensor(scatter_dimension, _dtypes.int32) + _inputs_flat = [input, group_assignment, scatter_dimension] + _attrs = ("T", _attr_T, "reduce_op", reduce_op) + _result = _execute.execute(b"XlaReduceScatter", 1, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaReduceScatter", _inputs_flat, _attrs, _result) + _result, = _result + return _result + + +TV_XlaReduceWindow_T = TypeVar("TV_XlaReduceWindow_T", _atypes.BFloat16, _atypes.Bool, _atypes.Complex128, _atypes.Complex64, _atypes.Float32, _atypes.Float64, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.UInt16, _atypes.UInt32, _atypes.UInt64, _atypes.UInt8) +TV_XlaReduceWindow_Tindices = TypeVar("TV_XlaReduceWindow_Tindices", _atypes.Int32, _atypes.Int64) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_reduce_window') +def xla_reduce_window(input: Annotated[Any, TV_XlaReduceWindow_T], init_value: Annotated[Any, TV_XlaReduceWindow_T], window_dimensions: Annotated[Any, TV_XlaReduceWindow_Tindices], window_strides: Annotated[Any, TV_XlaReduceWindow_Tindices], base_dilations: Annotated[Any, TV_XlaReduceWindow_Tindices], window_dilations: Annotated[Any, TV_XlaReduceWindow_Tindices], padding: Annotated[Any, TV_XlaReduceWindow_Tindices], computation, name=None) -> Annotated[Any, TV_XlaReduceWindow_T]: + r"""Wraps the XLA ReduceWindow operator, documented at + + https://www.tensorflow.org/performance/xla/operation_semantics#reducewindow . + + Args: + input: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `complex64`, `int64`, `qint8`, `quint8`, `qint32`, `bfloat16`, `qint16`, `quint16`, `uint16`, `complex128`, `half`, `uint32`, `uint64`, `bool`. + the input tensor + init_value: A `Tensor`. Must have the same type as `input`. + a scalar representing the initial value for the reduction + window_dimensions: A `Tensor`. Must be one of the following types: `int32`, `int64`. + the shape of the window + window_strides: A `Tensor`. Must have the same type as `window_dimensions`. + the inter-window strides + base_dilations: A `Tensor`. Must have the same type as `window_dimensions`. + window_dilations: A `Tensor`. Must have the same type as `window_dimensions`. + padding: A `Tensor`. Must have the same type as `window_dimensions`. + the padding to apply at the start and end of each input dimensions + computation: A function decorated with @Defun. a reducer function to apply + name: A name for the operation (optional). + + Returns: + A `Tensor`. Has the same type as `input`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaReduceWindow", name, input, init_value, window_dimensions, + window_strides, base_dilations, window_dilations, padding, + "computation", computation) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_reduce_window( + (input, init_value, window_dimensions, window_strides, + base_dilations, window_dilations, padding, computation, name,), None) + if _result is not NotImplemented: + return _result + return xla_reduce_window_eager_fallback( + input, init_value, window_dimensions, window_strides, + base_dilations, window_dilations, padding, computation=computation, + name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_reduce_window, (), dict(input=input, init_value=init_value, + window_dimensions=window_dimensions, + window_strides=window_strides, + base_dilations=base_dilations, + window_dilations=window_dilations, + padding=padding, + computation=computation, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_reduce_window( + (input, init_value, window_dimensions, window_strides, base_dilations, + window_dilations, padding, computation, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaReduceWindow", input=input, init_value=init_value, + window_dimensions=window_dimensions, + window_strides=window_strides, + base_dilations=base_dilations, + window_dilations=window_dilations, padding=padding, + computation=computation, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_reduce_window, (), dict(input=input, init_value=init_value, + window_dimensions=window_dimensions, + window_strides=window_strides, + base_dilations=base_dilations, + window_dilations=window_dilations, + padding=padding, + computation=computation, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("T", _op._get_attr_type("T"), "Tindices", + _op._get_attr_type("Tindices"), "computation", + _op.get_attr("computation")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaReduceWindow", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +XlaReduceWindow = tf_export("raw_ops.XlaReduceWindow")(_ops.to_raw_op(xla_reduce_window)) +_dispatcher_for_xla_reduce_window = xla_reduce_window._tf_type_based_dispatcher.Dispatch + + +def xla_reduce_window_eager_fallback(input: Annotated[Any, TV_XlaReduceWindow_T], init_value: Annotated[Any, TV_XlaReduceWindow_T], window_dimensions: Annotated[Any, TV_XlaReduceWindow_Tindices], window_strides: Annotated[Any, TV_XlaReduceWindow_Tindices], base_dilations: Annotated[Any, TV_XlaReduceWindow_Tindices], window_dilations: Annotated[Any, TV_XlaReduceWindow_Tindices], padding: Annotated[Any, TV_XlaReduceWindow_Tindices], computation, name, ctx) -> Annotated[Any, TV_XlaReduceWindow_T]: + _attr_T, _inputs_T = _execute.args_to_matching_eager([input, init_value], ctx, [_dtypes.float32, _dtypes.float64, _dtypes.int32, _dtypes.uint8, _dtypes.int16, _dtypes.int8, _dtypes.complex64, _dtypes.int64, _dtypes.qint8, _dtypes.quint8, _dtypes.qint32, _dtypes.bfloat16, _dtypes.qint16, _dtypes.quint16, _dtypes.uint16, _dtypes.complex128, _dtypes.half, _dtypes.uint32, _dtypes.uint64, _dtypes.bool, ]) + (input, init_value) = _inputs_T + _attr_Tindices, _inputs_Tindices = _execute.args_to_matching_eager([window_dimensions, window_strides, base_dilations, window_dilations, padding], ctx, [_dtypes.int32, _dtypes.int64, ]) + (window_dimensions, window_strides, base_dilations, window_dilations, padding) = _inputs_Tindices + _inputs_flat = [input, init_value, window_dimensions, window_strides, base_dilations, window_dilations, padding] + _attrs = ("T", _attr_T, "Tindices", _attr_Tindices, "computation", + computation) + _result = _execute.execute(b"XlaReduceWindow", 1, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaReduceWindow", _inputs_flat, _attrs, _result) + _result, = _result + return _result + + +TV_XlaRemoveDynamicDimensionSize_T = TypeVar("TV_XlaRemoveDynamicDimensionSize_T", _atypes.BFloat16, _atypes.Bool, _atypes.Complex128, _atypes.Complex64, _atypes.Float16, _atypes.Float32, _atypes.Float64, _atypes.Float8e4m3fn, _atypes.Float8e5m2, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int4, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.Resource, _atypes.String, _atypes.UInt16, _atypes.UInt32, _atypes.UInt4, _atypes.UInt64, _atypes.UInt8, _atypes.Variant) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_remove_dynamic_dimension_size') +def xla_remove_dynamic_dimension_size(input: Annotated[Any, TV_XlaRemoveDynamicDimensionSize_T], dim_index: Annotated[Any, _atypes.Int32], name=None) -> Annotated[Any, TV_XlaRemoveDynamicDimensionSize_T]: + r"""Inverse of XlaSetDynamicDimensionSize. + + Make an xla bounded dynamic dimension into a static dimension. The bound of the + size of dimension `dim_index` becomes the static dimension size. + + Args: + input: A `Tensor`. + dim_index: A `Tensor` of type `int32`. + name: A name for the operation (optional). + + Returns: + A `Tensor`. Has the same type as `input`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaRemoveDynamicDimensionSize", name, input, dim_index) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_remove_dynamic_dimension_size( + (input, dim_index, name,), None) + if _result is not NotImplemented: + return _result + return xla_remove_dynamic_dimension_size_eager_fallback( + input, dim_index, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_remove_dynamic_dimension_size, (), dict(input=input, + dim_index=dim_index, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_remove_dynamic_dimension_size( + (input, dim_index, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaRemoveDynamicDimensionSize", input=input, dim_index=dim_index, + name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_remove_dynamic_dimension_size, (), dict(input=input, + dim_index=dim_index, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("T", _op._get_attr_type("T")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaRemoveDynamicDimensionSize", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +XlaRemoveDynamicDimensionSize = tf_export("raw_ops.XlaRemoveDynamicDimensionSize")(_ops.to_raw_op(xla_remove_dynamic_dimension_size)) +_dispatcher_for_xla_remove_dynamic_dimension_size = xla_remove_dynamic_dimension_size._tf_type_based_dispatcher.Dispatch + + +def xla_remove_dynamic_dimension_size_eager_fallback(input: Annotated[Any, TV_XlaRemoveDynamicDimensionSize_T], dim_index: Annotated[Any, _atypes.Int32], name, ctx) -> Annotated[Any, TV_XlaRemoveDynamicDimensionSize_T]: + _attr_T, (input,) = _execute.args_to_matching_eager([input], ctx, []) + dim_index = _ops.convert_to_tensor(dim_index, _dtypes.int32) + _inputs_flat = [input, dim_index] + _attrs = ("T", _attr_T) + _result = _execute.execute(b"XlaRemoveDynamicDimensionSize", 1, + inputs=_inputs_flat, attrs=_attrs, ctx=ctx, + name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaRemoveDynamicDimensionSize", _inputs_flat, _attrs, _result) + _result, = _result + return _result + + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_replica_id') +def xla_replica_id(name=None) -> Annotated[Any, _atypes.Int32]: + r"""Replica ID. + + Args: + name: A name for the operation (optional). + + Returns: + A `Tensor` of type `int32`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaReplicaId", name) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_replica_id( + (name,), None) + if _result is not NotImplemented: + return _result + return xla_replica_id_eager_fallback( + name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_replica_id, (), dict(name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_replica_id( + (name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaReplicaId", name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_replica_id, (), dict(name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = () + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaReplicaId", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +XlaReplicaId = tf_export("raw_ops.XlaReplicaId")(_ops.to_raw_op(xla_replica_id)) +_dispatcher_for_xla_replica_id = xla_replica_id._tf_type_based_dispatcher.Dispatch + + +def xla_replica_id_eager_fallback(name, ctx) -> Annotated[Any, _atypes.Int32]: + _inputs_flat = [] + _attrs = None + _result = _execute.execute(b"XlaReplicaId", 1, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaReplicaId", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +_XlaRngBitGeneratorOutput = collections.namedtuple( + "XlaRngBitGenerator", + ["output_key", "output"]) + + +TV_XlaRngBitGenerator_dtype = TypeVar("TV_XlaRngBitGenerator_dtype", _atypes.Int32, _atypes.Int64, _atypes.UInt32, _atypes.UInt64) +TV_XlaRngBitGenerator_Tshape = TypeVar("TV_XlaRngBitGenerator_Tshape", _atypes.Int32, _atypes.Int64) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_rng_bit_generator') +def xla_rng_bit_generator(algorithm: Annotated[Any, _atypes.Int32], initial_state: Annotated[Any, _atypes.UInt64], shape: Annotated[Any, TV_XlaRngBitGenerator_Tshape], dtype:TV_XlaRngBitGenerator_dtype=_dtypes.uint64, name=None): + r"""Stateless PRNG bit generator. + + Wraps the XLA RngBitGenerator operator, documented at + https://www.tensorflow.org/performance/xla/operation_semantics#rngbitgenerator. + + Args: + algorithm: A `Tensor` of type `int32`. The PRNG algorithm to use, one of + tf.random.Algorithm.{PHILOX, THREEFRY, AUTO_SELECT}. + initial_state: A `Tensor` of type `uint64`. + Initial state for the PRNG algorithm. For THREEFRY, it should be + a u64[2] and for PHILOX a u64[3]. + shape: A `Tensor`. Must be one of the following types: `int32`, `int64`. + The output shape of the generated data. + dtype: An optional `tf.DType` from: `tf.int32, tf.int64, tf.uint32, tf.uint64`. Defaults to `tf.uint64`. + The type of the tensor. + name: A name for the operation (optional). + + Returns: + A tuple of `Tensor` objects (output_key, output). + + output_key: A `Tensor` of type `uint64`. + output: A `Tensor` of type `dtype`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaRngBitGenerator", name, algorithm, initial_state, shape, + "dtype", dtype) + _result = _XlaRngBitGeneratorOutput._make(_result) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_rng_bit_generator( + (algorithm, initial_state, shape, dtype, name,), None) + if _result is not NotImplemented: + return _result + return xla_rng_bit_generator_eager_fallback( + algorithm, initial_state, shape, dtype=dtype, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_rng_bit_generator, (), dict(algorithm=algorithm, + initial_state=initial_state, + shape=shape, dtype=dtype, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_rng_bit_generator( + (algorithm, initial_state, shape, dtype, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + if dtype is None: + dtype = _dtypes.uint64 + dtype = _execute.make_type(dtype, "dtype") + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaRngBitGenerator", algorithm=algorithm, + initial_state=initial_state, shape=shape, + dtype=dtype, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_rng_bit_generator, (), dict(algorithm=algorithm, + initial_state=initial_state, + shape=shape, dtype=dtype, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("dtype", _op._get_attr_type("dtype"), "Tshape", + _op._get_attr_type("Tshape")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaRngBitGenerator", _inputs_flat, _attrs, _result) + _result = _XlaRngBitGeneratorOutput._make(_result) + return _result + +XlaRngBitGenerator = tf_export("raw_ops.XlaRngBitGenerator")(_ops.to_raw_op(xla_rng_bit_generator)) +_dispatcher_for_xla_rng_bit_generator = xla_rng_bit_generator._tf_type_based_dispatcher.Dispatch + + +def xla_rng_bit_generator_eager_fallback(algorithm: Annotated[Any, _atypes.Int32], initial_state: Annotated[Any, _atypes.UInt64], shape: Annotated[Any, TV_XlaRngBitGenerator_Tshape], dtype: TV_XlaRngBitGenerator_dtype, name, ctx): + if dtype is None: + dtype = _dtypes.uint64 + dtype = _execute.make_type(dtype, "dtype") + _attr_Tshape, (shape,) = _execute.args_to_matching_eager([shape], ctx, [_dtypes.int32, _dtypes.int64, ], _dtypes.int32) + algorithm = _ops.convert_to_tensor(algorithm, _dtypes.int32) + initial_state = _ops.convert_to_tensor(initial_state, _dtypes.uint64) + _inputs_flat = [algorithm, initial_state, shape] + _attrs = ("dtype", dtype, "Tshape", _attr_Tshape) + _result = _execute.execute(b"XlaRngBitGenerator", 2, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaRngBitGenerator", _inputs_flat, _attrs, _result) + _result = _XlaRngBitGeneratorOutput._make(_result) + return _result + + +TV_XlaScatter_T = TypeVar("TV_XlaScatter_T", _atypes.BFloat16, _atypes.Bool, _atypes.Complex128, _atypes.Complex64, _atypes.Float32, _atypes.Float64, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.UInt16, _atypes.UInt32, _atypes.UInt64, _atypes.UInt8) +TV_XlaScatter_Tindices = TypeVar("TV_XlaScatter_Tindices", _atypes.Int32, _atypes.Int64) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_scatter') +def xla_scatter(operand: Annotated[Any, TV_XlaScatter_T], scatter_indices: Annotated[Any, TV_XlaScatter_Tindices], updates: Annotated[Any, TV_XlaScatter_T], update_computation, dimension_numbers: str, indices_are_sorted: bool, name=None) -> Annotated[Any, TV_XlaScatter_T]: + r"""Wraps the XLA Scatter operator documented at + + https://www.tensorflow.org/xla/operation_semantics#scatter. + + Args: + operand: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `complex64`, `int64`, `qint8`, `quint8`, `qint32`, `bfloat16`, `qint16`, `quint16`, `uint16`, `complex128`, `half`, `uint32`, `uint64`, `bool`. + Array to be scattered into. + scatter_indices: A `Tensor`. Must be one of the following types: `int32`, `int64`. + Array containing the starting indices of the slices that must + be scattered to. + updates: A `Tensor`. Must have the same type as `operand`. + Array containing the values that must be used for scattering. + update_computation: A function decorated with @Defun. + Computation to be used for combining the existing values in + the input array and the updates during scatter. + dimension_numbers: A `string`. + A serialized xla::ScatterDimensionNumbers proto. + indices_are_sorted: A `bool`. + Boolean indicating if the indices are sorted. + name: A name for the operation (optional). + + Returns: + A `Tensor`. Has the same type as `operand`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaScatter", name, operand, scatter_indices, updates, + "update_computation", update_computation, "dimension_numbers", + dimension_numbers, "indices_are_sorted", indices_are_sorted) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_scatter( + (operand, scatter_indices, updates, update_computation, + dimension_numbers, indices_are_sorted, name,), None) + if _result is not NotImplemented: + return _result + return xla_scatter_eager_fallback( + operand, scatter_indices, updates, + update_computation=update_computation, + dimension_numbers=dimension_numbers, + indices_are_sorted=indices_are_sorted, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_scatter, (), dict(operand=operand, + scatter_indices=scatter_indices, + updates=updates, + update_computation=update_computation, + dimension_numbers=dimension_numbers, + indices_are_sorted=indices_are_sorted, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_scatter( + (operand, scatter_indices, updates, update_computation, + dimension_numbers, indices_are_sorted, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + dimension_numbers = _execute.make_str(dimension_numbers, "dimension_numbers") + indices_are_sorted = _execute.make_bool(indices_are_sorted, "indices_are_sorted") + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaScatter", operand=operand, scatter_indices=scatter_indices, + updates=updates, update_computation=update_computation, + dimension_numbers=dimension_numbers, + indices_are_sorted=indices_are_sorted, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_scatter, (), dict(operand=operand, + scatter_indices=scatter_indices, + updates=updates, + update_computation=update_computation, + dimension_numbers=dimension_numbers, + indices_are_sorted=indices_are_sorted, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("update_computation", _op.get_attr("update_computation"), + "dimension_numbers", _op.get_attr("dimension_numbers"), + "indices_are_sorted", _op._get_attr_bool("indices_are_sorted"), + "T", _op._get_attr_type("T"), "Tindices", + _op._get_attr_type("Tindices")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaScatter", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +XlaScatter = tf_export("raw_ops.XlaScatter")(_ops.to_raw_op(xla_scatter)) +_dispatcher_for_xla_scatter = xla_scatter._tf_type_based_dispatcher.Dispatch + + +def xla_scatter_eager_fallback(operand: Annotated[Any, TV_XlaScatter_T], scatter_indices: Annotated[Any, TV_XlaScatter_Tindices], updates: Annotated[Any, TV_XlaScatter_T], update_computation, dimension_numbers: str, indices_are_sorted: bool, name, ctx) -> Annotated[Any, TV_XlaScatter_T]: + dimension_numbers = _execute.make_str(dimension_numbers, "dimension_numbers") + indices_are_sorted = _execute.make_bool(indices_are_sorted, "indices_are_sorted") + _attr_T, _inputs_T = _execute.args_to_matching_eager([operand, updates], ctx, [_dtypes.float32, _dtypes.float64, _dtypes.int32, _dtypes.uint8, _dtypes.int16, _dtypes.int8, _dtypes.complex64, _dtypes.int64, _dtypes.qint8, _dtypes.quint8, _dtypes.qint32, _dtypes.bfloat16, _dtypes.qint16, _dtypes.quint16, _dtypes.uint16, _dtypes.complex128, _dtypes.half, _dtypes.uint32, _dtypes.uint64, _dtypes.bool, ]) + (operand, updates) = _inputs_T + _attr_Tindices, (scatter_indices,) = _execute.args_to_matching_eager([scatter_indices], ctx, [_dtypes.int32, _dtypes.int64, ]) + _inputs_flat = [operand, scatter_indices, updates] + _attrs = ("update_computation", update_computation, "dimension_numbers", + dimension_numbers, "indices_are_sorted", indices_are_sorted, "T", _attr_T, + "Tindices", _attr_Tindices) + _result = _execute.execute(b"XlaScatter", 1, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaScatter", _inputs_flat, _attrs, _result) + _result, = _result + return _result + + +TV_XlaSelectAndScatter_T = TypeVar("TV_XlaSelectAndScatter_T", _atypes.BFloat16, _atypes.Complex128, _atypes.Complex64, _atypes.Float32, _atypes.Float64, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.UInt16, _atypes.UInt32, _atypes.UInt64, _atypes.UInt8) +TV_XlaSelectAndScatter_Tindices = TypeVar("TV_XlaSelectAndScatter_Tindices", _atypes.Int32, _atypes.Int64) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_select_and_scatter') +def xla_select_and_scatter(operand: Annotated[Any, TV_XlaSelectAndScatter_T], window_dimensions: Annotated[Any, TV_XlaSelectAndScatter_Tindices], window_strides: Annotated[Any, TV_XlaSelectAndScatter_Tindices], padding: Annotated[Any, TV_XlaSelectAndScatter_Tindices], source: Annotated[Any, TV_XlaSelectAndScatter_T], init_value: Annotated[Any, TV_XlaSelectAndScatter_T], select, scatter, name=None) -> Annotated[Any, TV_XlaSelectAndScatter_T]: + r"""Wraps the XLA SelectAndScatter operator, documented at + + https://www.tensorflow.org/performance/xla/operation_semantics#selectandscatter + . + + Args: + operand: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `complex64`, `int64`, `qint8`, `quint8`, `qint32`, `bfloat16`, `qint16`, `quint16`, `uint16`, `complex128`, `half`, `uint32`, `uint64`. + the input tensor + window_dimensions: A `Tensor`. Must be one of the following types: `int32`, `int64`. + the shape of the window + window_strides: A `Tensor`. Must have the same type as `window_dimensions`. + the inter-window strides + padding: A `Tensor`. Must have the same type as `window_dimensions`. + the padding to apply at the start and end of each input dimensions + source: A `Tensor`. Must have the same type as `operand`. + a tensor of values to scatter + init_value: A `Tensor`. Must have the same type as `operand`. + a scalar representing the initial value for the output tensor + select: A function decorated with @Defun. a selection function to apply + scatter: A function decorated with @Defun. a scatter function to apply + name: A name for the operation (optional). + + Returns: + A `Tensor`. Has the same type as `operand`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaSelectAndScatter", name, operand, window_dimensions, + window_strides, padding, source, init_value, "select", select, + "scatter", scatter) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_select_and_scatter( + (operand, window_dimensions, window_strides, padding, source, + init_value, select, scatter, name,), None) + if _result is not NotImplemented: + return _result + return xla_select_and_scatter_eager_fallback( + operand, window_dimensions, window_strides, padding, source, + init_value, select=select, scatter=scatter, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_select_and_scatter, (), dict(operand=operand, + window_dimensions=window_dimensions, + window_strides=window_strides, + padding=padding, source=source, + init_value=init_value, + select=select, scatter=scatter, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_select_and_scatter( + (operand, window_dimensions, window_strides, padding, source, + init_value, select, scatter, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaSelectAndScatter", operand=operand, + window_dimensions=window_dimensions, + window_strides=window_strides, padding=padding, + source=source, init_value=init_value, + select=select, scatter=scatter, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_select_and_scatter, (), dict(operand=operand, + window_dimensions=window_dimensions, + window_strides=window_strides, + padding=padding, source=source, + init_value=init_value, + select=select, scatter=scatter, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("T", _op._get_attr_type("T"), "Tindices", + _op._get_attr_type("Tindices"), "select", + _op.get_attr("select"), "scatter", _op.get_attr("scatter")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaSelectAndScatter", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +XlaSelectAndScatter = tf_export("raw_ops.XlaSelectAndScatter")(_ops.to_raw_op(xla_select_and_scatter)) +_dispatcher_for_xla_select_and_scatter = xla_select_and_scatter._tf_type_based_dispatcher.Dispatch + + +def xla_select_and_scatter_eager_fallback(operand: Annotated[Any, TV_XlaSelectAndScatter_T], window_dimensions: Annotated[Any, TV_XlaSelectAndScatter_Tindices], window_strides: Annotated[Any, TV_XlaSelectAndScatter_Tindices], padding: Annotated[Any, TV_XlaSelectAndScatter_Tindices], source: Annotated[Any, TV_XlaSelectAndScatter_T], init_value: Annotated[Any, TV_XlaSelectAndScatter_T], select, scatter, name, ctx) -> Annotated[Any, TV_XlaSelectAndScatter_T]: + _attr_T, _inputs_T = _execute.args_to_matching_eager([operand, source, init_value], ctx, [_dtypes.float32, _dtypes.float64, _dtypes.int32, _dtypes.uint8, _dtypes.int16, _dtypes.int8, _dtypes.complex64, _dtypes.int64, _dtypes.qint8, _dtypes.quint8, _dtypes.qint32, _dtypes.bfloat16, _dtypes.qint16, _dtypes.quint16, _dtypes.uint16, _dtypes.complex128, _dtypes.half, _dtypes.uint32, _dtypes.uint64, ]) + (operand, source, init_value) = _inputs_T + _attr_Tindices, _inputs_Tindices = _execute.args_to_matching_eager([window_dimensions, window_strides, padding], ctx, [_dtypes.int32, _dtypes.int64, ]) + (window_dimensions, window_strides, padding) = _inputs_Tindices + _inputs_flat = [operand, window_dimensions, window_strides, padding, source, init_value] + _attrs = ("T", _attr_T, "Tindices", _attr_Tindices, "select", select, + "scatter", scatter) + _result = _execute.execute(b"XlaSelectAndScatter", 1, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaSelectAndScatter", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +_XlaSelfAdjointEigOutput = collections.namedtuple( + "XlaSelfAdjointEig", + ["w", "v"]) + + +TV_XlaSelfAdjointEig_T = TypeVar("TV_XlaSelfAdjointEig_T", _atypes.BFloat16, _atypes.Complex128, _atypes.Complex64, _atypes.Float32, _atypes.Float64, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.UInt16, _atypes.UInt32, _atypes.UInt64, _atypes.UInt8) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_self_adjoint_eig') +def xla_self_adjoint_eig(a: Annotated[Any, TV_XlaSelfAdjointEig_T], lower: bool, max_iter: int, epsilon: float, name=None): + r"""Computes the eigen decomposition of a batch of self-adjoint matrices + + (Note: Only real inputs are supported). + + Computes the eigenvalues and eigenvectors of the innermost N-by-N matrices in + tensor such that tensor[...,:,:] * v[..., :,i] = e[..., i] * v[...,:,i], for + i=0...N-1. + + Args: + a: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `complex64`, `int64`, `qint8`, `quint8`, `qint32`, `bfloat16`, `qint16`, `quint16`, `uint16`, `complex128`, `half`, `uint32`, `uint64`. + the input tensor. + lower: A `bool`. + a boolean specifies whether the calculation is done with the lower + triangular part or the upper triangular part. + max_iter: An `int`. + maximum number of sweep update, i.e., the whole lower triangular + part or upper triangular part based on parameter lower. Heuristically, it has + been argued that approximately logN sweeps are needed in practice (Ref: Golub & + van Loan "Matrix Computation"). + epsilon: A `float`. the tolerance ratio. + name: A name for the operation (optional). + + Returns: + A tuple of `Tensor` objects (w, v). + + w: A `Tensor`. Has the same type as `a`. The eigenvalues in ascending order, each repeated according to its + multiplicity. + v: A `Tensor`. Has the same type as `a`. The column v[..., :, i] is the normalized eigenvector corresponding to the + eigenvalue w[..., i]. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaSelfAdjointEig", name, a, "lower", lower, "max_iter", + max_iter, "epsilon", epsilon) + _result = _XlaSelfAdjointEigOutput._make(_result) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_self_adjoint_eig( + (a, lower, max_iter, epsilon, name,), None) + if _result is not NotImplemented: + return _result + return xla_self_adjoint_eig_eager_fallback( + a, lower=lower, max_iter=max_iter, epsilon=epsilon, name=name, + ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_self_adjoint_eig, (), dict(a=a, lower=lower, + max_iter=max_iter, epsilon=epsilon, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_self_adjoint_eig( + (a, lower, max_iter, epsilon, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + lower = _execute.make_bool(lower, "lower") + max_iter = _execute.make_int(max_iter, "max_iter") + epsilon = _execute.make_float(epsilon, "epsilon") + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaSelfAdjointEig", a=a, lower=lower, max_iter=max_iter, + epsilon=epsilon, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_self_adjoint_eig, (), dict(a=a, lower=lower, max_iter=max_iter, + epsilon=epsilon, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("lower", _op._get_attr_bool("lower"), "max_iter", + _op._get_attr_int("max_iter"), "epsilon", + _op.get_attr("epsilon"), "T", _op._get_attr_type("T")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaSelfAdjointEig", _inputs_flat, _attrs, _result) + _result = _XlaSelfAdjointEigOutput._make(_result) + return _result + +XlaSelfAdjointEig = tf_export("raw_ops.XlaSelfAdjointEig")(_ops.to_raw_op(xla_self_adjoint_eig)) +_dispatcher_for_xla_self_adjoint_eig = xla_self_adjoint_eig._tf_type_based_dispatcher.Dispatch + + +def xla_self_adjoint_eig_eager_fallback(a: Annotated[Any, TV_XlaSelfAdjointEig_T], lower: bool, max_iter: int, epsilon: float, name, ctx): + lower = _execute.make_bool(lower, "lower") + max_iter = _execute.make_int(max_iter, "max_iter") + epsilon = _execute.make_float(epsilon, "epsilon") + _attr_T, (a,) = _execute.args_to_matching_eager([a], ctx, [_dtypes.float32, _dtypes.float64, _dtypes.int32, _dtypes.uint8, _dtypes.int16, _dtypes.int8, _dtypes.complex64, _dtypes.int64, _dtypes.qint8, _dtypes.quint8, _dtypes.qint32, _dtypes.bfloat16, _dtypes.qint16, _dtypes.quint16, _dtypes.uint16, _dtypes.complex128, _dtypes.half, _dtypes.uint32, _dtypes.uint64, ]) + _inputs_flat = [a] + _attrs = ("lower", lower, "max_iter", max_iter, "epsilon", epsilon, "T", + _attr_T) + _result = _execute.execute(b"XlaSelfAdjointEig", 2, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaSelfAdjointEig", _inputs_flat, _attrs, _result) + _result = _XlaSelfAdjointEigOutput._make(_result) + return _result + + +TV_XlaSend_T = TypeVar("TV_XlaSend_T", _atypes.BFloat16, _atypes.Bool, _atypes.Complex128, _atypes.Complex64, _atypes.Float16, _atypes.Float32, _atypes.Float64, _atypes.Float8e4m3fn, _atypes.Float8e5m2, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int4, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.Resource, _atypes.String, _atypes.UInt16, _atypes.UInt32, _atypes.UInt4, _atypes.UInt64, _atypes.UInt8, _atypes.Variant) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_send') +def xla_send(tensor: Annotated[Any, TV_XlaSend_T], tensor_name: str, name=None): + r"""Sends the named tensor to another XLA computation. Wraps the XLA Send operator + + documented at + https://www.tensorflow.org/performance/xla/operation_semantics#send . + + Args: + tensor: A `Tensor`. The tensor to send. + tensor_name: A `string`. A string key that identifies the channel. + name: A name for the operation (optional). + + Returns: + The created Operation. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaSend", name, tensor, "tensor_name", tensor_name) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_send( + (tensor, tensor_name, name,), None) + if _result is not NotImplemented: + return _result + return xla_send_eager_fallback( + tensor, tensor_name=tensor_name, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_send, (), dict(tensor=tensor, tensor_name=tensor_name, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_send( + (tensor, tensor_name, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + tensor_name = _execute.make_str(tensor_name, "tensor_name") + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaSend", tensor=tensor, tensor_name=tensor_name, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_send, (), dict(tensor=tensor, tensor_name=tensor_name, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + return _op +XlaSend = tf_export("raw_ops.XlaSend")(_ops.to_raw_op(xla_send)) +_dispatcher_for_xla_send = xla_send._tf_type_based_dispatcher.Dispatch + + +def xla_send_eager_fallback(tensor: Annotated[Any, TV_XlaSend_T], tensor_name: str, name, ctx): + tensor_name = _execute.make_str(tensor_name, "tensor_name") + _attr_T, (tensor,) = _execute.args_to_matching_eager([tensor], ctx, []) + _inputs_flat = [tensor] + _attrs = ("T", _attr_T, "tensor_name", tensor_name) + _result = _execute.execute(b"XlaSend", 0, inputs=_inputs_flat, attrs=_attrs, + ctx=ctx, name=name) + _result = None + return _result + + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_set_bound') +def xla_set_bound(input: Annotated[Any, _atypes.Int32], bound: Annotated[Any, _atypes.Int32], name=None) -> Annotated[Any, _atypes.Int32]: + r"""Set a bound for the given input value as a hint to Xla compiler, + + returns the same value. + + Args: + input: A `Tensor` of type `int32`. + bound: A `Tensor` of type `int32`. + name: A name for the operation (optional). + + Returns: + A `Tensor` of type `int32`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaSetBound", name, input, bound) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_set_bound( + (input, bound, name,), None) + if _result is not NotImplemented: + return _result + return xla_set_bound_eager_fallback( + input, bound, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_set_bound, (), dict(input=input, bound=bound, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_set_bound( + (input, bound, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaSetBound", input=input, bound=bound, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_set_bound, (), dict(input=input, bound=bound, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = () + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaSetBound", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +XlaSetBound = tf_export("raw_ops.XlaSetBound")(_ops.to_raw_op(xla_set_bound)) +_dispatcher_for_xla_set_bound = xla_set_bound._tf_type_based_dispatcher.Dispatch + + +def xla_set_bound_eager_fallback(input: Annotated[Any, _atypes.Int32], bound: Annotated[Any, _atypes.Int32], name, ctx) -> Annotated[Any, _atypes.Int32]: + input = _ops.convert_to_tensor(input, _dtypes.int32) + bound = _ops.convert_to_tensor(bound, _dtypes.int32) + _inputs_flat = [input, bound] + _attrs = None + _result = _execute.execute(b"XlaSetBound", 1, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaSetBound", _inputs_flat, _attrs, _result) + _result, = _result + return _result + + +TV_XlaSetDynamicDimensionSize_T = TypeVar("TV_XlaSetDynamicDimensionSize_T", _atypes.BFloat16, _atypes.Bool, _atypes.Complex128, _atypes.Complex64, _atypes.Float16, _atypes.Float32, _atypes.Float64, _atypes.Float8e4m3fn, _atypes.Float8e5m2, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int4, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.Resource, _atypes.String, _atypes.UInt16, _atypes.UInt32, _atypes.UInt4, _atypes.UInt64, _atypes.UInt8, _atypes.Variant) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_set_dynamic_dimension_size') +def xla_set_dynamic_dimension_size(input: Annotated[Any, TV_XlaSetDynamicDimensionSize_T], dim_index: Annotated[Any, _atypes.Int32], size: Annotated[Any, _atypes.Int32], name=None) -> Annotated[Any, TV_XlaSetDynamicDimensionSize_T]: + r"""Make a static dimension into a xla bounded dynamic dimension. + + The current static dimension size will become the bound and the second + operand becomes the dynamic size of the dimension. + + Args: + input: A `Tensor`. + dim_index: A `Tensor` of type `int32`. + size: A `Tensor` of type `int32`. + name: A name for the operation (optional). + + Returns: + A `Tensor`. Has the same type as `input`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaSetDynamicDimensionSize", name, input, dim_index, size) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_set_dynamic_dimension_size( + (input, dim_index, size, name,), None) + if _result is not NotImplemented: + return _result + return xla_set_dynamic_dimension_size_eager_fallback( + input, dim_index, size, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_set_dynamic_dimension_size, (), dict(input=input, + dim_index=dim_index, + size=size, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_set_dynamic_dimension_size( + (input, dim_index, size, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaSetDynamicDimensionSize", input=input, dim_index=dim_index, + size=size, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_set_dynamic_dimension_size, (), dict(input=input, + dim_index=dim_index, + size=size, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("T", _op._get_attr_type("T")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaSetDynamicDimensionSize", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +XlaSetDynamicDimensionSize = tf_export("raw_ops.XlaSetDynamicDimensionSize")(_ops.to_raw_op(xla_set_dynamic_dimension_size)) +_dispatcher_for_xla_set_dynamic_dimension_size = xla_set_dynamic_dimension_size._tf_type_based_dispatcher.Dispatch + + +def xla_set_dynamic_dimension_size_eager_fallback(input: Annotated[Any, TV_XlaSetDynamicDimensionSize_T], dim_index: Annotated[Any, _atypes.Int32], size: Annotated[Any, _atypes.Int32], name, ctx) -> Annotated[Any, TV_XlaSetDynamicDimensionSize_T]: + _attr_T, (input,) = _execute.args_to_matching_eager([input], ctx, []) + dim_index = _ops.convert_to_tensor(dim_index, _dtypes.int32) + size = _ops.convert_to_tensor(size, _dtypes.int32) + _inputs_flat = [input, dim_index, size] + _attrs = ("T", _attr_T) + _result = _execute.execute(b"XlaSetDynamicDimensionSize", 1, + inputs=_inputs_flat, attrs=_attrs, ctx=ctx, + name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaSetDynamicDimensionSize", _inputs_flat, _attrs, _result) + _result, = _result + return _result + + +TV_XlaSharding_T = TypeVar("TV_XlaSharding_T", _atypes.BFloat16, _atypes.Bool, _atypes.Complex128, _atypes.Complex64, _atypes.Float16, _atypes.Float32, _atypes.Float64, _atypes.Float8e4m3fn, _atypes.Float8e5m2, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int4, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.Resource, _atypes.String, _atypes.UInt16, _atypes.UInt32, _atypes.UInt4, _atypes.UInt64, _atypes.UInt8, _atypes.Variant) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_sharding') +def xla_sharding(input: Annotated[Any, TV_XlaSharding_T], sharding:str="", unspecified_dims=[], name=None) -> Annotated[Any, TV_XlaSharding_T]: + r"""An op which shards the input based on the given sharding attribute. It can + + selectively annotate a subset of tensor dimensions by skipping unspecified_dims, + and the sharding annotation should be replicated in those dims. + + Args: + input: A `Tensor`. + sharding: An optional `string`. Defaults to `""`. + unspecified_dims: An optional list of `ints`. Defaults to `[]`. + name: A name for the operation (optional). + + Returns: + A `Tensor`. Has the same type as `input`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaSharding", name, input, "sharding", sharding, + "unspecified_dims", unspecified_dims) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_sharding( + (input, sharding, unspecified_dims, name,), None) + if _result is not NotImplemented: + return _result + return xla_sharding_eager_fallback( + input, sharding=sharding, unspecified_dims=unspecified_dims, + name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_sharding, (), dict(input=input, sharding=sharding, + unspecified_dims=unspecified_dims, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_sharding( + (input, sharding, unspecified_dims, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + if sharding is None: + sharding = "" + sharding = _execute.make_str(sharding, "sharding") + if unspecified_dims is None: + unspecified_dims = [] + if not isinstance(unspecified_dims, (list, tuple)): + raise TypeError( + "Expected list for 'unspecified_dims' argument to " + "'xla_sharding' Op, not %r." % unspecified_dims) + unspecified_dims = [_execute.make_int(_i, "unspecified_dims") for _i in unspecified_dims] + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaSharding", input=input, sharding=sharding, + unspecified_dims=unspecified_dims, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_sharding, (), dict(input=input, sharding=sharding, + unspecified_dims=unspecified_dims, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("T", _op._get_attr_type("T"), "sharding", + _op.get_attr("sharding"), "unspecified_dims", + _op.get_attr("unspecified_dims")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaSharding", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +XlaSharding = tf_export("raw_ops.XlaSharding")(_ops.to_raw_op(xla_sharding)) +_dispatcher_for_xla_sharding = xla_sharding._tf_type_based_dispatcher.Dispatch + + +def xla_sharding_eager_fallback(input: Annotated[Any, TV_XlaSharding_T], sharding: str, unspecified_dims, name, ctx) -> Annotated[Any, TV_XlaSharding_T]: + if sharding is None: + sharding = "" + sharding = _execute.make_str(sharding, "sharding") + if unspecified_dims is None: + unspecified_dims = [] + if not isinstance(unspecified_dims, (list, tuple)): + raise TypeError( + "Expected list for 'unspecified_dims' argument to " + "'xla_sharding' Op, not %r." % unspecified_dims) + unspecified_dims = [_execute.make_int(_i, "unspecified_dims") for _i in unspecified_dims] + _attr_T, (input,) = _execute.args_to_matching_eager([input], ctx, []) + _inputs_flat = [input] + _attrs = ("T", _attr_T, "sharding", sharding, "unspecified_dims", + unspecified_dims) + _result = _execute.execute(b"XlaSharding", 1, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaSharding", _inputs_flat, _attrs, _result) + _result, = _result + return _result + + +TV_XlaSort_T = TypeVar("TV_XlaSort_T", _atypes.BFloat16, _atypes.Bool, _atypes.Complex128, _atypes.Complex64, _atypes.Float16, _atypes.Float32, _atypes.Float64, _atypes.Float8e4m3fn, _atypes.Float8e5m2, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int4, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.Resource, _atypes.String, _atypes.UInt16, _atypes.UInt32, _atypes.UInt4, _atypes.UInt64, _atypes.UInt8, _atypes.Variant) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_sort') +def xla_sort(input: Annotated[Any, TV_XlaSort_T], name=None) -> Annotated[Any, TV_XlaSort_T]: + r"""Wraps the XLA Sort operator, documented at + + https://www.tensorflow.org/performance/xla/operation_semantics#sort + . + + Sorts a tensor. Currently only sorts in ascending order are supported. + + Args: + input: A `Tensor`. A `Tensor` of type T. + name: A name for the operation (optional). + + Returns: + A `Tensor`. Has the same type as `input`. A `Tensor` of type T. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaSort", name, input) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_sort( + (input, name,), None) + if _result is not NotImplemented: + return _result + return xla_sort_eager_fallback( + input, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_sort, (), dict(input=input, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_sort( + (input, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaSort", input=input, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_sort, (), dict(input=input, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("T", _op._get_attr_type("T")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaSort", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +XlaSort = tf_export("raw_ops.XlaSort")(_ops.to_raw_op(xla_sort)) +_dispatcher_for_xla_sort = xla_sort._tf_type_based_dispatcher.Dispatch + + +def xla_sort_eager_fallback(input: Annotated[Any, TV_XlaSort_T], name, ctx) -> Annotated[Any, TV_XlaSort_T]: + _attr_T, (input,) = _execute.args_to_matching_eager([input], ctx, []) + _inputs_flat = [input] + _attrs = ("T", _attr_T) + _result = _execute.execute(b"XlaSort", 1, inputs=_inputs_flat, attrs=_attrs, + ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaSort", _inputs_flat, _attrs, _result) + _result, = _result + return _result + + +TV_XlaSpmdFullToShardShape_T = TypeVar("TV_XlaSpmdFullToShardShape_T", _atypes.BFloat16, _atypes.Bool, _atypes.Complex128, _atypes.Complex64, _atypes.Float16, _atypes.Float32, _atypes.Float64, _atypes.Float8e4m3fn, _atypes.Float8e5m2, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int4, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.Resource, _atypes.String, _atypes.UInt16, _atypes.UInt32, _atypes.UInt4, _atypes.UInt64, _atypes.UInt8, _atypes.Variant) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_spmd_full_to_shard_shape') +def xla_spmd_full_to_shard_shape(input: Annotated[Any, TV_XlaSpmdFullToShardShape_T], manual_sharding: str, dim:int=-1, unspecified_dims=[], name=None) -> Annotated[Any, TV_XlaSpmdFullToShardShape_T]: + r"""An op used by XLA SPMD partitioner to switch from automatic partitioning to + + manual partitioning. It annotates the input (full-shape, to be automatically + partitioned) with the same sharding used by manual partitioning, and outputs a + shard-shaped tensor to be consumed by later manually-partitioned ops. If the + shape is not evenly partitionable, the padding region will be masked with 0s. + The conversion can happen partially in subgroups, by specifying the dim + attribute, where only that dim will be converted. + + Args: + input: A `Tensor`. + manual_sharding: A `string`. + dim: An optional `int`. Defaults to `-1`. + unspecified_dims: An optional list of `ints`. Defaults to `[]`. + name: A name for the operation (optional). + + Returns: + A `Tensor`. Has the same type as `input`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaSpmdFullToShardShape", name, input, "manual_sharding", + manual_sharding, "dim", dim, "unspecified_dims", unspecified_dims) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_spmd_full_to_shard_shape( + (input, manual_sharding, dim, unspecified_dims, name,), None) + if _result is not NotImplemented: + return _result + return xla_spmd_full_to_shard_shape_eager_fallback( + input, manual_sharding=manual_sharding, dim=dim, + unspecified_dims=unspecified_dims, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_spmd_full_to_shard_shape, (), dict(input=input, + manual_sharding=manual_sharding, + dim=dim, + unspecified_dims=unspecified_dims, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_spmd_full_to_shard_shape( + (input, manual_sharding, dim, unspecified_dims, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + manual_sharding = _execute.make_str(manual_sharding, "manual_sharding") + if dim is None: + dim = -1 + dim = _execute.make_int(dim, "dim") + if unspecified_dims is None: + unspecified_dims = [] + if not isinstance(unspecified_dims, (list, tuple)): + raise TypeError( + "Expected list for 'unspecified_dims' argument to " + "'xla_spmd_full_to_shard_shape' Op, not %r." % unspecified_dims) + unspecified_dims = [_execute.make_int(_i, "unspecified_dims") for _i in unspecified_dims] + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaSpmdFullToShardShape", input=input, + manual_sharding=manual_sharding, dim=dim, + unspecified_dims=unspecified_dims, + name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_spmd_full_to_shard_shape, (), dict(input=input, + manual_sharding=manual_sharding, + dim=dim, + unspecified_dims=unspecified_dims, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("T", _op._get_attr_type("T"), "manual_sharding", + _op.get_attr("manual_sharding"), "dim", + _op._get_attr_int("dim"), "unspecified_dims", + _op.get_attr("unspecified_dims")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaSpmdFullToShardShape", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +XlaSpmdFullToShardShape = tf_export("raw_ops.XlaSpmdFullToShardShape")(_ops.to_raw_op(xla_spmd_full_to_shard_shape)) +_dispatcher_for_xla_spmd_full_to_shard_shape = xla_spmd_full_to_shard_shape._tf_type_based_dispatcher.Dispatch + + +def xla_spmd_full_to_shard_shape_eager_fallback(input: Annotated[Any, TV_XlaSpmdFullToShardShape_T], manual_sharding: str, dim: int, unspecified_dims, name, ctx) -> Annotated[Any, TV_XlaSpmdFullToShardShape_T]: + manual_sharding = _execute.make_str(manual_sharding, "manual_sharding") + if dim is None: + dim = -1 + dim = _execute.make_int(dim, "dim") + if unspecified_dims is None: + unspecified_dims = [] + if not isinstance(unspecified_dims, (list, tuple)): + raise TypeError( + "Expected list for 'unspecified_dims' argument to " + "'xla_spmd_full_to_shard_shape' Op, not %r." % unspecified_dims) + unspecified_dims = [_execute.make_int(_i, "unspecified_dims") for _i in unspecified_dims] + _attr_T, (input,) = _execute.args_to_matching_eager([input], ctx, []) + _inputs_flat = [input] + _attrs = ("T", _attr_T, "manual_sharding", manual_sharding, "dim", dim, + "unspecified_dims", unspecified_dims) + _result = _execute.execute(b"XlaSpmdFullToShardShape", 1, + inputs=_inputs_flat, attrs=_attrs, ctx=ctx, + name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaSpmdFullToShardShape", _inputs_flat, _attrs, _result) + _result, = _result + return _result + + +TV_XlaSpmdShardToFullShape_T = TypeVar("TV_XlaSpmdShardToFullShape_T", _atypes.BFloat16, _atypes.Bool, _atypes.Complex128, _atypes.Complex64, _atypes.Float16, _atypes.Float32, _atypes.Float64, _atypes.Float8e4m3fn, _atypes.Float8e5m2, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int4, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.Resource, _atypes.String, _atypes.UInt16, _atypes.UInt32, _atypes.UInt4, _atypes.UInt64, _atypes.UInt8, _atypes.Variant) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_spmd_shard_to_full_shape') +def xla_spmd_shard_to_full_shape(input: Annotated[Any, TV_XlaSpmdShardToFullShape_T], manual_sharding: str, full_shape, dim:int=-1, unspecified_dims=[], name=None) -> Annotated[Any, TV_XlaSpmdShardToFullShape_T]: + r"""An op used by XLA SPMD partitioner to switch from manual partitioning to + + automatic partitioning. It converts the shard-shaped, manually partitioned input + into full-shaped tensor to be partitioned automatically with the same sharding + used by manual partitioning. The conversion can happen partially in subgroups, + by specifying the dim attribute, where only that dim will be converted. + + Args: + input: A `Tensor`. + manual_sharding: A `string`. + full_shape: A `tf.TensorShape` or list of `ints`. + dim: An optional `int`. Defaults to `-1`. + unspecified_dims: An optional list of `ints`. Defaults to `[]`. + name: A name for the operation (optional). + + Returns: + A `Tensor`. Has the same type as `input`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaSpmdShardToFullShape", name, input, "manual_sharding", + manual_sharding, "full_shape", full_shape, "dim", dim, + "unspecified_dims", unspecified_dims) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_spmd_shard_to_full_shape( + (input, manual_sharding, full_shape, dim, unspecified_dims, name,), + None) + if _result is not NotImplemented: + return _result + return xla_spmd_shard_to_full_shape_eager_fallback( + input, manual_sharding=manual_sharding, full_shape=full_shape, + dim=dim, unspecified_dims=unspecified_dims, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_spmd_shard_to_full_shape, (), dict(input=input, + manual_sharding=manual_sharding, + full_shape=full_shape, + dim=dim, + unspecified_dims=unspecified_dims, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_spmd_shard_to_full_shape( + (input, manual_sharding, full_shape, dim, unspecified_dims, name,), + None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + manual_sharding = _execute.make_str(manual_sharding, "manual_sharding") + full_shape = _execute.make_shape(full_shape, "full_shape") + if dim is None: + dim = -1 + dim = _execute.make_int(dim, "dim") + if unspecified_dims is None: + unspecified_dims = [] + if not isinstance(unspecified_dims, (list, tuple)): + raise TypeError( + "Expected list for 'unspecified_dims' argument to " + "'xla_spmd_shard_to_full_shape' Op, not %r." % unspecified_dims) + unspecified_dims = [_execute.make_int(_i, "unspecified_dims") for _i in unspecified_dims] + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaSpmdShardToFullShape", input=input, + manual_sharding=manual_sharding, + full_shape=full_shape, dim=dim, + unspecified_dims=unspecified_dims, + name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_spmd_shard_to_full_shape, (), dict(input=input, + manual_sharding=manual_sharding, + full_shape=full_shape, + dim=dim, + unspecified_dims=unspecified_dims, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("T", _op._get_attr_type("T"), "manual_sharding", + _op.get_attr("manual_sharding"), "full_shape", + _op.get_attr("full_shape"), "dim", _op._get_attr_int("dim"), + "unspecified_dims", _op.get_attr("unspecified_dims")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaSpmdShardToFullShape", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +XlaSpmdShardToFullShape = tf_export("raw_ops.XlaSpmdShardToFullShape")(_ops.to_raw_op(xla_spmd_shard_to_full_shape)) +_dispatcher_for_xla_spmd_shard_to_full_shape = xla_spmd_shard_to_full_shape._tf_type_based_dispatcher.Dispatch + + +def xla_spmd_shard_to_full_shape_eager_fallback(input: Annotated[Any, TV_XlaSpmdShardToFullShape_T], manual_sharding: str, full_shape, dim: int, unspecified_dims, name, ctx) -> Annotated[Any, TV_XlaSpmdShardToFullShape_T]: + manual_sharding = _execute.make_str(manual_sharding, "manual_sharding") + full_shape = _execute.make_shape(full_shape, "full_shape") + if dim is None: + dim = -1 + dim = _execute.make_int(dim, "dim") + if unspecified_dims is None: + unspecified_dims = [] + if not isinstance(unspecified_dims, (list, tuple)): + raise TypeError( + "Expected list for 'unspecified_dims' argument to " + "'xla_spmd_shard_to_full_shape' Op, not %r." % unspecified_dims) + unspecified_dims = [_execute.make_int(_i, "unspecified_dims") for _i in unspecified_dims] + _attr_T, (input,) = _execute.args_to_matching_eager([input], ctx, []) + _inputs_flat = [input] + _attrs = ("T", _attr_T, "manual_sharding", manual_sharding, "full_shape", + full_shape, "dim", dim, "unspecified_dims", unspecified_dims) + _result = _execute.execute(b"XlaSpmdShardToFullShape", 1, + inputs=_inputs_flat, attrs=_attrs, ctx=ctx, + name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaSpmdShardToFullShape", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +_XlaSvdOutput = collections.namedtuple( + "XlaSvd", + ["s", "u", "v"]) + + +TV_XlaSvd_T = TypeVar("TV_XlaSvd_T", _atypes.BFloat16, _atypes.Complex128, _atypes.Complex64, _atypes.Float32, _atypes.Float64, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.UInt16, _atypes.UInt32, _atypes.UInt64, _atypes.UInt8) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_svd') +def xla_svd(a: Annotated[Any, TV_XlaSvd_T], max_iter: int, epsilon: float, precision_config: str, name=None): + r"""Computes the eigen decomposition of a batch of self-adjoint matrices + + (Note: Only real inputs are supported). + + Computes the eigenvalues and eigenvectors of the innermost M-by-N matrices in + tensor such that tensor[...,:,:] = u[..., :, :] * Diag(s[..., :]) * Transpose(v[...,:,:]). + + Args: + a: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `complex64`, `int64`, `qint8`, `quint8`, `qint32`, `bfloat16`, `qint16`, `quint16`, `uint16`, `complex128`, `half`, `uint32`, `uint64`. + the input tensor. + max_iter: An `int`. + maximum number of sweep update, i.e., the whole lower triangular + part or upper triangular part based on parameter lower. Heuristically, it has + been argued that approximately log(min (M, N)) sweeps are needed in practice + (Ref: Golub & van Loan "Matrix Computation"). + epsilon: A `float`. the tolerance ratio. + precision_config: A `string`. a serialized xla::PrecisionConfig proto. + name: A name for the operation (optional). + + Returns: + A tuple of `Tensor` objects (s, u, v). + + s: A `Tensor`. Has the same type as `a`. Singular values. The values are sorted in reverse order of magnitude, so + s[..., 0] is the largest value, s[..., 1] is the second largest, etc. + u: A `Tensor`. Has the same type as `a`. Left singular vectors. + v: A `Tensor`. Has the same type as `a`. Right singular vectors. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaSvd", name, a, "max_iter", max_iter, "epsilon", epsilon, + "precision_config", precision_config) + _result = _XlaSvdOutput._make(_result) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_svd( + (a, max_iter, epsilon, precision_config, name,), None) + if _result is not NotImplemented: + return _result + return xla_svd_eager_fallback( + a, max_iter=max_iter, epsilon=epsilon, + precision_config=precision_config, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_svd, (), dict(a=a, max_iter=max_iter, epsilon=epsilon, + precision_config=precision_config, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_svd( + (a, max_iter, epsilon, precision_config, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + max_iter = _execute.make_int(max_iter, "max_iter") + epsilon = _execute.make_float(epsilon, "epsilon") + precision_config = _execute.make_str(precision_config, "precision_config") + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaSvd", a=a, max_iter=max_iter, epsilon=epsilon, + precision_config=precision_config, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_svd, (), dict(a=a, max_iter=max_iter, epsilon=epsilon, + precision_config=precision_config, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("max_iter", _op._get_attr_int("max_iter"), "epsilon", + _op.get_attr("epsilon"), "precision_config", + _op.get_attr("precision_config"), "T", _op._get_attr_type("T")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaSvd", _inputs_flat, _attrs, _result) + _result = _XlaSvdOutput._make(_result) + return _result + +XlaSvd = tf_export("raw_ops.XlaSvd")(_ops.to_raw_op(xla_svd)) +_dispatcher_for_xla_svd = xla_svd._tf_type_based_dispatcher.Dispatch + + +def xla_svd_eager_fallback(a: Annotated[Any, TV_XlaSvd_T], max_iter: int, epsilon: float, precision_config: str, name, ctx): + max_iter = _execute.make_int(max_iter, "max_iter") + epsilon = _execute.make_float(epsilon, "epsilon") + precision_config = _execute.make_str(precision_config, "precision_config") + _attr_T, (a,) = _execute.args_to_matching_eager([a], ctx, [_dtypes.float32, _dtypes.float64, _dtypes.int32, _dtypes.uint8, _dtypes.int16, _dtypes.int8, _dtypes.complex64, _dtypes.int64, _dtypes.qint8, _dtypes.quint8, _dtypes.qint32, _dtypes.bfloat16, _dtypes.qint16, _dtypes.quint16, _dtypes.uint16, _dtypes.complex128, _dtypes.half, _dtypes.uint32, _dtypes.uint64, ]) + _inputs_flat = [a] + _attrs = ("max_iter", max_iter, "epsilon", epsilon, "precision_config", + precision_config, "T", _attr_T) + _result = _execute.execute(b"XlaSvd", 3, inputs=_inputs_flat, attrs=_attrs, + ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaSvd", _inputs_flat, _attrs, _result) + _result = _XlaSvdOutput._make(_result) + return _result + + +TV_XlaVariadicReduce_T = TypeVar("TV_XlaVariadicReduce_T", _atypes.BFloat16, _atypes.Bool, _atypes.Complex128, _atypes.Complex64, _atypes.Float32, _atypes.Float64, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.UInt16, _atypes.UInt32, _atypes.UInt64, _atypes.UInt8) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_variadic_reduce') +def xla_variadic_reduce(input: Annotated[List[Any], TV_XlaVariadicReduce_T], init_value: Annotated[List[Any], TV_XlaVariadicReduce_T], dimensions_to_reduce, reducer, name=None): + r"""Wraps the variadic XLA Reduce operator. + + Semantics are documented at + https://www.tensorflow.org/performance/xla/operation_semantics#variadic_reduce. + + This version is limited to operands of the same dtype. + XlaVariadicReduceV2 is a version that supports heterogeneous operands. + + Args: + input: A list of at least 1 `Tensor` objects with the same type in: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `complex64`, `int64`, `qint8`, `quint8`, `qint32`, `bfloat16`, `qint16`, `quint16`, `uint16`, `complex128`, `half`, `uint32`, `uint64`, `bool`. + the input tensor(s) + init_value: A list with the same length as `input` of `Tensor` objects with the same type as `input`. + scalar initial value(s) for the reduction + dimensions_to_reduce: A list of `ints`. + dimension numbers over which to reduce + reducer: A function decorated with @Defun. a reducer function to apply + name: A name for the operation (optional). + + Returns: + A list with the same length as `input` of `Tensor` objects with the same type as `input`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaVariadicReduce", name, input, init_value, + "dimensions_to_reduce", dimensions_to_reduce, "reducer", reducer) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_variadic_reduce( + (input, init_value, dimensions_to_reduce, reducer, name,), None) + if _result is not NotImplemented: + return _result + return xla_variadic_reduce_eager_fallback( + input, init_value, dimensions_to_reduce=dimensions_to_reduce, + reducer=reducer, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_variadic_reduce, (), dict(input=input, init_value=init_value, + dimensions_to_reduce=dimensions_to_reduce, + reducer=reducer, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_variadic_reduce( + (input, init_value, dimensions_to_reduce, reducer, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + if not isinstance(input, (list, tuple)): + raise TypeError( + "Expected list for 'input' argument to " + "'xla_variadic_reduce' Op, not %r." % input) + _attr_N = len(input) + if not isinstance(init_value, (list, tuple)): + raise TypeError( + "Expected list for 'init_value' argument to " + "'xla_variadic_reduce' Op, not %r." % init_value) + if len(init_value) != _attr_N: + raise ValueError( + "List argument 'init_value' to 'xla_variadic_reduce' Op with length %d " + "must match length %d of argument 'input'." % + (len(init_value), _attr_N)) + if not isinstance(dimensions_to_reduce, (list, tuple)): + raise TypeError( + "Expected list for 'dimensions_to_reduce' argument to " + "'xla_variadic_reduce' Op, not %r." % dimensions_to_reduce) + dimensions_to_reduce = [_execute.make_int(_i, "dimensions_to_reduce") for _i in dimensions_to_reduce] + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaVariadicReduce", input=input, init_value=init_value, + dimensions_to_reduce=dimensions_to_reduce, + reducer=reducer, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_variadic_reduce, (), dict(input=input, init_value=init_value, + dimensions_to_reduce=dimensions_to_reduce, + reducer=reducer, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("N", _op._get_attr_int("N"), "T", _op._get_attr_type("T"), + "dimensions_to_reduce", _op.get_attr("dimensions_to_reduce"), + "reducer", _op.get_attr("reducer")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaVariadicReduce", _inputs_flat, _attrs, _result) + return _result + +XlaVariadicReduce = tf_export("raw_ops.XlaVariadicReduce")(_ops.to_raw_op(xla_variadic_reduce)) +_dispatcher_for_xla_variadic_reduce = xla_variadic_reduce._tf_type_based_dispatcher.Dispatch + + +def xla_variadic_reduce_eager_fallback(input: Annotated[List[Any], TV_XlaVariadicReduce_T], init_value: Annotated[List[Any], TV_XlaVariadicReduce_T], dimensions_to_reduce, reducer, name, ctx): + if not isinstance(input, (list, tuple)): + raise TypeError( + "Expected list for 'input' argument to " + "'xla_variadic_reduce' Op, not %r." % input) + _attr_N = len(input) + if not isinstance(init_value, (list, tuple)): + raise TypeError( + "Expected list for 'init_value' argument to " + "'xla_variadic_reduce' Op, not %r." % init_value) + if len(init_value) != _attr_N: + raise ValueError( + "List argument 'init_value' to 'xla_variadic_reduce' Op with length %d " + "must match length %d of argument 'input'." % + (len(init_value), _attr_N)) + if not isinstance(dimensions_to_reduce, (list, tuple)): + raise TypeError( + "Expected list for 'dimensions_to_reduce' argument to " + "'xla_variadic_reduce' Op, not %r." % dimensions_to_reduce) + dimensions_to_reduce = [_execute.make_int(_i, "dimensions_to_reduce") for _i in dimensions_to_reduce] + _attr_T, _inputs_T = _execute.args_to_matching_eager(list(input) + list(init_value), ctx, [_dtypes.float32, _dtypes.float64, _dtypes.int32, _dtypes.uint8, _dtypes.int16, _dtypes.int8, _dtypes.complex64, _dtypes.int64, _dtypes.qint8, _dtypes.quint8, _dtypes.qint32, _dtypes.bfloat16, _dtypes.qint16, _dtypes.quint16, _dtypes.uint16, _dtypes.complex128, _dtypes.half, _dtypes.uint32, _dtypes.uint64, _dtypes.bool, ]) + _inputs_T = [_inputs_T[:_attr_N]] + _inputs_T[_attr_N:] + _inputs_T = _inputs_T[:1] + [_inputs_T[1:]] + (input, init_value) = _inputs_T + _inputs_flat = list(input) + list(init_value) + _attrs = ("N", _attr_N, "T", _attr_T, "dimensions_to_reduce", + dimensions_to_reduce, "reducer", reducer) + _result = _execute.execute(b"XlaVariadicReduce", _attr_N, + inputs=_inputs_flat, attrs=_attrs, ctx=ctx, + name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaVariadicReduce", _inputs_flat, _attrs, _result) + return _result + + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_variadic_reduce_v2') +def xla_variadic_reduce_v2(inputs, init_values, dimensions_to_reduce, reducer, name=None): + r"""Wraps the variadic XLA Reduce operator. + + Semantics are documented at + https://www.tensorflow.org/performance/xla/operation_semantics#variadic_reduce. + + This is an expanded version of XlaVariadicReduce, with support for + operands of different dtypes, and improved shape inference. + + Args: + inputs: A list of `Tensor` objects. the input tensor(s) + init_values: A list of `Tensor` objects. Must have the same type as `inputs`. + scalar initial value(s) for the reduction + dimensions_to_reduce: A list of `ints`. + dimension numbers over which to reduce + reducer: A function decorated with @Defun. a reducer function to apply + name: A name for the operation (optional). + + Returns: + A list of `Tensor` objects. Has the same type as `inputs`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaVariadicReduceV2", name, inputs, init_values, + "dimensions_to_reduce", dimensions_to_reduce, "reducer", reducer) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_variadic_reduce_v2( + (inputs, init_values, dimensions_to_reduce, reducer, name,), None) + if _result is not NotImplemented: + return _result + return xla_variadic_reduce_v2_eager_fallback( + inputs, init_values, dimensions_to_reduce=dimensions_to_reduce, + reducer=reducer, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_variadic_reduce_v2, (), dict(inputs=inputs, + init_values=init_values, + dimensions_to_reduce=dimensions_to_reduce, + reducer=reducer, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_variadic_reduce_v2( + (inputs, init_values, dimensions_to_reduce, reducer, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + if not isinstance(dimensions_to_reduce, (list, tuple)): + raise TypeError( + "Expected list for 'dimensions_to_reduce' argument to " + "'xla_variadic_reduce_v2' Op, not %r." % dimensions_to_reduce) + dimensions_to_reduce = [_execute.make_int(_i, "dimensions_to_reduce") for _i in dimensions_to_reduce] + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaVariadicReduceV2", inputs=inputs, init_values=init_values, + dimensions_to_reduce=dimensions_to_reduce, + reducer=reducer, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_variadic_reduce_v2, (), dict(inputs=inputs, + init_values=init_values, + dimensions_to_reduce=dimensions_to_reduce, + reducer=reducer, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("T", _op.get_attr("T"), "dimensions_to_reduce", + _op.get_attr("dimensions_to_reduce"), "reducer", + _op.get_attr("reducer")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaVariadicReduceV2", _inputs_flat, _attrs, _result) + return _result + +XlaVariadicReduceV2 = tf_export("raw_ops.XlaVariadicReduceV2")(_ops.to_raw_op(xla_variadic_reduce_v2)) +_dispatcher_for_xla_variadic_reduce_v2 = xla_variadic_reduce_v2._tf_type_based_dispatcher.Dispatch + + +def xla_variadic_reduce_v2_eager_fallback(inputs, init_values, dimensions_to_reduce, reducer, name, ctx): + if not isinstance(dimensions_to_reduce, (list, tuple)): + raise TypeError( + "Expected list for 'dimensions_to_reduce' argument to " + "'xla_variadic_reduce_v2' Op, not %r." % dimensions_to_reduce) + dimensions_to_reduce = [_execute.make_int(_i, "dimensions_to_reduce") for _i in dimensions_to_reduce] + _attr_T, (inputs, init_values) = _execute.args_to_mixed_eager_tensors((inputs, init_values), ctx) + _inputs_flat = list(inputs) + list(init_values) + _attrs = ("T", _attr_T, "dimensions_to_reduce", dimensions_to_reduce, + "reducer", reducer) + _result = _execute.execute(b"XlaVariadicReduceV2", len(inputs), + inputs=_inputs_flat, attrs=_attrs, ctx=ctx, + name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaVariadicReduceV2", _inputs_flat, _attrs, _result) + return _result + + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_variadic_sort') +def xla_variadic_sort(inputs, dimension: Annotated[Any, _atypes.Int32], comparator, is_stable: bool, name=None): + r"""Wraps the XLA Sort operator, documented at + + https://www.tensorflow.org/performance/xla/operation_semantics#sort + . + + Sorts one or more tensors, with support for custom comparator, dimension, and + is_stable attributes. + + Args: + inputs: A list of `Tensor` objects. + A list of `Tensor` of identical shape but possibly different types. + dimension: A `Tensor` of type `int32`. + The dimension along which to sort. Must be a compile-time constant. + comparator: A function decorated with @Defun. + A comparator function to apply to 2*N scalars and returning a + boolean. N is the number of sort inputs. If you want to sort in ascending + order then the comparator should perform a less-than comparison. + is_stable: A `bool`. Whether to use stable sort. + name: A name for the operation (optional). + + Returns: + A list of `Tensor` objects. Has the same type as `inputs`. + A list of `Tensor` of same shape and types as the `input`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaVariadicSort", name, inputs, dimension, "comparator", + comparator, "is_stable", is_stable) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_variadic_sort( + (inputs, dimension, comparator, is_stable, name,), None) + if _result is not NotImplemented: + return _result + return xla_variadic_sort_eager_fallback( + inputs, dimension, comparator=comparator, is_stable=is_stable, + name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_variadic_sort, (), dict(inputs=inputs, dimension=dimension, + comparator=comparator, + is_stable=is_stable, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_variadic_sort( + (inputs, dimension, comparator, is_stable, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + is_stable = _execute.make_bool(is_stable, "is_stable") + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaVariadicSort", inputs=inputs, dimension=dimension, + comparator=comparator, is_stable=is_stable, + name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_variadic_sort, (), dict(inputs=inputs, dimension=dimension, + comparator=comparator, + is_stable=is_stable, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("T", _op.get_attr("T"), "comparator", + _op.get_attr("comparator"), "is_stable", + _op._get_attr_bool("is_stable")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaVariadicSort", _inputs_flat, _attrs, _result) + return _result + +XlaVariadicSort = tf_export("raw_ops.XlaVariadicSort")(_ops.to_raw_op(xla_variadic_sort)) +_dispatcher_for_xla_variadic_sort = xla_variadic_sort._tf_type_based_dispatcher.Dispatch + + +def xla_variadic_sort_eager_fallback(inputs, dimension: Annotated[Any, _atypes.Int32], comparator, is_stable: bool, name, ctx): + is_stable = _execute.make_bool(is_stable, "is_stable") + _attr_T, inputs = _execute.convert_to_mixed_eager_tensors(inputs, ctx) + dimension = _ops.convert_to_tensor(dimension, _dtypes.int32) + _inputs_flat = list(inputs) + [dimension] + _attrs = ("T", _attr_T, "comparator", comparator, "is_stable", is_stable) + _result = _execute.execute(b"XlaVariadicSort", len(inputs), + inputs=_inputs_flat, attrs=_attrs, ctx=ctx, + name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaVariadicSort", _inputs_flat, _attrs, _result) + return _result + + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('xla_while') +def xla_while(input, cond, body, name=None): + r"""output = input; While (Cond(output)) { output = Body(output) } + + Args: + input: A list of `Tensor` objects. + A list of input tensors whose types are T. + cond: A function decorated with @Defun. + A function takes 'input' and returns a tensor. If the tensor is + a scalar of non-boolean, the scalar is converted to a boolean + according to the following rule: if the scalar is a numerical + value, non-zero means True and zero means False; if the scalar is + a string, non-empty means True and empty means False. If the + tensor is not a scalar, non-emptiness means True and False + otherwise. + body: A function decorated with @Defun. + A function that takes a list of tensors and returns another + list of tensors. Both lists have the same types as specified by T. + name: A name for the operation (optional). + + Returns: + A list of `Tensor` objects. Has the same type as `input`. + A list of output tensors whose types are T. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "XlaWhile", name, input, "cond", cond, "body", body) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_xla_while( + (input, cond, body, name,), None) + if _result is not NotImplemented: + return _result + return xla_while_eager_fallback( + input, cond=cond, body=body, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_while, (), dict(input=input, cond=cond, body=body, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_xla_while( + (input, cond, body, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "XlaWhile", input=input, cond=cond, body=body, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + xla_while, (), dict(input=input, cond=cond, body=body, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if not _result: + return _op + if _execute.must_record_gradient(): + _attrs = ("T", _op.get_attr("T"), "cond", _op.get_attr("cond"), "body", + _op.get_attr("body")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "XlaWhile", _inputs_flat, _attrs, _result) + return _result + +XlaWhile = tf_export("raw_ops.XlaWhile")(_ops.to_raw_op(xla_while)) +_dispatcher_for_xla_while = xla_while._tf_type_based_dispatcher.Dispatch + + +def xla_while_eager_fallback(input, cond, body, name, ctx): + _attr_T, input = _execute.convert_to_mixed_eager_tensors(input, ctx) + _inputs_flat = list(input) + _attrs = ("T", _attr_T, "cond", cond, "body", body) + _result = _execute.execute(b"XlaWhile", len(input), inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "XlaWhile", _inputs_flat, _attrs, _result) + return _result + diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/python/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/python/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/python/xla.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/python/xla.py new file mode 100644 index 0000000000000000000000000000000000000000..792c5143fafd043f2e90b35c00035cf78dfbbded --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/python/xla.py @@ -0,0 +1,726 @@ +# 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. +# ============================================================================== +"""Experimental library that exposes XLA operations directly in TensorFlow. + +It is sometimes useful to be able to build HLO programs directly from +TensorFlow. This file provides Tensorflow operators that mirror the semantics of +HLO operators as closely as possible. + +Note: Most of the operators defined in this module are used by the jax2tf +converter (see go/jax2tf for details) and are used in SavedModel produced +by jax2tf. Hence, we need to maintain backwards compatibility for these +operators. Please reach out to the JAX team if you want to make changes. +""" + +from tensorflow.compiler.tf2xla.ops import gen_xla_ops +from tensorflow.compiler.xla import xla_data_pb2 +from tensorflow.core.framework import attr_value_pb2 +from tensorflow.python.framework import constant_op +from tensorflow.python.framework import dtypes +from tensorflow.python.framework import ops +from tensorflow.python.ops import array_ops +from tensorflow.python.ops import bitwise_ops +from tensorflow.python.ops import gen_math_ops +from tensorflow.python.ops import gen_random_ops +from tensorflow.python.ops import math_ops +from tensorflow.python.ops import random_ops +from tensorflow.python.ops import random_ops_util +from tensorflow.python.ops import special_math_ops +from tensorflow.python.ops.numpy_ops import np_utils + +# TODO(phawkins): provide wrappers for all XLA operators. Currently the missing +# ops include: +# infeed/outfeed (available via tf.contrib.tpu) +# collectives, e.g., cross-replica-sum (available via tf.contrib.tpu) +# conditional +# gather/scatter +# collapse + +# This file reuses builtin names (following XLA's names, so we can call things +# like xla.max), so we capture the builtin versions here. +# pylint: disable=redefined-builtin +_max = max +_min = min +_slice = slice # pylint: disable=invalid-name + +constant = constant_op.constant + +# Unary operators. + +# For most arithmetic operators there is a TensorFlow operator +# that exactly corresponds to each XLA operator. Rather than defining +# XLA-specific variants, we reuse the corresponding TensorFlow operator. +# TODO(phawkins): It would be even better to have TensorFlow operators that 1:1 +# wrap every HLO operator, because that would allow us to be confident that the +# semantics match. + + +def _unary_op(fn): + """Wrapper that restricts `fn` to have the correct signature.""" + + def unary_op_wrapper(x, name=None): + return fn(x, name=name) + + return unary_op_wrapper + + +abs = _unary_op(math_ops.abs) +# TODO(phawkins): implement clz. +conj = _unary_op(math_ops.conj) +cos = _unary_op(math_ops.cos) +ceil = _unary_op(math_ops.ceil) +digamma = _unary_op(math_ops.digamma) +erf = _unary_op(math_ops.erf) +erfc = _unary_op(math_ops.erfc) +erfinv = _unary_op(math_ops.erfinv) +ndtri = _unary_op(math_ops.ndtri) +exp = _unary_op(math_ops.exp) +expm1 = _unary_op(math_ops.expm1) +floor = _unary_op(math_ops.floor) +imag = _unary_op(math_ops.imag) +is_finite = _unary_op(math_ops.is_finite) +lgamma = _unary_op(math_ops.lgamma) +log = _unary_op(math_ops.log) +log1p = _unary_op(math_ops.log1p) +logical_not = _unary_op(math_ops.logical_not) +neg = _unary_op(math_ops.neg) +real = _unary_op(math_ops.real) +# TODO(phawkins): unlike xla::Round, this rounds to even instead of zero for +# numbers halfway between two integers. +round = _unary_op(math_ops.round) +sin = _unary_op(math_ops.sin) +sign = _unary_op(math_ops.sign) +tan = _unary_op(math_ops.tan) +tanh = _unary_op(math_ops.tanh) + +# Bessel +bessel_i0e = _unary_op(special_math_ops.bessel_i0e) +bessel_i1e = _unary_op(special_math_ops.bessel_i1e) + +# Binary operators + +# The main difference between TensorFlow and XLA binary ops is the broadcasting +# semantics. TensorFlow uses Numpy-style broadcasting semantics, whereas XLA +# requires an explicit specification of which dimensions to broadcast if the +# arguments have different ranks. + + +def _broadcasting_binary_op(fn): + """Wraps a binary Tensorflow operator and performs XLA-style broadcasting.""" + + def broadcasting_binary_op_wrapper(x, y, broadcast_dims=None, name=None): + """Inner wrapper function.""" + broadcast_dims = broadcast_dims or [] + broadcast_dims = ops.convert_to_tensor(broadcast_dims, dtypes.int64) + # Rather than relying on having static shape information in the TensorFlow + # graph, we use an XlaBroadcastHelper op that can compute the correct shapes + # at JIT compilation time. + x, y = gen_xla_ops.xla_broadcast_helper(x, y, broadcast_dims) + return fn(x, y, name=name) + + return broadcasting_binary_op_wrapper + + +# Map from TF signed types to TF unsigned types. +_SIGNED_TO_UNSIGNED_TABLE = { + dtypes.int8: dtypes.uint8, + dtypes.int16: dtypes.uint16, + dtypes.int32: dtypes.uint32, + dtypes.int64: dtypes.uint64, +} + +# Map from TF unsigned types to TF signed types. +_UNSIGNED_TO_SIGNED_TABLE = { + dtypes.uint8: dtypes.int8, + dtypes.uint16: dtypes.int16, + dtypes.uint32: dtypes.int32, + dtypes.uint64: dtypes.int64, +} + + +def _shift_right_logical_helper(x, y, name=None): + """Performs an integer right logical shift irrespective of input type.""" + assert y.dtype == x.dtype + dtype = x.dtype + signed = dtype in _SIGNED_TO_UNSIGNED_TABLE + if signed: + unsigned_dtype = _SIGNED_TO_UNSIGNED_TABLE[dtype] + x = math_ops.cast(x, unsigned_dtype) + y = math_ops.cast(y, unsigned_dtype) + output = bitwise_ops.right_shift(x, y, name=name) + if signed: + output = math_ops.cast(output, dtype) + return output + + +def _shift_right_arithmetic_helper(x, y, name=None): + """Performs an integer right arithmetic shift irrespective of input type.""" + assert y.dtype == x.dtype + dtype = x.dtype + unsigned = dtype in _UNSIGNED_TO_SIGNED_TABLE + if unsigned: + signed_dtype = _UNSIGNED_TO_SIGNED_TABLE[dtype] + x = math_ops.cast(x, signed_dtype) + y = math_ops.cast(y, signed_dtype) + output = bitwise_ops.right_shift(x, y, name=name) + if unsigned: + output = math_ops.cast(output, dtype) + return output + + +add = _broadcasting_binary_op(math_ops.add) +sub = _broadcasting_binary_op(math_ops.sub) +mul = _broadcasting_binary_op(math_ops.mul) +div = _broadcasting_binary_op(math_ops.div) +rem = _broadcasting_binary_op(gen_math_ops.mod) +max = _broadcasting_binary_op(math_ops.maximum) +min = _broadcasting_binary_op(math_ops.minimum) +atan2 = _broadcasting_binary_op(math_ops.atan2) +complex = _broadcasting_binary_op(math_ops.complex) +logical_and = _broadcasting_binary_op(math_ops.logical_and) +logical_or = _broadcasting_binary_op(math_ops.logical_or) +logical_xor = _broadcasting_binary_op(math_ops.logical_xor) +eq = _broadcasting_binary_op(math_ops.equal) +ne = _broadcasting_binary_op(math_ops.not_equal) +ge = _broadcasting_binary_op(math_ops.greater_equal) +gt = _broadcasting_binary_op(math_ops.greater) +le = _broadcasting_binary_op(math_ops.less_equal) +lt = _broadcasting_binary_op(math_ops.less) +pow = _broadcasting_binary_op(math_ops.pow) +shift_left = _broadcasting_binary_op(bitwise_ops.left_shift) +shift_right_logical = _broadcasting_binary_op(_shift_right_logical_helper) +shift_right_arithmetic = _broadcasting_binary_op(_shift_right_arithmetic_helper) + +igamma = _broadcasting_binary_op(math_ops.igamma) +igamma_grad_a = _broadcasting_binary_op(gen_math_ops.igamma_grad_a) +random_gamma_grad = _broadcasting_binary_op(gen_random_ops.random_gamma_grad) +igammac = _broadcasting_binary_op(math_ops.igammac) +polygamma = _broadcasting_binary_op(math_ops.polygamma) +zeta = _broadcasting_binary_op(math_ops.zeta) + + +def _binary_op(fn): + """Wrapper that restricts `fn` to have the correct signature.""" + + def binary_op_wrapper(x, y, name=None): + return fn(x, y, name=name) + + return binary_op_wrapper + + +transpose = _binary_op(array_ops.transpose) +rev = _binary_op(array_ops.reverse) + +bitcast_convert_type = array_ops.bitcast + + +def broadcast(x, dims, name=None): + x = ops.convert_to_tensor(x) + shape = array_ops.concat( + [constant_op.constant(dims), array_ops.shape(x)], axis=0 + ) + return array_ops.broadcast_to(x, shape, name=name) + + +def clamp(a, x, b, name=None): + return min(max(a, x, name=name), b, name=name) + + +concatenate = array_ops.concat + + +def conv( + lhs, + rhs, + window_strides, + padding, + lhs_dilation, + rhs_dilation, + dimension_numbers, + feature_group_count=1, + precision_config=None, + preferred_element_type=None, + name=None, + use_v2=False, + batch_group_count=1, +): + """Wraps the XLA ConvGeneralDilated operator. + + ConvGeneralDilated is the most general form of XLA convolution and is + documented at + https://www.tensorflow.org/performance/xla/operation_semantics#conv_convolution + + Args: + lhs: the input tensor + rhs: the kernel tensor + window_strides: the inter-window strides + padding: the padding to apply at the start and end of each input dimensions + lhs_dilation: dilation to apply between input elements + rhs_dilation: dilation to apply between kernel elements + dimension_numbers: a `ConvolutionDimensionNumbers` proto. + feature_group_count: number of feature groups for grouped convolution. + precision_config: a `xla.PrecisionConfig` proto. + preferred_element_type: the result `dtype`. + name: an optional name for the operator. + use_v2: an optional request to use the XlaConvV2 op even if not necessary. + batch_group_count: number of batch groups or grouped filters. + + Returns: + A tensor representing the output of the convolution. + """ + precision_config_proto = "" + if precision_config: + precision_config_proto = precision_config.SerializeToString() + needs_v2 = ( + preferred_element_type + or (lhs.dtype != rhs.dtype) + or batch_group_count > 1 + ) + if preferred_element_type is None: + preferred_element_type = np_utils.result_type(lhs.dtype, rhs.dtype) + if needs_v2 or use_v2: + return gen_xla_ops.xla_conv_v2( + lhs, + rhs, + window_strides=window_strides, + padding=padding, + lhs_dilation=lhs_dilation, + rhs_dilation=rhs_dilation, + feature_group_count=feature_group_count, + batch_group_count=batch_group_count, + dimension_numbers=dimension_numbers.SerializeToString(), + precision_config=precision_config_proto, + preferred_element_type=preferred_element_type, + name=name, + ) + return gen_xla_ops.xla_conv( + lhs, + rhs, + window_strides=window_strides, + padding=padding, + lhs_dilation=lhs_dilation, + rhs_dilation=rhs_dilation, + feature_group_count=feature_group_count, + dimension_numbers=dimension_numbers.SerializeToString(), + precision_config=precision_config_proto, + name=name, + ) + + +convert_element_type = math_ops.cast + + +def dot(lhs, rhs, name=None): + return math_ops.tensordot(lhs, rhs, axes=1, name=name) + + +DotDimensionNumbers = xla_data_pb2.DotDimensionNumbers +PrecisionConfig = xla_data_pb2.PrecisionConfig + + +def dot_general( + lhs, + rhs, + dimension_numbers, + precision_config=None, + preferred_element_type=None, + name=None, + use_v2=False, +): + precision_config_proto = "" + if precision_config: + precision_config_proto = precision_config.SerializeToString() + needs_v2 = preferred_element_type or (lhs.dtype != rhs.dtype) + if preferred_element_type is None: + preferred_element_type = np_utils.result_type(lhs.dtype, rhs.dtype) + if needs_v2 or use_v2: + return gen_xla_ops.xla_dot_v2( + lhs, + rhs, + dimension_numbers=dimension_numbers.SerializeToString(), + precision_config=precision_config_proto, + preferred_element_type=preferred_element_type, + name=name, + ) + return gen_xla_ops.xla_dot( + lhs, + rhs, + dimension_numbers=dimension_numbers.SerializeToString(), + precision_config=precision_config_proto, + name=name, + ) + + +def self_adjoint_eig(a, lower, max_iter, epsilon): + return gen_xla_ops.xla_self_adjoint_eig(a, lower, max_iter, epsilon) + + +def svd(a, max_iter, epsilon, precision_config=None): + precision_config_proto = "" + if precision_config: + precision_config_proto = precision_config.SerializeToString() + return gen_xla_ops.xla_svd(a, max_iter, epsilon, precision_config_proto) + + +dynamic_slice = gen_xla_ops.xla_dynamic_slice +dynamic_update_slice = gen_xla_ops.xla_dynamic_update_slice +einsum = gen_xla_ops.xla_einsum + +# TODO(phawkins): generalize tf.pad to support interior padding, and then remove +# the XLA-specific pad operator. +pad = gen_xla_ops.xla_pad + + +def random_normal(mu, sigma, dims, name=None): + mu = ops.convert_to_tensor(mu) + return random_ops.random_normal( + dims, mean=mu, stddev=sigma, dtype=mu.dtype, name=name + ) + + +def random_uniform(minval, maxval, dims, name=None): + minval = ops.convert_to_tensor(minval) + return random_ops.random_uniform( + dims, minval, maxval, dtype=minval.dtype, name=name + ) + + +def rng_bit_generator(algorithm, initial_state, shape, dtype): + """Stateless PRNG bit generator. + + Wraps the XLA RngBitGenerator operator, documented at + https://www.tensorflow.org/performance/xla/operation_semantics#rngbitgenerator. + + Args: + algorithm: The PRNG algorithm to use, one of tf.random.Algorithm.{PHILOX, + THREEFRY, AUTO_SELECT}. + initial_state: Initial state for the PRNG algorithm. For THREEFRY, it should + be a u64[2] and for PHILOX a u64[3]. + shape: The output shape of the generated data. + dtype: The type of the tensor. + + Returns: + a tuple with a new state and generated data of the given shape. + """ + alg_int = random_ops_util.convert_alg_to_int(algorithm) + return gen_xla_ops.xla_rng_bit_generator( + alg_int, initial_state, shape, dtype=dtype + ) + + +recv = gen_xla_ops.xla_recv +reduce = gen_xla_ops.xla_reduce +variadic_reduce = gen_xla_ops.xla_variadic_reduce_v2 + +ops.no_gradient("XlaVariadicReduce") + + +def reduce_window( + operand, + init, + reducer, + window_dimensions, + window_strides=None, + base_dilations=None, + window_dilations=None, + padding=None, + name=None, +): + """Wraps the XLA ReduceWindow operator. + + ReduceWindow is documented at + https://www.tensorflow.org/performance/xla/operation_semantics#reducewindow . + + Args: + operand: the input tensor + init: a scalar tensor representing the initial value for the reduction + reducer: a reduction function that combines a pair of scalars. + window_dimensions: shape of the window, as a list of integers + window_strides: inter-window strides, as a list of integers. Optional; if + omitted, defaults to strides of 1. + padding: padding to apply to 'operand'. List of (low, high) pairs of + integers that specify the padding to apply before and after each + dimension. Optional; if omitted, defaults to no padding. + name: the operator name, or None. + + Returns: + A tensor that represents the output of the reduce_window operator. + """ + window_strides = window_strides or [1] * len(window_dimensions) + base_dilations = base_dilations or [1] * len(window_dimensions) + window_dilations = window_dilations or [1] * len(window_dimensions) + padding = padding or [(0, 0)] * len(window_dimensions) + return gen_xla_ops.xla_reduce_window( + input=operand, + init_value=init, + window_dimensions=window_dimensions, + window_strides=window_strides, + base_dilations=base_dilations, + window_dilations=window_dilations, + padding=padding, + computation=reducer, + name=name, + ) + + +replica_id = gen_xla_ops.xla_replica_id + +# Set a static bound for the given input value as a hint to Xla compiler, +# returns the same value. +# Usage: +# def f(t, p): +# p = xla.set_bound(p, 3) # Tells xla the constraint that p <= 3. +# return t[:p] # xla knows the bound of the slice is 3. +set_bound = gen_xla_ops.xla_set_bound + +# Make a static dimension into a xla bounded dynamic dimension. The current +# static dimension size will become the bound and the second operand becomes the +# dynamic size of the dimension. +# +# This should mostly be used for testing. +# +# def f(): +# array = tf.convert_to_tensor([[1, 2, 3, 4, 5]]) +# # Tells xla the valid size of the array is 3. +# dim = 0 +# p = xla_set_dynamic_dimension_size(array, dim, 3) +# assert(reduce_sum(p) == 6) # xla knows only the first 3 elements are valid. +set_dynamic_dimension_size = gen_xla_ops.xla_set_dynamic_dimension_size + +# Inverse of xla_set_dynamic_dimension_size. Make an xla bounded dynamic +# dimension into a static dimension. The bound of the size of dimension +# `dim_index` becomes the static dimension size. +remove_dynamic_dimension_size = gen_xla_ops.xla_remove_dynamic_dimension_size + + +def reshape(x, new_sizes, dimensions=None, name=None): + if dimensions is not None: + x = array_ops.transpose(x, dimensions) + x = array_ops.reshape(x, new_sizes, name=name) + return x + + +def select(condition, x, y, name=None): + return array_ops.where(condition, x, y, name) + + +select_and_scatter = gen_xla_ops.xla_select_and_scatter +send = gen_xla_ops.xla_send + + +def slice(x, start_dims, limit_dims, strides): + spec = [ + _slice(start, limit, stride) + for (start, limit, stride) in zip(start_dims, limit_dims, strides) + ] + return x[tuple(spec)] + + +sharding = gen_xla_ops.xla_sharding + + +@ops.RegisterGradient("XlaSharding") +def _sharding_grad(op, grad): + """Gradient for XlaSharding op.""" + sharding_attr = op.get_attr("sharding") + grad_sharding = gen_xla_ops.xla_sharding( + grad, + sharding=sharding_attr, + unspecified_dims=op.get_attr("unspecified_dims"), + ) + # pylint: disable=protected-access + grad_sharding.op._set_attr( + "_XlaSharding", attr_value_pb2.AttrValue(s=sharding_attr) + ) + return [grad_sharding] + + +spmd_full_to_shard_shape = gen_xla_ops.xla_spmd_full_to_shard_shape +spmd_shard_to_full_shape = gen_xla_ops.xla_spmd_shard_to_full_shape + + +@ops.RegisterGradient("XlaSpmdFullToShardShape") +def _spmd_full_to_shard_shape_grad(op, grad): + s2f = gen_xla_ops.xla_spmd_shard_to_full_shape( + grad, + manual_sharding=op.get_attr("manual_sharding"), + full_shape=op.inputs[0].shape.as_list(), + dim=op.get_attr("dim"), + unspecified_dims=op.get_attr("unspecified_dims"), + ) + return [s2f] + + +@ops.RegisterGradient("XlaSpmdShardToFullShape") +def _spmd_shard_to_full_shape_grad(op, grad): + f2s = gen_xla_ops.xla_spmd_full_to_shard_shape( + grad, + manual_sharding=op.get_attr("manual_sharding"), + dim=op.get_attr("dim"), + unspecified_dims=op.get_attr("unspecified_dims"), + ) + return [f2s] + + +sort = gen_xla_ops.xla_sort +key_value_sort = gen_xla_ops.xla_key_value_sort +variadic_sort = gen_xla_ops.xla_variadic_sort +while_loop = gen_xla_ops.xla_while +dequantize = gen_xla_ops.xla_dequantize +custom_call = gen_xla_ops.xla_custom_call + + +def custom_call_v2( + call_target_name, + operands, + result_specs, + backend_config=None, + has_side_effect=None, + name=None, +): + """Emits an HLO `CustomCall` operation with multiple outputs. + + See `CustomCall` specification at + https://tensorflow.org/xla/operation_semantics#customcall, + and `mhlo.custom_call` specification at + https://tensorflow.org/mlir/hlo_ops#mhlocustom_call_mlirmhlocustomcallop. + + Args: + call_target_name: Name of the user function. The function signature must + conform to version 3 of the API, see + `API_VERSION_STATUS_RETURNING_UNIFIED`. All operands and results assumed + to be in the default layout. + operands: A sequence of tensors with possibly different types. + result_specs: A sequence of tensor specs for all results. + backend_config: A string that encodes a metadata for the backend. Empty + string by default. + has_side_effect: Indicates whether the custom call has side effects. `False` + by default. + name: Optional name of the operation. + + Returns: + A tuple of output tensors. + """ + return gen_xla_ops.xla_custom_call_v2( + operands=operands, + call_target_name=call_target_name, + backend_config="" if backend_config is None else backend_config, + has_side_effect=False if has_side_effect is None else has_side_effect, + result_dtypes=tuple(spec.dtype for spec in result_specs), + result_shapes=tuple(spec.shape for spec in result_specs), + name=name, + ) + + +# pylint: disable=g-doc-args +# pylint: disable=g-doc-return-or-yield +def call_module( + args, + *, + version=4, + module, + Tout, + Sout, + platforms=(), + function_list=(), + has_token_input_output=False, + disabled_checks=(), +): + """See documentation for the XlaCallModule op. + + https://github.com/search?q=repo%3Atensorflow%2Ftensorflow+path%3Axla_ops.cc+xlacallmodule&type=code + """ + res = gen_xla_ops.xla_call_module( + args, + version=version, + module=module, + dim_args_spec=(), + Tout=Tout, + Sout=Sout, + platforms=platforms, + function_list=function_list, + has_token_input_output=has_token_input_output, + disabled_checks=disabled_checks, + ) + # Since XLACallModule op is stateful, zero return function will return the TF + # op under tf.function. It creates trouble for downstream codes. + # Here we force it return empty tuple to work around it. + # TODO(johnqiangzhang): Figure out a better way to handle control dependency. + if isinstance(res, ops.Operation): + res = () + return res + + +def call_module_maximum_supported_version(): + """Maximum version of XlaCallModule op supported. + + See versioning details documentation for the XlaCallModule op at: + https://github.com/search?q=repo%3Atensorflow%2Ftensorflow+path%3Axla_call_module+%22int+VERSION_MAXIMUM_SUPPORTED%22&type=code + """ + return 8 + +# pylint: enable=g-doc-args +# pylint: enable=g-doc-return-or-yield + + +def call_module_disable_check_platform(): + # For use with xla_call_module.disabled_checks. + return "platform" + + +def gather( + operand, + start_indices, + dimension_numbers, + slice_sizes, + indices_are_sorted=False, + name=None, +): + return gen_xla_ops.xla_gather( + operand, + start_indices, + slice_sizes=slice_sizes, + dimension_numbers=dimension_numbers.SerializeToString(), + indices_are_sorted=indices_are_sorted, + name=name, + ) + + +def scatter( + operand, + scatter_indices, + updates, + update_computation, + dimension_numbers, + indices_are_sorted=False, + name=None, +): + return gen_xla_ops.xla_scatter( + operand, + scatter_indices, + updates, + update_computation=update_computation, + dimension_numbers=dimension_numbers.SerializeToString(), + indices_are_sorted=indices_are_sorted, + name=name, + ) + + +def optimization_barrier(*args): + return gen_xla_ops.xla_optimization_barrier(args) + + +def reduce_precision(operand, exponent_bits, mantissa_bits): + return gen_xla_ops.xla_reduce_precision(operand, exponent_bits, mantissa_bits) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/tf2xla_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/tf2xla_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..5be7d74bd5adc6a11330569cf0a6e5f4c0b3a5af --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/tf2xla_pb2.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/compiler/tf2xla/tf2xla.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2 +from tensorflow.core.framework import types_pb2 as tensorflow_dot_core_dot_framework_dot_types__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\'tensorflow/compiler/tf2xla/tf2xla.proto\x12\x11tensorflow.tf2xla\x1a,tensorflow/core/framework/tensor_shape.proto\x1a%tensorflow/core/framework/types.proto\"3\n\x08TensorId\x12\x11\n\tnode_name\x18\x01 \x01(\t\x12\x14\n\x0coutput_index\x18\x02 \x01(\x03\"\x8e\x01\n\x04\x46\x65\x65\x64\x12\'\n\x02id\x18\x01 \x01(\x0b\x32\x1b.tensorflow.tf2xla.TensorId\x12+\n\x05shape\x18\x02 \x01(\x0b\x32\x1c.tensorflow.TensorShapeProto\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\"\n\x04type\x18\x04 \x01(\x0e\x32\x14.tensorflow.DataType\"\x8f\x01\n\x05\x46\x65tch\x12\'\n\x02id\x18\x01 \x01(\x0b\x32\x1b.tensorflow.tf2xla.TensorId\x12\x0c\n\x04name\x18\x02 \x01(\t\x12+\n\x05shape\x18\x03 \x01(\x0b\x32\x1c.tensorflow.TensorShapeProto\x12\"\n\x04type\x18\x04 \x01(\x0e\x32\x14.tensorflow.DataType\"\x8e\x01\n\x08Variable\x12\x11\n\tnode_name\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12+\n\x05shape\x18\x03 \x01(\x0b\x32\x1c.tensorflow.TensorShapeProto\x12\"\n\x04type\x18\x04 \x01(\x0e\x32\x14.tensorflow.DataType\x12\x10\n\x08readonly\x18\x05 \x01(\x08\"\x87\x01\n\x06\x43onfig\x12%\n\x04\x66\x65\x65\x64\x18\x01 \x03(\x0b\x32\x17.tensorflow.tf2xla.Feed\x12\'\n\x05\x66\x65tch\x18\x02 \x03(\x0b\x32\x18.tensorflow.tf2xla.Fetch\x12-\n\x08variable\x18\x03 \x03(\x0b\x32\x1b.tensorflow.tf2xla.VariableB*\n\x15org.tensorflow.tf2xlaB\x0cTf2XlaProtosP\x01\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.compiler.tf2xla.tf2xla_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\025org.tensorflow.tf2xlaB\014Tf2XlaProtosP\001\370\001\001' + _TENSORID._serialized_start=147 + _TENSORID._serialized_end=198 + _FEED._serialized_start=201 + _FEED._serialized_end=343 + _FETCH._serialized_start=346 + _FETCH._serialized_end=489 + _VARIABLE._serialized_start=492 + _VARIABLE._serialized_end=634 + _CONFIG._serialized_start=637 + _CONFIG._serialized_end=772 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/xla/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/xla/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/xla/service/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/xla/service/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/xla/service/hlo_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/xla/service/hlo_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..b7e8aaa431b979f8b983ee4d20f96354e0213b2a --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/xla/service/hlo_pb2.py @@ -0,0 +1,109 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: xla/service/hlo.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.compiler.xla import xla_data_pb2 as xla_dot_xla__data__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15xla/service/hlo.proto\x12\x03xla\x1a\x12xla/xla_data.proto\"\x8b\x16\n\x13HloInstructionProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06opcode\x18\x02 \x01(\t\x12\x1e\n\x05shape\x18\x03 \x01(\x0b\x32\x0f.xla.ShapeProto\x12!\n\x08metadata\x18\x07 \x01(\x0b\x32\x0f.xla.OpMetadata\x12\"\n\x07literal\x18\x08 \x01(\x0b\x32\x11.xla.LiteralProto\x12\x18\n\x10parameter_number\x18\t \x01(\x03\x12\x13\n\x0b\x66usion_kind\x18\x0b \x01(\t\x12\x13\n\x0btuple_index\x18\r \x01(\x03\x12\x12\n\ndimensions\x18\x0e \x03(\x03\x12\x1b\n\x06window\x18\x0f \x01(\x0b\x32\x0b.xla.Window\x12G\n\x1d\x63onvolution_dimension_numbers\x18\x10 \x01(\x0b\x32 .xla.ConvolutionDimensionNumbers\x12\x1b\n\x13\x66\x65\x61ture_group_count\x18\x32 \x01(\x03\x12\x19\n\x11\x62\x61tch_group_count\x18: \x01(\x03\x12\x42\n\x10slice_dimensions\x18\x11 \x03(\x0b\x32(.xla.HloInstructionProto.SliceDimensions\x12\x15\n\rexponent_bits\x18\x12 \x01(\x05\x12\x15\n\rmantissa_bits\x18\x13 \x01(\x05\x12\x1b\n\x13\x64ynamic_slice_sizes\x18\x14 \x03(\x03\x12*\n\x0epadding_config\x18\x15 \x01(\x0b\x32\x12.xla.PaddingConfig\x12\x16\n\x0eoutfeed_config\x18\x16 \x01(\x0c\x12-\n\x0c\x64istribution\x18\x17 \x01(\x0e\x32\x17.xla.RandomDistribution\x12\x0f\n\x07\x65psilon\x18\x18 \x01(\x02\x12\x15\n\rfeature_index\x18\x19 \x01(\x03\x12\x12\n\nchannel_id\x18\x1a \x01(\x03\x12\x15\n\rinfeed_config\x18\x1b \x01(\x0c\x12\x1a\n\x12\x63ustom_call_target\x18\x1c \x01(\t\x12&\n\routfeed_shape\x18\x1d \x01(\x0b\x32\x0f.xla.ShapeProto\x12\x37\n\x15\x64ot_dimension_numbers\x18\x1e \x01(\x0b\x32\x18.xla.DotDimensionNumbers\x12\x1e\n\x08\x66\x66t_type\x18\x1f \x01(\x0e\x32\x0c.xla.FftType\x12\x12\n\nfft_length\x18 \x03(\x03\x12\x1c\n\x14\x63omparison_direction\x18? \x01(\t\x12=\n\x18gather_dimension_numbers\x18! \x01(\x0b\x32\x1b.xla.GatherDimensionNumbers\x12\x1a\n\x12gather_slice_sizes\x18\" \x03(\x03\x12\n\n\x02id\x18# \x01(\x03\x12\x13\n\x0boperand_ids\x18$ \x03(\x03\x12\x1f\n\x17\x63ontrol_predecessor_ids\x18% \x03(\x03\x12\x1e\n\x16\x63\x61lled_computation_ids\x18& \x03(\x03\x12!\n\x08sharding\x18( \x01(\x0b\x32\x0f.xla.OpSharding\x12\x16\n\x0e\x62\x61\x63kend_config\x18+ \x01(\x0c\x12)\n\x0ereplica_groups\x18\x31 \x03(\x0b\x32\x11.xla.ReplicaGroup\x12\x19\n\rall_reduce_id\x18- \x01(\x03\x42\x02\x18\x01\x12\x1d\n\x15use_global_device_ids\x18G \x01(\x08\x12\x18\n\x10is_host_transfer\x18/ \x01(\x08\x12\x11\n\tis_stable\x18< \x01(\x08\x12?\n\x19scatter_dimension_numbers\x18\x30 \x01(\x0b\x32\x1c.xla.ScatterDimensionNumbers\x12.\n\x10precision_config\x18\x33 \x01(\x0b\x32\x14.xla.PrecisionConfig\x12.\n\x13source_target_pairs\x18\x34 \x03(\x0b\x32\x11.xla.SourceTarget\x12.\n\x15\x64omain_entry_sharding\x18\x36 \x01(\x0b\x32\x0f.xla.OpSharding\x12-\n\x14\x64omain_exit_sharding\x18\x37 \x01(\x0b\x32\x0f.xla.OpSharding\x12\x18\n\x10\x63onstrain_layout\x18\x38 \x01(\x08\x12\x33\n\x1aoperand_shapes_with_layout\x18\x39 \x03(\x0b\x32\x0f.xla.ShapeProto\x12=\n\x18triangular_solve_options\x18; \x01(\x0b\x32\x1b.xla.TriangularSolveOptions\x12.\n\x10\x63holesky_options\x18> \x01(\x0b\x32\x14.xla.CholeskyOptions\x12\x38\n\x15parameter_replication\x18= \x01(\x0b\x32\x19.xla.ParameterReplication\x12#\n\x1b\x63ustom_call_has_side_effect\x18\x41 \x01(\x08\x12;\n\x17output_operand_aliasing\x18J \x03(\x0b\x32\x1a.xla.OutputOperandAliasing\x12\x35\n\x14\x63ustom_call_schedule\x18L \x01(\x0e\x32\x17.xla.CustomCallSchedule\x12\r\n\x05\x64\x65lta\x18\x42 \x01(\x03\x12\x1a\n\x12indices_are_sorted\x18\x43 \x01(\x08\x12\x34\n\x13\x66rontend_attributes\x18\x44 \x01(\x0b\x32\x17.xla.FrontendAttributes\x12\x16\n\x0eunique_indices\x18\x45 \x01(\x08\x12+\n\rrng_algorithm\x18\x46 \x01(\x0e\x32\x14.xla.RandomAlgorithm\x12\x17\n\x0f\x63omparison_type\x18H \x01(\t\x12%\n\x19is_cross_program_prefetch\x18I \x01(\x08\x42\x02\x18\x01\x12&\n\x1c\x63ross_program_prefetch_index\x18P \x01(\x05H\x00\x12&\n\x0cpadding_type\x18K \x01(\x0e\x32\x10.xla.PaddingType\x12:\n\x17\x63ustom_call_api_version\x18M \x01(\x0e\x32\x19.xla.CustomCallApiVersion\x12\x16\n\x0e\x61sync_group_id\x18N \x01(\x03\x12\x1e\n\x16\x61sync_execution_thread\x18O \x01(\t\x12\t\n\x01k\x18Q \x01(\x03\x12*\n\x0estatistics_viz\x18R \x01(\x0b\x32\x12.xla.StatisticsViz\x1a?\n\x0fSliceDimensions\x12\r\n\x05start\x18\x01 \x01(\x03\x12\r\n\x05limit\x18\x02 \x01(\x03\x12\x0e\n\x06stride\x18\x03 \x01(\x03\x42\'\n%optional_cross_program_prefetch_indexJ\x04\x08\n\x10\x0bJ\x04\x08\x0c\x10\rJ\x04\x08\x04\x10\x05J\x04\x08\x05\x10\x06J\x04\x08\x06\x10\x07J\x04\x08,\x10-J\x04\x08\x35\x10\x36J\x04\x08.\x10/J\x04\x08)\x10*J\x04\x08*\x10+J\x04\x08@\x10\x41R\x0eparameter_nameR\x1e\x66used_instructions_computationR\roperand_namesR\x19\x63ontrol_predecessor_namesR\x18\x63\x61lled_computation_namesR\x11replica_group_idsR\x12\x63ustom_call_opaqueR\x12\x61ll_reduce_barrier\"\xe9\x01\n\x13HloComputationProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12.\n\x0cinstructions\x18\x02 \x03(\x0b\x32\x18.xla.HloInstructionProto\x12-\n\rprogram_shape\x18\x04 \x01(\x0b\x32\x16.xla.ProgramShapeProto\x12\n\n\x02id\x18\x05 \x01(\x03\x12\x0f\n\x07root_id\x18\x06 \x01(\x03\x12\x1d\n\x15is_fusion_computation\x18\x07 \x01(\x08\x12\x18\n\x10\x65xecution_thread\x18\x08 \x01(\tJ\x04\x08\x03\x10\x04R\troot_name\"\xd8\x01\n\x10HloScheduleProto\x12\x37\n\tsequences\x18\x01 \x03(\x0b\x32$.xla.HloScheduleProto.SequencesEntry\x1a.\n\x13InstructionSequence\x12\x17\n\x0finstruction_ids\x18\x01 \x03(\x03\x1a[\n\x0eSequencesEntry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12\x38\n\x05value\x18\x02 \x01(\x0b\x32).xla.HloScheduleProto.InstructionSequence:\x02\x38\x01\"\xdb\x01\n\x18HloInputOutputAliasProto\x12>\n\x07\x65ntries\x18\x01 \x03(\x0b\x32-.xla.HloInputOutputAliasProto.AliasEntryProto\x1a\x7f\n\x0f\x41liasEntryProto\x12\x1a\n\x12output_shape_index\x18\x01 \x03(\x03\x12\x18\n\x10parameter_number\x18\x02 \x01(\x03\x12\x1d\n\x15parameter_shape_index\x18\x03 \x03(\x03\x12\x17\n\x04kind\x18\x04 \x01(\x0e\x32\t.xla.Kind\"\xa8\x01\n\x13HloBufferDonorProto\x12?\n\x07\x65ntries\x18\x01 \x03(\x0b\x32..xla.HloBufferDonorProto.BufferDonorEntryProto\x1aP\n\x15\x42ufferDonorEntryProto\x12\x18\n\x10parameter_number\x18\x01 \x01(\x03\x12\x1d\n\x15parameter_shape_index\x18\x02 \x03(\x03\"H\n\x14\x43rossProgramPrefetch\x12\x11\n\tparameter\x18\x01 \x01(\x03\x12\r\n\x05index\x18\x02 \x03(\x03\x12\x0e\n\x06offset\x18\x03 \x01(\x03\"\xdd\x02\n\x14StackFrameIndexProto\x12\x12\n\nfile_names\x18\x01 \x03(\t\x12\x16\n\x0e\x66unction_names\x18\x02 \x03(\t\x12>\n\x0e\x66ile_locations\x18\x03 \x03(\x0b\x32&.xla.StackFrameIndexProto.FileLocation\x12:\n\x0cstack_frames\x18\x04 \x03(\x0b\x32$.xla.StackFrameIndexProto.StackFrame\x1a\\\n\x0c\x46ileLocation\x12\x14\n\x0c\x66ile_name_id\x18\x01 \x01(\x05\x12\x18\n\x10\x66unction_name_id\x18\x02 \x01(\x05\x12\x0c\n\x04line\x18\x03 \x01(\x05\x12\x0e\n\x06\x63olumn\x18\x04 \x01(\x05\x1a?\n\nStackFrame\x12\x18\n\x10\x66ile_location_id\x18\x01 \x01(\x05\x12\x17\n\x0fparent_frame_id\x18\x02 \x01(\x05\"\xb9\x08\n\x0eHloModuleProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x1e\n\x16\x65ntry_computation_name\x18\x02 \x01(\t\x12\x1c\n\x14\x65ntry_computation_id\x18\x06 \x01(\x03\x12.\n\x0c\x63omputations\x18\x03 \x03(\x0b\x32\x18.xla.HloComputationProto\x12\x32\n\x12host_program_shape\x18\x04 \x01(\x0b\x32\x16.xla.ProgramShapeProto\x12\n\n\x02id\x18\x05 \x01(\x03\x12\'\n\x08schedule\x18\x07 \x01(\x0b\x32\x15.xla.HloScheduleProto\x12\x39\n\x12input_output_alias\x18\x08 \x01(\x0b\x32\x1d.xla.HloInputOutputAliasProto\x12.\n\x0c\x62uffer_donor\x18\x12 \x01(\x0b\x32\x18.xla.HloBufferDonorProto\x12;\n\x18\x63ross_program_prefetches\x18\n \x03(\x0b\x32\x19.xla.CrossProgramPrefetch\x12\x12\n\nis_dynamic\x18\x0b \x01(\x08\x12-\n\x14spmd_output_sharding\x18\x0c \x01(\x0b\x32\x0f.xla.OpSharding\x12\x32\n\x19spmd_parameters_shardings\x18\x0e \x03(\x0b\x32\x0f.xla.OpSharding\x12\"\n\x1ause_auto_spmd_partitioning\x18\x10 \x01(\x08\x12\x35\n\x0cprofile_info\x18\r \x03(\x0b\x32\x1f.xla.HloModuleProto.ProfileInfo\x12\x35\n\x11\x64\x65vice_assignment\x18\x0f \x01(\x0b\x32\x1a.xla.DeviceAssignmentProto\x12\x34\n\x11stack_frame_index\x18\x11 \x01(\x0b\x32\x19.xla.StackFrameIndexProto\x12\x34\n\x13\x66rontend_attributes\x18\x13 \x01(\x0b\x32\x17.xla.FrontendAttributes\x1a\xbc\x01\n\x0bProfileInfo\x12\x35\n\x0cprofile_type\x18\x01 \x01(\x0e\x32\x1f.xla.HloModuleProto.ProfileType\x12\x18\n\x10relative_speedup\x18\x02 \x01(\x01\x12*\n\x0eprofile_source\x18\x03 \x01(\x0e\x32\x12.xla.ProfileSource\x12\x30\n\x11\x63ompilation_event\x18\x04 \x01(\x0e\x32\x15.xla.CompilationEvent\"E\n\x0bProfileType\x12\x0b\n\x07INVALID\x10\x00\x12\x08\n\x04\x46LAG\x10\x01\x12\n\n\x06\x46USION\x10\x02\x12\n\n\x06LAYOUT\x10\x03\x12\x07\n\x03\x44OT\x10\x04J\x04\x08\t\x10\nR\x19\x64ynamic_parameter_binding\"\xd0\x01\n\x12LogicalBufferProto\x12\n\n\x02id\x18\x01 \x01(\x03\x12\x0c\n\x04size\x18\x02 \x01(\x03\x12\x34\n\ndefined_at\x18\x03 \x01(\x0b\x32 .xla.LogicalBufferProto.Location\x12\r\n\x05\x63olor\x18\x04 \x01(\x03\x1a[\n\x08Location\x12\x1c\n\x10instruction_name\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\x0einstruction_id\x18\x04 \x01(\x03\x12\x13\n\x0bshape_index\x18\x03 \x03(\x03J\x04\x08\x01\x10\x02\"\xf8\x02\n\x15\x42ufferAllocationProto\x12\r\n\x05index\x18\x01 \x01(\x03\x12\x0c\n\x04size\x18\x02 \x01(\x03\x12\x17\n\x0fis_thread_local\x18\x03 \x01(\x08\x12\x10\n\x08is_tuple\x18\x0b \x01(\x08\x12&\n\x1eis_entry_computation_parameter\x18\x05 \x01(\x08\x12\x13\n\x0bis_constant\x18\x0c \x01(\x08\x12\x18\n\x10parameter_number\x18\x06 \x01(\x03\x12\x1d\n\x15parameter_shape_index\x18\n \x03(\x03\x12\x16\n\x0emaybe_live_out\x18\x07 \x01(\x08\x12\r\n\x05\x63olor\x18\x08 \x01(\x03\x12\x35\n\x08\x61ssigned\x18\t \x03(\x0b\x32#.xla.BufferAllocationProto.Assigned\x1a\x43\n\x08\x41ssigned\x12\x19\n\x11logical_buffer_id\x18\x01 \x01(\x03\x12\x0e\n\x06offset\x18\x02 \x01(\x03\x12\x0c\n\x04size\x18\x03 \x01(\x03\"\xd6\x02\n\x12HeapSimulatorTrace\x12-\n\x06\x65vents\x18\x01 \x03(\x0b\x32\x1d.xla.HeapSimulatorTrace.Event\x12\x1f\n\x17whole_module_simulation\x18\x02 \x01(\x08\x12\x1f\n\x17\x62uffer_allocation_index\x18\x03 \x01(\x03\x1a\xce\x01\n\x05\x45vent\x12\x30\n\x04kind\x18\x01 \x01(\x0e\x32\".xla.HeapSimulatorTrace.Event.Kind\x12\x11\n\tbuffer_id\x18\x02 \x01(\x03\x12\x18\n\x10\x63omputation_name\x18\x03 \x01(\t\x12\x18\n\x10instruction_name\x18\x04 \x01(\t\x12\x1f\n\x17share_with_canonical_id\x18\x05 \x01(\x03\"+\n\x04Kind\x12\t\n\x05\x41LLOC\x10\x00\x12\x08\n\x04\x46REE\x10\x01\x12\x0e\n\nSHARE_WITH\x10\x02\"M\n\x13HloModuleGroupProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12(\n\x0bhlo_modules\x18\x02 \x03(\x0b\x32\x13.xla.HloModuleProto\"\xd6\x02\n\x15\x42ufferAssignmentProto\x12\x30\n\x0flogical_buffers\x18\x01 \x03(\x0b\x32\x17.xla.LogicalBufferProto\x12>\n\x0e\x62uffer_aliases\x18\x02 \x03(\x0b\x32&.xla.BufferAssignmentProto.BufferAlias\x12\x36\n\x12\x62uffer_allocations\x18\x03 \x03(\x0b\x32\x1a.xla.BufferAllocationProto\x12\x36\n\x15heap_simulator_traces\x18\x04 \x03(\x0b\x32\x17.xla.HeapSimulatorTrace\x1a[\n\x0b\x42ufferAlias\x12\x18\n\x10source_buffer_id\x18\x01 \x01(\x03\x12\x32\n\x08location\x18\x02 \x01(\x0b\x32 .xla.LogicalBufferProto.Location\"~\n\x08HloProto\x12\'\n\nhlo_module\x18\x01 \x01(\x0b\x32\x13.xla.HloModuleProto\x12\x35\n\x11\x62uffer_assignment\x18\x03 \x01(\x0b\x32\x1a.xla.BufferAssignmentProtoJ\x04\x08\x02\x10\x03R\x0chlo_ordering\"\x8e\x01\n\x0bHloSnapshot\x12\x1a\n\x03hlo\x18\x01 \x01(\x0b\x32\r.xla.HloProto\x12$\n\targuments\x18\x02 \x03(\x0b\x32\x11.xla.LiteralProto\x12!\n\x06result\x18\x03 \x01(\x0b\x32\x11.xla.LiteralProto\x12\x1a\n\x12\x65xecution_platform\x18\x04 \x01(\t\"\xb9\x01\n\x16HloModuleMetadataProto\x12\x1b\n\x13\x63\x61nonical_module_id\x18\x01 \x01(\x03\x12\x19\n\x11module_group_name\x18\x02 \x01(\t\x12\x1a\n\x12original_module_id\x18\x03 \x01(\x03\x12\x1e\n\x16partitioned_module_ids\x18\x04 \x03(\x03\x12+\n\rpass_metadata\x18\x05 \x03(\x0b\x32\x14.xla.HloPassMetadata\"\xea\x01\n\x0fHloPassMetadata\x12\x0f\n\x07pass_id\x18\x01 \x01(\x03\x12\x11\n\tpass_name\x18\x02 \x01(\t\x12\x15\n\rpipeline_name\x18\x03 \x01(\t\x12\x16\n\x0e\x64ump_filenames\x18\x04 \x03(\t\x12\x16\n\x0emodule_changed\x18\x05 \x01(\x08\x12\x11\n\tmodule_id\x18\x06 \x01(\x03\x12\x1f\n\x17module_group_module_ids\x18\x07 \x03(\x03\x12\x1c\n\x14start_timestamp_usec\x18\x08 \x01(\x03\x12\x1a\n\x12\x65nd_timestamp_usec\x18\t \x01(\x03\"\xb3\x03\n\x17\x45ntryFunctionAttributes\x12G\n\x07\x62uffers\x18\x01 \x03(\x0b\x32\x36.xla.EntryFunctionAttributes.BufferParameterAttributes\x12\x18\n\x10result_xla_shape\x18\x02 \x01(\t\x1a\x1d\n\nShapeIndex\x12\x0f\n\x07indices\x18\x01 \x03(\x03\x1a\x95\x02\n\x19\x42ufferParameterAttributes\x12\x14\n\x0clmhlo_params\x18\x01 \x01(\x03\x12\x1c\n\x14lmhlo_params_present\x18\x06 \x01(\x08\x12H\n\x17lmhlo_param_shape_index\x18\x02 \x01(\x0b\x32\'.xla.EntryFunctionAttributes.ShapeIndex\x12\x1b\n\x13lmhlo_constant_name\x18\x03 \x01(\t\x12\x18\n\x10lmhlo_must_alias\x18\x04 \x01(\x08\x12\x43\n\x12lmhlo_output_index\x18\x05 \x01(\x0b\x32\'.xla.EntryFunctionAttributes.ShapeIndex\"q\n\x19XlaRuntimeExecutableProto\x12-\n\x10hlo_module_proto\x18\x01 \x01(\x0b\x32\x13.xla.HloModuleProto\x12\x10\n\x08obj_file\x18\x03 \x01(\x0c\x12\x13\n\x0bmlir_module\x18\x04 \x01(\t*S\n\x12\x43ustomCallSchedule\x12\x11\n\rSCHEDULE_NONE\x10\x00\x12\x13\n\x0fSCHEDULE_LATEST\x10\x01\x12\x15\n\x11SCHEDULE_EARLIEST\x10\x02*\xb4\x01\n\x14\x43ustomCallApiVersion\x12\x1b\n\x17\x41PI_VERSION_UNSPECIFIED\x10\x00\x12\x18\n\x14\x41PI_VERSION_ORIGINAL\x10\x01\x12 \n\x1c\x41PI_VERSION_STATUS_RETURNING\x10\x02\x12(\n$API_VERSION_STATUS_RETURNING_UNIFIED\x10\x03\x12\x19\n\x15\x41PI_VERSION_TYPED_FFI\x10\x04*:\n\x04Kind\x12\x13\n\x0fUNDEFINED_ALIAS\x10\x00\x12\r\n\tMAY_ALIAS\x10\x01\x12\x0e\n\nMUST_ALIAS\x10\x02\x42\x03\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'xla.service.hlo_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\370\001\001' + _HLOINSTRUCTIONPROTO.fields_by_name['all_reduce_id']._options = None + _HLOINSTRUCTIONPROTO.fields_by_name['all_reduce_id']._serialized_options = b'\030\001' + _HLOINSTRUCTIONPROTO.fields_by_name['is_cross_program_prefetch']._options = None + _HLOINSTRUCTIONPROTO.fields_by_name['is_cross_program_prefetch']._serialized_options = b'\030\001' + _HLOSCHEDULEPROTO_SEQUENCESENTRY._options = None + _HLOSCHEDULEPROTO_SEQUENCESENTRY._serialized_options = b'8\001' + _LOGICALBUFFERPROTO_LOCATION.fields_by_name['instruction_name']._options = None + _LOGICALBUFFERPROTO_LOCATION.fields_by_name['instruction_name']._serialized_options = b'\030\001' + _CUSTOMCALLSCHEDULE._serialized_start=7848 + _CUSTOMCALLSCHEDULE._serialized_end=7931 + _CUSTOMCALLAPIVERSION._serialized_start=7934 + _CUSTOMCALLAPIVERSION._serialized_end=8114 + _KIND._serialized_start=8116 + _KIND._serialized_end=8174 + _HLOINSTRUCTIONPROTO._serialized_start=51 + _HLOINSTRUCTIONPROTO._serialized_end=2878 + _HLOINSTRUCTIONPROTO_SLICEDIMENSIONS._serialized_start=2533 + _HLOINSTRUCTIONPROTO_SLICEDIMENSIONS._serialized_end=2596 + _HLOCOMPUTATIONPROTO._serialized_start=2881 + _HLOCOMPUTATIONPROTO._serialized_end=3114 + _HLOSCHEDULEPROTO._serialized_start=3117 + _HLOSCHEDULEPROTO._serialized_end=3333 + _HLOSCHEDULEPROTO_INSTRUCTIONSEQUENCE._serialized_start=3194 + _HLOSCHEDULEPROTO_INSTRUCTIONSEQUENCE._serialized_end=3240 + _HLOSCHEDULEPROTO_SEQUENCESENTRY._serialized_start=3242 + _HLOSCHEDULEPROTO_SEQUENCESENTRY._serialized_end=3333 + _HLOINPUTOUTPUTALIASPROTO._serialized_start=3336 + _HLOINPUTOUTPUTALIASPROTO._serialized_end=3555 + _HLOINPUTOUTPUTALIASPROTO_ALIASENTRYPROTO._serialized_start=3428 + _HLOINPUTOUTPUTALIASPROTO_ALIASENTRYPROTO._serialized_end=3555 + _HLOBUFFERDONORPROTO._serialized_start=3558 + _HLOBUFFERDONORPROTO._serialized_end=3726 + _HLOBUFFERDONORPROTO_BUFFERDONORENTRYPROTO._serialized_start=3646 + _HLOBUFFERDONORPROTO_BUFFERDONORENTRYPROTO._serialized_end=3726 + _CROSSPROGRAMPREFETCH._serialized_start=3728 + _CROSSPROGRAMPREFETCH._serialized_end=3800 + _STACKFRAMEINDEXPROTO._serialized_start=3803 + _STACKFRAMEINDEXPROTO._serialized_end=4152 + _STACKFRAMEINDEXPROTO_FILELOCATION._serialized_start=3995 + _STACKFRAMEINDEXPROTO_FILELOCATION._serialized_end=4087 + _STACKFRAMEINDEXPROTO_STACKFRAME._serialized_start=4089 + _STACKFRAMEINDEXPROTO_STACKFRAME._serialized_end=4152 + _HLOMODULEPROTO._serialized_start=4155 + _HLOMODULEPROTO._serialized_end=5236 + _HLOMODULEPROTO_PROFILEINFO._serialized_start=4944 + _HLOMODULEPROTO_PROFILEINFO._serialized_end=5132 + _HLOMODULEPROTO_PROFILETYPE._serialized_start=5134 + _HLOMODULEPROTO_PROFILETYPE._serialized_end=5203 + _LOGICALBUFFERPROTO._serialized_start=5239 + _LOGICALBUFFERPROTO._serialized_end=5447 + _LOGICALBUFFERPROTO_LOCATION._serialized_start=5356 + _LOGICALBUFFERPROTO_LOCATION._serialized_end=5447 + _BUFFERALLOCATIONPROTO._serialized_start=5450 + _BUFFERALLOCATIONPROTO._serialized_end=5826 + _BUFFERALLOCATIONPROTO_ASSIGNED._serialized_start=5759 + _BUFFERALLOCATIONPROTO_ASSIGNED._serialized_end=5826 + _HEAPSIMULATORTRACE._serialized_start=5829 + _HEAPSIMULATORTRACE._serialized_end=6171 + _HEAPSIMULATORTRACE_EVENT._serialized_start=5965 + _HEAPSIMULATORTRACE_EVENT._serialized_end=6171 + _HEAPSIMULATORTRACE_EVENT_KIND._serialized_start=6128 + _HEAPSIMULATORTRACE_EVENT_KIND._serialized_end=6171 + _HLOMODULEGROUPPROTO._serialized_start=6173 + _HLOMODULEGROUPPROTO._serialized_end=6250 + _BUFFERASSIGNMENTPROTO._serialized_start=6253 + _BUFFERASSIGNMENTPROTO._serialized_end=6595 + _BUFFERASSIGNMENTPROTO_BUFFERALIAS._serialized_start=6504 + _BUFFERASSIGNMENTPROTO_BUFFERALIAS._serialized_end=6595 + _HLOPROTO._serialized_start=6597 + _HLOPROTO._serialized_end=6723 + _HLOSNAPSHOT._serialized_start=6726 + _HLOSNAPSHOT._serialized_end=6868 + _HLOMODULEMETADATAPROTO._serialized_start=6871 + _HLOMODULEMETADATAPROTO._serialized_end=7056 + _HLOPASSMETADATA._serialized_start=7059 + _HLOPASSMETADATA._serialized_end=7293 + _ENTRYFUNCTIONATTRIBUTES._serialized_start=7296 + _ENTRYFUNCTIONATTRIBUTES._serialized_end=7731 + _ENTRYFUNCTIONATTRIBUTES_SHAPEINDEX._serialized_start=7422 + _ENTRYFUNCTIONATTRIBUTES_SHAPEINDEX._serialized_end=7451 + _ENTRYFUNCTIONATTRIBUTES_BUFFERPARAMETERATTRIBUTES._serialized_start=7454 + _ENTRYFUNCTIONATTRIBUTES_BUFFERPARAMETERATTRIBUTES._serialized_end=7731 + _XLARUNTIMEEXECUTABLEPROTO._serialized_start=7733 + _XLARUNTIMEEXECUTABLEPROTO._serialized_end=7846 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/xla/xla_data_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/xla/xla_data_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..896cfef74b7d7a80e56ce30a287b188b63e5213a --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/compiler/xla/xla_data_pb2.py @@ -0,0 +1,130 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: xla/xla_data.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x12xla/xla_data.proto\x12\x03xla\"\xb7\x01\n\rPaddingConfig\x12=\n\ndimensions\x18\x01 \x03(\x0b\x32).xla.PaddingConfig.PaddingConfigDimension\x1ag\n\x16PaddingConfigDimension\x12\x18\n\x10\x65\x64ge_padding_low\x18\x01 \x01(\x03\x12\x19\n\x11\x65\x64ge_padding_high\x18\x02 \x01(\x03\x12\x18\n\x10interior_padding\x18\x03 \x01(\x03\"\x1f\n\tTileProto\x12\x12\n\ndimensions\x18\x01 \x03(\x03\"\xe0\x03\n\x0bLayoutProto\x12*\n\x0f\x64im_level_types\x18\t \x03(\x0e\x32\x11.xla.DimLevelType\x12\x12\n\ndim_unique\x18\r \x03(\x08\x12\x13\n\x0b\x64im_ordered\x18\x0e \x03(\x08\x12\x16\n\x0eminor_to_major\x18\x01 \x03(\x03\x12\x1d\n\x05tiles\x18\x06 \x03(\x0b\x32\x0e.xla.TileProto\x12\x1c\n\x14\x65lement_size_in_bits\x18\x07 \x01(\x03\x12\x14\n\x0cmemory_space\x18\x08 \x01(\x03\x12\x30\n\x14index_primitive_type\x18\x0b \x01(\x0e\x32\x12.xla.PrimitiveType\x12\x32\n\x16pointer_primitive_type\x18\x0c \x01(\x0e\x32\x12.xla.PrimitiveType\x12\'\n\x0ephysical_shape\x18\n \x01(\x0b\x32\x0f.xla.ShapeProto\x12+\n#dynamic_shape_metadata_prefix_bytes\x18\x0f \x01(\x03J\x04\x08\x02\x10\x03J\x04\x08\x03\x10\x04J\x04\x08\x04\x10\x05J\x04\x08\x05\x10\x06R\x11padded_dimensionsR\rpadding_valueR\x06\x66ormatR\x13max_sparse_elements\"\xbd\x01\n\nShapeProto\x12(\n\x0c\x65lement_type\x18\x02 \x01(\x0e\x32\x12.xla.PrimitiveType\x12\x12\n\ndimensions\x18\x03 \x03(\x03\x12%\n\x0ctuple_shapes\x18\x04 \x03(\x0b\x32\x0f.xla.ShapeProto\x12 \n\x06layout\x18\x05 \x01(\x0b\x32\x10.xla.LayoutProto\x12\x1c\n\x14is_dynamic_dimension\x18\x06 \x03(\x08J\x04\x08\x01\x10\x02R\x04rank\"r\n\x11ProgramShapeProto\x12#\n\nparameters\x18\x01 \x03(\x0b\x32\x0f.xla.ShapeProto\x12\x1f\n\x06result\x18\x02 \x01(\x0b\x32\x0f.xla.ShapeProto\x12\x17\n\x0fparameter_names\x18\x03 \x03(\t\"D\n\x10\x43omputationStats\x12\x12\n\nflop_count\x18\x01 \x01(\x01\x12\x1c\n\x14transcendental_count\x18\x02 \x01(\x01\"\xcb\x04\n\nOpMetadata\x12\x0f\n\x07op_type\x18\x01 \x01(\t\x12\x0f\n\x07op_name\x18\x02 \x01(\t\x12\x13\n\x0bsource_file\x18\x03 \x01(\t\x12\x13\n\x0bsource_line\x18\x04 \x01(\x05\x12*\n\x0cprofile_type\x18\x05 \x03(\x0e\x32\x10.xla.ProfileTypeB\x02\x18\x01\x12\x18\n\x10\x63reation_pass_id\x18\x06 \x01(\x03\x12 \n\x18logical_creation_pass_id\x18\x07 \x01(\x03\x12\'\n\x1fsize_of_generated_code_in_bytes\x18\x08 \x01(\x03\x12+\n#size_of_memory_working_set_in_bytes\x18\t \x01(\x03\x12\x31\n\x0cprofile_info\x18\n \x01(\x0b\x32\x1b.xla.OpMetadata.ProfileInfo\x12\x19\n\x11\x64\x65\x64uplicated_name\x18\x0c \x01(\t\x12\x17\n\x0fpreserve_layout\x18\r \x01(\x08\x12\x16\n\x0estack_frame_id\x18\x0f \x01(\x05\x1a\xad\x01\n\x0bProfileInfo\x12&\n\x0cprofile_type\x18\x01 \x03(\x0e\x32\x10.xla.ProfileType\x12\x18\n\x10relative_speedup\x18\x02 \x01(\x01\x12*\n\x0eprofile_source\x18\x03 \x01(\x0e\x32\x12.xla.ProfileSource\x12\x30\n\x11\x63ompilation_event\x18\x04 \x01(\x0e\x32\x15.xla.CompilationEventJ\x04\x08\x0e\x10\x0f\"\xe3\x01\n\x10\x45xecutionProfile\x12\x1d\n\x15\x63ompilation_cache_hit\x18\x01 \x01(\x08\x12\x17\n\x0f\x63ompile_time_ms\x18\x02 \x01(\x03\x12\x1b\n\x13\x63ompute_cycle_count\x18\x03 \x01(\x03\x12\x17\n\x0f\x63ompute_time_ns\x18\x04 \x01(\x03\x12$\n\x1c\x63ompute_and_transfer_time_ns\x18\x05 \x01(\x03\x12 \n\x18\x65xecutable_size_in_bytes\x18\x06 \x01(\x03\x12\x19\n\x11profile_cache_hit\x18\x07 \x01(\x08\"!\n\x0f\x45xecutionHandle\x12\x0e\n\x06handle\x18\x01 \x01(\x03\"\"\n\x10GlobalDataHandle\x12\x0e\n\x06handle\x18\x01 \x01(\x03\"4\n\x0c\x44\x65viceHandle\x12\x0e\n\x06handle\x18\x01 \x01(\x03\x12\x14\n\x0c\x64\x65vice_count\x18\x02 \x01(\x03\"\xb4\x01\n\rChannelHandle\x12\x0e\n\x06handle\x18\x01 \x01(\x03\x12,\n\x04type\x18\x02 \x01(\x0e\x32\x1e.xla.ChannelHandle.ChannelType\"e\n\x0b\x43hannelType\x12\x18\n\x14\x43HANNEL_TYPE_INVALID\x10\x00\x12\x14\n\x10\x44\x45VICE_TO_DEVICE\x10\x01\x12\x12\n\x0e\x44\x45VICE_TO_HOST\x10\x02\x12\x12\n\x0eHOST_TO_DEVICE\x10\x03\"\xc5\x01\n\x15\x44\x65viceAssignmentProto\x12\x15\n\rreplica_count\x18\x01 \x01(\x05\x12\x19\n\x11\x63omputation_count\x18\x02 \x01(\x05\x12I\n\x13\x63omputation_devices\x18\x03 \x03(\x0b\x32,.xla.DeviceAssignmentProto.ComputationDevice\x1a/\n\x11\x43omputationDevice\x12\x1a\n\x12replica_device_ids\x18\x01 \x03(\x05\"\xc4\x03\n\x0cLiteralProto\x12\x1e\n\x05shape\x18\x01 \x01(\x0b\x32\x0f.xla.ShapeProto\x12\r\n\x05preds\x18\x02 \x03(\x08\x12\x0b\n\x03s4s\x18\x15 \x01(\x0c\x12\x0b\n\x03u4s\x18\x16 \x01(\x0c\x12\x0b\n\x03s8s\x18\x0f \x01(\x0c\x12\x0b\n\x03u8s\x18\x03 \x01(\x0c\x12\x0c\n\x04s32s\x18\x04 \x03(\x05\x12\x0c\n\x04s64s\x18\x05 \x03(\x03\x12\x0c\n\x04u32s\x18\x06 \x03(\r\x12\x0c\n\x04u64s\x18\x07 \x03(\x04\x12\x0c\n\x04\x66\x33\x32s\x18\x08 \x03(\x02\x12\x0c\n\x04\x66\x36\x34s\x18\t \x03(\x01\x12\x0c\n\x04\x63\x36\x34s\x18\x0c \x03(\x02\x12\r\n\x05\x63\x31\x32\x38s\x18\x12 \x03(\x01\x12)\n\x0etuple_literals\x18\n \x03(\x0b\x32\x11.xla.LiteralProto\x12\x0c\n\x04\x66\x31\x36s\x18\x0b \x01(\x0c\x12\r\n\x05\x62\x66\x31\x36s\x18\r \x01(\x0c\x12\x0c\n\x04u16s\x18\x10 \x01(\x0c\x12\x0c\n\x04s16s\x18\x11 \x01(\x0c\x12\x0f\n\x07\x66\x38\x65\x35m2s\x18\x13 \x01(\x0c\x12\x11\n\tf8e4m3fns\x18\x14 \x01(\x0c\x12\x16\n\x0e\x66\x38\x65\x34m3b11fnuzs\x18\x17 \x01(\x0c\x12\x13\n\x0b\x66\x38\x65\x35m2fnuzs\x18\x18 \x01(\x0c\x12\x13\n\x0b\x66\x38\x65\x34m3fnuzs\x18\x19 \x01(\x0c\x12\x16\n\x0esparse_indices\x18\x0e \x03(\x03\"\xa3\x01\n\x0fWindowDimension\x12\x0c\n\x04size\x18\x01 \x01(\x03\x12\x0e\n\x06stride\x18\x02 \x01(\x03\x12\x13\n\x0bpadding_low\x18\x03 \x01(\x03\x12\x14\n\x0cpadding_high\x18\x04 \x01(\x03\x12\x17\n\x0fwindow_dilation\x18\x05 \x01(\x03\x12\x15\n\rbase_dilation\x18\x06 \x01(\x03\x12\x17\n\x0fwindow_reversal\x18\x07 \x01(\x08\"2\n\x06Window\x12(\n\ndimensions\x18\x01 \x03(\x0b\x32\x14.xla.WindowDimension\"~\n\x16GatherDimensionNumbers\x12\x13\n\x0boffset_dims\x18\x01 \x03(\x03\x12\x1c\n\x14\x63ollapsed_slice_dims\x18\x02 \x03(\x03\x12\x17\n\x0fstart_index_map\x18\x03 \x03(\x03\x12\x18\n\x10index_vector_dim\x18\x04 \x01(\x03\"\x93\x01\n\x17ScatterDimensionNumbers\x12\x1a\n\x12update_window_dims\x18\x01 \x03(\x03\x12\x1c\n\x14inserted_window_dims\x18\x02 \x03(\x03\x12$\n\x1cscatter_dims_to_operand_dims\x18\x03 \x03(\x03\x12\x18\n\x10index_vector_dim\x18\x04 \x01(\x03\"\xd8\x02\n\x1b\x43onvolutionDimensionNumbers\x12\x1d\n\x15input_batch_dimension\x18\x07 \x01(\x03\x12\x1f\n\x17input_feature_dimension\x18\x08 \x01(\x03\x12 \n\x18input_spatial_dimensions\x18\x0b \x03(\x03\x12&\n\x1ekernel_input_feature_dimension\x18\x03 \x01(\x03\x12\'\n\x1fkernel_output_feature_dimension\x18\x04 \x01(\x03\x12!\n\x19kernel_spatial_dimensions\x18\x06 \x03(\x03\x12\x1e\n\x16output_batch_dimension\x18\t \x01(\x03\x12 \n\x18output_feature_dimension\x18\n \x01(\x03\x12!\n\x19output_spatial_dimensions\x18\x0c \x03(\x03\"\x99\x01\n\x13\x44otDimensionNumbers\x12\"\n\x1alhs_contracting_dimensions\x18\x01 \x03(\x03\x12\"\n\x1arhs_contracting_dimensions\x18\x02 \x03(\x03\x12\x1c\n\x14lhs_batch_dimensions\x18\x03 \x03(\x03\x12\x1c\n\x14rhs_batch_dimensions\x18\x04 \x03(\x03\"\xdf\x01\n\x16TriangularSolveOptions\x12\x11\n\tleft_side\x18\x01 \x01(\x08\x12\r\n\x05lower\x18\x02 \x01(\x08\x12\x15\n\runit_diagonal\x18\x03 \x01(\x08\x12:\n\x0btranspose_a\x18\x04 \x01(\x0e\x32%.xla.TriangularSolveOptions.Transpose\"P\n\tTranspose\x12\x15\n\x11TRANSPOSE_INVALID\x10\x00\x12\x10\n\x0cNO_TRANSPOSE\x10\x01\x12\r\n\tTRANSPOSE\x10\x02\x12\x0b\n\x07\x41\x44JOINT\x10\x03\" \n\x0f\x43holeskyOptions\x12\r\n\x05lower\x18\x01 \x01(\x08\"o\n\x12\x46rontendAttributes\x12-\n\x03map\x18\x01 \x03(\x0b\x32 .xla.FrontendAttributes.MapEntry\x1a*\n\x08MapEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"0\n\tStatistic\x12\x11\n\tstat_name\x18\x01 \x01(\t\x12\x10\n\x08stat_val\x18\x02 \x01(\x01\"T\n\rStatisticsViz\x12\x1f\n\x17stat_index_to_visualize\x18\x01 \x01(\x03\x12\"\n\nstatistics\x18\x02 \x03(\x0b\x32\x0e.xla.Statistic\"\xd3\x04\n\nOpSharding\x12\"\n\x04type\x18\x01 \x01(\x0e\x32\x14.xla.OpSharding.Type\x12#\n\ntile_shape\x18\x02 \x01(\x0b\x32\x0f.xla.ShapeProto\x12\"\n\x1atile_assignment_dimensions\x18\x03 \x03(\x03\x12\x1f\n\x17tile_assignment_devices\x18\x04 \x03(\x03\x12(\n\x0ftuple_shardings\x18\x05 \x03(\x0b\x32\x0f.xla.OpSharding\x12\"\n\x1areplicate_on_last_tile_dim\x18\x06 \x01(\x08\x12!\n\x08metadata\x18\x07 \x03(\x0b\x32\x0f.xla.OpMetadata\x12,\n\x0elast_tile_dims\x18\x08 \x03(\x0e\x32\x14.xla.OpSharding.Type\x12\x19\n\x11iota_reshape_dims\x18\t \x03(\x03\x12\x1b\n\x13iota_transpose_perm\x18\n \x03(\x05\x12\x16\n\x0eis_shard_group\x18\x0b \x01(\x08\x12\x16\n\x0eshard_group_id\x18\x0c \x01(\x03\x12\x38\n\x10shard_group_type\x18\r \x01(\x0e\x32\x1e.xla.OpSharding.ShardGroupType\"R\n\x04Type\x12\x0e\n\nREPLICATED\x10\x00\x12\x0b\n\x07MAXIMAL\x10\x01\x12\t\n\x05TUPLE\x10\x02\x12\t\n\x05OTHER\x10\x03\x12\n\n\x06MANUAL\x10\x04\x12\x0b\n\x07UNKNOWN\x10\x05\"\"\n\x0eShardGroupType\x12\x06\n\x02\x41S\x10\x00\x12\x08\n\x04LIKE\x10\x01\"#\n\x0cReplicaGroup\x12\x13\n\x0breplica_ids\x18\x01 \x03(\x03\".\n\x0cSourceTarget\x12\x0e\n\x06source\x18\x01 \x01(\x03\x12\x0e\n\x06target\x18\x02 \x01(\x03\"\x90\x01\n\x0fPrecisionConfig\x12\x39\n\x11operand_precision\x18\x01 \x03(\x0e\x32\x1e.xla.PrecisionConfig.Precision\"B\n\tPrecision\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x00\x12\x08\n\x04HIGH\x10\x01\x12\x0b\n\x07HIGHEST\x10\x02\x12\x11\n\rPACKED_NIBBLE\x10\x03\":\n\x14ParameterReplication\x12\"\n\x1areplicated_at_leaf_buffers\x18\x01 \x03(\x08\"{\n\x16WhileLoopBackendConfig\x12\x44\n\x10known_trip_count\x18\x01 \x01(\x0b\x32*.xla.WhileLoopBackendConfig.KnownTripCount\x1a\x1b\n\x0eKnownTripCount\x12\t\n\x01n\x18\x01 \x01(\x03\"g\n\x15OutputOperandAliasing\x12\x1a\n\x12output_shape_index\x18\x01 \x03(\x03\x12\x15\n\roperand_index\x18\x02 \x01(\x03\x12\x1b\n\x13operand_shape_index\x18\x03 \x03(\x03*\xb7\x02\n\rPrimitiveType\x12\x1a\n\x16PRIMITIVE_TYPE_INVALID\x10\x00\x12\x08\n\x04PRED\x10\x01\x12\x06\n\x02S4\x10\x15\x12\x06\n\x02S8\x10\x02\x12\x07\n\x03S16\x10\x03\x12\x07\n\x03S32\x10\x04\x12\x07\n\x03S64\x10\x05\x12\x06\n\x02U4\x10\x16\x12\x06\n\x02U8\x10\x06\x12\x07\n\x03U16\x10\x07\x12\x07\n\x03U32\x10\x08\x12\x07\n\x03U64\x10\t\x12\x07\n\x03\x46\x31\x36\x10\n\x12\x07\n\x03\x46\x33\x32\x10\x0b\x12\x08\n\x04\x42\x46\x31\x36\x10\x10\x12\x07\n\x03\x46\x36\x34\x10\x0c\x12\n\n\x06\x46\x38\x45\x35M2\x10\x13\x12\x0c\n\x08\x46\x38\x45\x34M3FN\x10\x14\x12\x11\n\rF8E4M3B11FNUZ\x10\x17\x12\x0e\n\nF8E5M2FNUZ\x10\x18\x12\x0e\n\nF8E4M3FNUZ\x10\x19\x12\x07\n\x03\x43\x36\x34\x10\x0f\x12\x08\n\x04\x43\x31\x32\x38\x10\x12\x12\t\n\x05TUPLE\x10\r\x12\x0f\n\x0bOPAQUE_TYPE\x10\x0e\x12\t\n\x05TOKEN\x10\x11*^\n\x0c\x44imLevelType\x12\r\n\tDIM_DENSE\x10\x00\x12\x12\n\x0e\x44IM_COMPRESSED\x10\x01\x12\x11\n\rDIM_SINGLETON\x10\x02\x12\x18\n\x14\x44IM_LOOSE_COMPRESSED\x10\x03*=\n\x0bProfileType\x12\x0b\n\x07INVALID\x10\x00\x12\n\n\x06WINDOW\x10\x01\x12\x08\n\x04\x46LAG\x10\x02\x12\x0b\n\x07INTEGER\x10\x03*j\n\rProfileSource\x12!\n\x1dPROFILE_SOURCE_UNKNOWN_SOURCE\x10\x00\x12\x1b\n\x17PROFILE_SOURCE_EMBEDDED\x10\x01\x12\x19\n\x15PROFILE_SOURCE_REMOTE\x10\x02*\x85\x01\n\x10\x43ompilationEvent\x12#\n\x1f\x43OMPILATION_EVENT_UNKNOWN_EVENT\x10\x00\x12\'\n#COMPILATION_EVENT_FIRST_COMPILATION\x10\x01\x12#\n\x1f\x43OMPILATION_EVENT_RECOMPILATION\x10\x02*G\n\x0bPaddingType\x12\x13\n\x0fPADDING_INVALID\x10\x00\x12\x11\n\rPADDING_VALID\x10\x01\x12\x10\n\x0cPADDING_SAME\x10\x02*1\n\x07\x46\x66tType\x12\x07\n\x03\x46\x46T\x10\x00\x12\x08\n\x04IFFT\x10\x01\x12\x08\n\x04RFFT\x10\x02\x12\t\n\x05IRFFT\x10\x03*F\n\x12RandomDistribution\x12\x0f\n\x0bRNG_INVALID\x10\x00\x12\x0f\n\x0bRNG_UNIFORM\x10\x01\x12\x0e\n\nRNG_NORMAL\x10\x02*E\n\x0fRandomAlgorithm\x12\x0f\n\x0bRNG_DEFAULT\x10\x00\x12\x11\n\rRNG_THREE_FRY\x10\x01\x12\x0e\n\nRNG_PHILOX\x10\x02\x42\x03\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'xla.xla_data_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\370\001\001' + _OPMETADATA.fields_by_name['profile_type']._options = None + _OPMETADATA.fields_by_name['profile_type']._serialized_options = b'\030\001' + _FRONTENDATTRIBUTES_MAPENTRY._options = None + _FRONTENDATTRIBUTES_MAPENTRY._serialized_options = b'8\001' + _PRIMITIVETYPE._serialized_start=5519 + _PRIMITIVETYPE._serialized_end=5830 + _DIMLEVELTYPE._serialized_start=5832 + _DIMLEVELTYPE._serialized_end=5926 + _PROFILETYPE._serialized_start=5928 + _PROFILETYPE._serialized_end=5989 + _PROFILESOURCE._serialized_start=5991 + _PROFILESOURCE._serialized_end=6097 + _COMPILATIONEVENT._serialized_start=6100 + _COMPILATIONEVENT._serialized_end=6233 + _PADDINGTYPE._serialized_start=6235 + _PADDINGTYPE._serialized_end=6306 + _FFTTYPE._serialized_start=6308 + _FFTTYPE._serialized_end=6357 + _RANDOMDISTRIBUTION._serialized_start=6359 + _RANDOMDISTRIBUTION._serialized_end=6429 + _RANDOMALGORITHM._serialized_start=6431 + _RANDOMALGORITHM._serialized_end=6500 + _PADDINGCONFIG._serialized_start=28 + _PADDINGCONFIG._serialized_end=211 + _PADDINGCONFIG_PADDINGCONFIGDIMENSION._serialized_start=108 + _PADDINGCONFIG_PADDINGCONFIGDIMENSION._serialized_end=211 + _TILEPROTO._serialized_start=213 + _TILEPROTO._serialized_end=244 + _LAYOUTPROTO._serialized_start=247 + _LAYOUTPROTO._serialized_end=727 + _SHAPEPROTO._serialized_start=730 + _SHAPEPROTO._serialized_end=919 + _PROGRAMSHAPEPROTO._serialized_start=921 + _PROGRAMSHAPEPROTO._serialized_end=1035 + _COMPUTATIONSTATS._serialized_start=1037 + _COMPUTATIONSTATS._serialized_end=1105 + _OPMETADATA._serialized_start=1108 + _OPMETADATA._serialized_end=1695 + _OPMETADATA_PROFILEINFO._serialized_start=1516 + _OPMETADATA_PROFILEINFO._serialized_end=1689 + _EXECUTIONPROFILE._serialized_start=1698 + _EXECUTIONPROFILE._serialized_end=1925 + _EXECUTIONHANDLE._serialized_start=1927 + _EXECUTIONHANDLE._serialized_end=1960 + _GLOBALDATAHANDLE._serialized_start=1962 + _GLOBALDATAHANDLE._serialized_end=1996 + _DEVICEHANDLE._serialized_start=1998 + _DEVICEHANDLE._serialized_end=2050 + _CHANNELHANDLE._serialized_start=2053 + _CHANNELHANDLE._serialized_end=2233 + _CHANNELHANDLE_CHANNELTYPE._serialized_start=2132 + _CHANNELHANDLE_CHANNELTYPE._serialized_end=2233 + _DEVICEASSIGNMENTPROTO._serialized_start=2236 + _DEVICEASSIGNMENTPROTO._serialized_end=2433 + _DEVICEASSIGNMENTPROTO_COMPUTATIONDEVICE._serialized_start=2386 + _DEVICEASSIGNMENTPROTO_COMPUTATIONDEVICE._serialized_end=2433 + _LITERALPROTO._serialized_start=2436 + _LITERALPROTO._serialized_end=2888 + _WINDOWDIMENSION._serialized_start=2891 + _WINDOWDIMENSION._serialized_end=3054 + _WINDOW._serialized_start=3056 + _WINDOW._serialized_end=3106 + _GATHERDIMENSIONNUMBERS._serialized_start=3108 + _GATHERDIMENSIONNUMBERS._serialized_end=3234 + _SCATTERDIMENSIONNUMBERS._serialized_start=3237 + _SCATTERDIMENSIONNUMBERS._serialized_end=3384 + _CONVOLUTIONDIMENSIONNUMBERS._serialized_start=3387 + _CONVOLUTIONDIMENSIONNUMBERS._serialized_end=3731 + _DOTDIMENSIONNUMBERS._serialized_start=3734 + _DOTDIMENSIONNUMBERS._serialized_end=3887 + _TRIANGULARSOLVEOPTIONS._serialized_start=3890 + _TRIANGULARSOLVEOPTIONS._serialized_end=4113 + _TRIANGULARSOLVEOPTIONS_TRANSPOSE._serialized_start=4033 + _TRIANGULARSOLVEOPTIONS_TRANSPOSE._serialized_end=4113 + _CHOLESKYOPTIONS._serialized_start=4115 + _CHOLESKYOPTIONS._serialized_end=4147 + _FRONTENDATTRIBUTES._serialized_start=4149 + _FRONTENDATTRIBUTES._serialized_end=4260 + _FRONTENDATTRIBUTES_MAPENTRY._serialized_start=4218 + _FRONTENDATTRIBUTES_MAPENTRY._serialized_end=4260 + _STATISTIC._serialized_start=4262 + _STATISTIC._serialized_end=4310 + _STATISTICSVIZ._serialized_start=4312 + _STATISTICSVIZ._serialized_end=4396 + _OPSHARDING._serialized_start=4399 + _OPSHARDING._serialized_end=4994 + _OPSHARDING_TYPE._serialized_start=4876 + _OPSHARDING_TYPE._serialized_end=4958 + _OPSHARDING_SHARDGROUPTYPE._serialized_start=4960 + _OPSHARDING_SHARDGROUPTYPE._serialized_end=4994 + _REPLICAGROUP._serialized_start=4996 + _REPLICAGROUP._serialized_end=5031 + _SOURCETARGET._serialized_start=5033 + _SOURCETARGET._serialized_end=5079 + _PRECISIONCONFIG._serialized_start=5082 + _PRECISIONCONFIG._serialized_end=5226 + _PRECISIONCONFIG_PRECISION._serialized_start=5160 + _PRECISIONCONFIG_PRECISION._serialized_end=5226 + _PARAMETERREPLICATION._serialized_start=5228 + _PARAMETERREPLICATION._serialized_end=5286 + _WHILELOOPBACKENDCONFIG._serialized_start=5288 + _WHILELOOPBACKENDCONFIG._serialized_end=5411 + _WHILELOOPBACKENDCONFIG_KNOWNTRIPCOUNT._serialized_start=5384 + _WHILELOOPBACKENDCONFIG_KNOWNTRIPCOUNT._serialized_end=5411 + _OUTPUTOPERANDALIASING._serialized_start=5413 + _OUTPUTOPERANDALIASING._serialized_end=5516 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/config/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/config/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/config/flags.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/config/flags.py new file mode 100644 index 0000000000000000000000000000000000000000..fcc1196e45d666564f1cc63f9ac8740b2e55e916 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/config/flags.py @@ -0,0 +1,29 @@ +# Copyright 2022 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. +# ============================================================================== +"""Code to enable/disable feature flags.""" + +# pylint: disable=invalid-import-order, g-bad-import-order, unused-import +from tensorflow.python import pywrap_tensorflow +from tensorflow.python import flags_pybind + + +FLAGS = None + + +def config(): + global FLAGS + if FLAGS is None: + FLAGS = flags_pybind.Flags() + return FLAGS diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/debug/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/debug/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/debug/debug_service_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/debug/debug_service_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..bf3922fbfefae1ed2d700cd68374bbcd01593051 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/debug/debug_service_pb2.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/debug/debug_service.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2 +from tensorflow.core.profiler import tfprof_log_pb2 as tensorflow_dot_core_dot_profiler_dot_tfprof__log__pb2 +from tensorflow.core.protobuf import debug_pb2 as tensorflow_dot_core_dot_protobuf_dot_debug__pb2 +from tensorflow.core.util import event_pb2 as tensorflow_dot_core_dot_util_dot_event__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n)tensorflow/core/debug/debug_service.proto\x12\ntensorflow\x1a&tensorflow/core/framework/tensor.proto\x1a)tensorflow/core/profiler/tfprof_log.proto\x1a$tensorflow/core/protobuf/debug.proto\x1a tensorflow/core/util/event.proto\"\xde\x02\n\nEventReply\x12I\n\x16\x64\x65\x62ug_op_state_changes\x18\x01 \x03(\x0b\x32).tensorflow.EventReply.DebugOpStateChange\x12\'\n\x06tensor\x18\x02 \x01(\x0b\x32\x17.tensorflow.TensorProto\x1a\xdb\x01\n\x12\x44\x65\x62ugOpStateChange\x12>\n\x05state\x18\x01 \x01(\x0e\x32/.tensorflow.EventReply.DebugOpStateChange.State\x12\x11\n\tnode_name\x18\x02 \x01(\t\x12\x13\n\x0boutput_slot\x18\x03 \x01(\x05\x12\x10\n\x08\x64\x65\x62ug_op\x18\x04 \x01(\t\"K\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\r\n\tREAD_ONLY\x10\x02\x12\x0e\n\nREAD_WRITE\x10\x03\"\xa7\x03\n\rCallTraceback\x12\x35\n\tcall_type\x18\x01 \x01(\x0e\x32\".tensorflow.CallTraceback.CallType\x12\x10\n\x08\x63\x61ll_key\x18\x02 \x01(\t\x12\x30\n\x0corigin_stack\x18\x03 \x01(\x0b\x32\x1a.tensorflow.tfprof.CodeDef\x12L\n\x13origin_id_to_string\x18\x04 \x03(\x0b\x32/.tensorflow.CallTraceback.OriginIdToStringEntry\x12\x36\n\x0fgraph_traceback\x18\x05 \x01(\x0b\x32\x1d.tensorflow.tfprof.OpLogProto\x12\x15\n\rgraph_version\x18\x06 \x01(\x03\x1a\x37\n\x15OriginIdToStringEntry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"E\n\x08\x43\x61llType\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x13\n\x0fGRAPH_EXECUTION\x10\x01\x12\x13\n\x0f\x45\x41GER_EXECUTION\x10\x02\x32\xdd\x01\n\rEventListener\x12;\n\nSendEvents\x12\x11.tensorflow.Event\x1a\x16.tensorflow.EventReply(\x01\x30\x01\x12\x43\n\x0eSendTracebacks\x12\x19.tensorflow.CallTraceback\x1a\x16.tensorflow.EventReply\x12J\n\x0fSendSourceFiles\x12\x1f.tensorflow.DebuggedSourceFiles\x1a\x16.tensorflow.EventReplyb\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.debug.debug_service_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + _CALLTRACEBACK_ORIGINIDTOSTRINGENTRY._options = None + _CALLTRACEBACK_ORIGINIDTOSTRINGENTRY._serialized_options = b'8\001' + _EVENTREPLY._serialized_start=213 + _EVENTREPLY._serialized_end=563 + _EVENTREPLY_DEBUGOPSTATECHANGE._serialized_start=344 + _EVENTREPLY_DEBUGOPSTATECHANGE._serialized_end=563 + _EVENTREPLY_DEBUGOPSTATECHANGE_STATE._serialized_start=488 + _EVENTREPLY_DEBUGOPSTATECHANGE_STATE._serialized_end=563 + _CALLTRACEBACK._serialized_start=566 + _CALLTRACEBACK._serialized_end=989 + _CALLTRACEBACK_ORIGINIDTOSTRINGENTRY._serialized_start=863 + _CALLTRACEBACK_ORIGINIDTOSTRINGENTRY._serialized_end=918 + _CALLTRACEBACK_CALLTYPE._serialized_start=920 + _CALLTRACEBACK_CALLTYPE._serialized_end=989 + _EVENTLISTENER._serialized_start=992 + _EVENTLISTENER._serialized_end=1213 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/debug/debug_service_pb2_grpc.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/debug/debug_service_pb2_grpc.py new file mode 100644 index 0000000000000000000000000000000000000000..d8b581395ba8fc611ceb819a5b639d541520c81a --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/debug/debug_service_pb2_grpc.py @@ -0,0 +1,90 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc + +from tensorflow.core.debug import debug_service_pb2 as tensorflow_dot_core_dot_debug_dot_debug__service__pb2 +from tensorflow.core.protobuf import debug_pb2 as tensorflow_dot_core_dot_protobuf_dot_debug__pb2 +from tensorflow.core.util import event_pb2 as tensorflow_dot_core_dot_util_dot_event__pb2 + + +class EventListenerStub(object): + """EventListener: Receives Event protos, e.g., from debugged TensorFlow + runtime(s). + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.SendEvents = channel.stream_stream( + '/tensorflow.EventListener/SendEvents', + request_serializer=tensorflow_dot_core_dot_util_dot_event__pb2.Event.SerializeToString, + response_deserializer=tensorflow_dot_core_dot_debug_dot_debug__service__pb2.EventReply.FromString, + ) + self.SendTracebacks = channel.unary_unary( + '/tensorflow.EventListener/SendTracebacks', + request_serializer=tensorflow_dot_core_dot_debug_dot_debug__service__pb2.CallTraceback.SerializeToString, + response_deserializer=tensorflow_dot_core_dot_debug_dot_debug__service__pb2.EventReply.FromString, + ) + self.SendSourceFiles = channel.unary_unary( + '/tensorflow.EventListener/SendSourceFiles', + request_serializer=tensorflow_dot_core_dot_protobuf_dot_debug__pb2.DebuggedSourceFiles.SerializeToString, + response_deserializer=tensorflow_dot_core_dot_debug_dot_debug__service__pb2.EventReply.FromString, + ) + + +class EventListenerServicer(object): + """EventListener: Receives Event protos, e.g., from debugged TensorFlow + runtime(s). + """ + + def SendEvents(self, request_iterator, context): + """Client(s) can use this RPC method to send the EventListener Event protos. + The Event protos can hold information such as: + 1) intermediate tensors from a debugged graph being executed, which can + be sent from DebugIdentity ops configured with grpc URLs. + 2) GraphDefs of partition graphs, which can be sent from special debug + ops that get executed immediately after the beginning of the graph + execution. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def SendTracebacks(self, request, context): + """Send the tracebacks of a TensorFlow execution call. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def SendSourceFiles(self, request, context): + """Send a collection of source code files being debugged. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_EventListenerServicer_to_server(servicer, server): + rpc_method_handlers = { + 'SendEvents': grpc.stream_stream_rpc_method_handler( + servicer.SendEvents, + request_deserializer=tensorflow_dot_core_dot_util_dot_event__pb2.Event.FromString, + response_serializer=tensorflow_dot_core_dot_debug_dot_debug__service__pb2.EventReply.SerializeToString, + ), + 'SendTracebacks': grpc.unary_unary_rpc_method_handler( + servicer.SendTracebacks, + request_deserializer=tensorflow_dot_core_dot_debug_dot_debug__service__pb2.CallTraceback.FromString, + response_serializer=tensorflow_dot_core_dot_debug_dot_debug__service__pb2.EventReply.SerializeToString, + ), + 'SendSourceFiles': grpc.unary_unary_rpc_method_handler( + servicer.SendSourceFiles, + request_deserializer=tensorflow_dot_core_dot_protobuf_dot_debug__pb2.DebuggedSourceFiles.FromString, + response_serializer=tensorflow_dot_core_dot_debug_dot_debug__service__pb2.EventReply.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'tensorflow.EventListener', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/debug/debugger_event_metadata_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/debug/debugger_event_metadata_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..0cb7ef73c95d41af3ceed1deacc96b4bf3c6d850 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/debug/debugger_event_metadata_pb2.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/debug/debugger_event_metadata.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n3tensorflow/core/debug/debugger_event_metadata.proto\x12!third_party.tensorflow.core.debug\"e\n\x15\x44\x65\x62uggerEventMetadata\x12\x0e\n\x06\x64\x65vice\x18\x01 \x01(\t\x12\x13\n\x0boutput_slot\x18\x02 \x01(\x05\x12\x12\n\nnum_chunks\x18\x03 \x01(\x05\x12\x13\n\x0b\x63hunk_index\x18\x04 \x01(\x05\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.debug.debugger_event_metadata_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + _DEBUGGEREVENTMETADATA._serialized_start=90 + _DEBUGGEREVENTMETADATA._serialized_end=191 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/distributed_runtime/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/distributed_runtime/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/distributed_runtime/preemption/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/distributed_runtime/preemption/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/distributed_runtime/preemption/gen_check_preemption_op.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/distributed_runtime/preemption/gen_check_preemption_op.py new file mode 100644 index 0000000000000000000000000000000000000000..a54433a5f24a057fd3ad08bc071fea487def0ba6 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/distributed_runtime/preemption/gen_check_preemption_op.py @@ -0,0 +1,101 @@ +"""Python wrappers around TensorFlow ops. + +This file is MACHINE GENERATED! Do not edit. +""" + +import collections + +from tensorflow.python import pywrap_tfe as pywrap_tfe +from tensorflow.python.eager import context as _context +from tensorflow.python.eager import core as _core +from tensorflow.python.eager import execute as _execute +from tensorflow.python.framework import dtypes as _dtypes +from tensorflow.security.fuzzing.py import annotation_types as _atypes + +from tensorflow.python.framework import op_def_registry as _op_def_registry +from tensorflow.python.framework import ops as _ops +from tensorflow.python.framework import op_def_library as _op_def_library +from tensorflow.python.util.deprecation import deprecated_endpoints +from tensorflow.python.util import dispatch as _dispatch +from tensorflow.python.util.tf_export import tf_export + +from typing import TypeVar, List, Any +from typing_extensions import Annotated + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('check_preemption') +def check_preemption(preemption_key:str="TF_DEFAULT_PREEMPTION_NOTICE_KEY", name=None): + r"""Check if a preemption notice has been received in coordination service. + + Args: + preemption_key: An optional `string`. Defaults to `"TF_DEFAULT_PREEMPTION_NOTICE_KEY"`. + Key for preemption check in coordination service. + name: A name for the operation (optional). + + Returns: + The created Operation. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "CheckPreemption", name, "preemption_key", preemption_key) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_check_preemption( + (preemption_key, name,), None) + if _result is not NotImplemented: + return _result + return check_preemption_eager_fallback( + preemption_key=preemption_key, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + check_preemption, (), dict(preemption_key=preemption_key, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_check_preemption( + (preemption_key, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + if preemption_key is None: + preemption_key = "TF_DEFAULT_PREEMPTION_NOTICE_KEY" + preemption_key = _execute.make_str(preemption_key, "preemption_key") + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "CheckPreemption", preemption_key=preemption_key, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + check_preemption, (), dict(preemption_key=preemption_key, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + return _op +CheckPreemption = tf_export("raw_ops.CheckPreemption")(_ops.to_raw_op(check_preemption)) +_dispatcher_for_check_preemption = check_preemption._tf_type_based_dispatcher.Dispatch + + +def check_preemption_eager_fallback(preemption_key: str, name, ctx): + if preemption_key is None: + preemption_key = "TF_DEFAULT_PREEMPTION_NOTICE_KEY" + preemption_key = _execute.make_str(preemption_key, "preemption_key") + _inputs_flat = [] + _attrs = ("preemption_key", preemption_key) + _result = _execute.execute(b"CheckPreemption", 0, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + _result = None + return _result + diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/example/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/example/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/example/example_parser_configuration_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/example/example_parser_configuration_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..ed745269a92ef05ebdd8ddbbc109fdd4fc96eec2 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/example/example_parser_configuration_pb2.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/example/example_parser_configuration.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2 +from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2 +from tensorflow.core.framework import types_pb2 as tensorflow_dot_core_dot_framework_dot_types__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n:tensorflow/core/example/example_parser_configuration.proto\x12\ntensorflow\x1a&tensorflow/core/framework/tensor.proto\x1a,tensorflow/core/framework/tensor_shape.proto\x1a%tensorflow/core/framework/types.proto\"\xa3\x01\n\x12VarLenFeatureProto\x12#\n\x05\x64type\x18\x01 \x01(\x0e\x32\x14.tensorflow.DataType\x12!\n\x19values_output_tensor_name\x18\x02 \x01(\t\x12\"\n\x1aindices_output_tensor_name\x18\x03 \x01(\t\x12!\n\x19shapes_output_tensor_name\x18\x04 \x01(\t\"\xbb\x01\n\x14\x46ixedLenFeatureProto\x12#\n\x05\x64type\x18\x01 \x01(\x0e\x32\x14.tensorflow.DataType\x12+\n\x05shape\x18\x02 \x01(\x0b\x32\x1c.tensorflow.TensorShapeProto\x12.\n\rdefault_value\x18\x03 \x01(\x0b\x32\x17.tensorflow.TensorProto\x12!\n\x19values_output_tensor_name\x18\x04 \x01(\t\"\x9a\x01\n\x14\x46\x65\x61tureConfiguration\x12=\n\x11\x66ixed_len_feature\x18\x01 \x01(\x0b\x32 .tensorflow.FixedLenFeatureProtoH\x00\x12\x39\n\x0fvar_len_feature\x18\x02 \x01(\x0b\x32\x1e.tensorflow.VarLenFeatureProtoH\x00\x42\x08\n\x06\x63onfig\"\xbe\x01\n\x1a\x45xampleParserConfiguration\x12K\n\x0b\x66\x65\x61ture_map\x18\x01 \x03(\x0b\x32\x36.tensorflow.ExampleParserConfiguration.FeatureMapEntry\x1aS\n\x0f\x46\x65\x61tureMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12/\n\x05value\x18\x02 \x01(\x0b\x32 .tensorflow.FeatureConfiguration:\x02\x38\x01\x42\xa2\x01\n\x16org.tensorflow.exampleB ExampleParserConfigurationProtosP\x01Zagithub.com/tensorflow/tensorflow/tensorflow/go/core/example/example_parser_configuration_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.example.example_parser_configuration_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\026org.tensorflow.exampleB ExampleParserConfigurationProtosP\001Zagithub.com/tensorflow/tensorflow/tensorflow/go/core/example/example_parser_configuration_go_proto\370\001\001' + _EXAMPLEPARSERCONFIGURATION_FEATUREMAPENTRY._options = None + _EXAMPLEPARSERCONFIGURATION_FEATUREMAPENTRY._serialized_options = b'8\001' + _VARLENFEATUREPROTO._serialized_start=200 + _VARLENFEATUREPROTO._serialized_end=363 + _FIXEDLENFEATUREPROTO._serialized_start=366 + _FIXEDLENFEATUREPROTO._serialized_end=553 + _FEATURECONFIGURATION._serialized_start=556 + _FEATURECONFIGURATION._serialized_end=710 + _EXAMPLEPARSERCONFIGURATION._serialized_start=713 + _EXAMPLEPARSERCONFIGURATION._serialized_end=903 + _EXAMPLEPARSERCONFIGURATION_FEATUREMAPENTRY._serialized_start=820 + _EXAMPLEPARSERCONFIGURATION_FEATUREMAPENTRY._serialized_end=903 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/example/example_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/example/example_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..061a7496259f0c72c8e691ff7244a0105ea218b8 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/example/example_pb2.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/example/example.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.example import feature_pb2 as tensorflow_dot_core_dot_example_dot_feature__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n%tensorflow/core/example/example.proto\x12\ntensorflow\x1a%tensorflow/core/example/feature.proto\"1\n\x07\x45xample\x12&\n\x08\x66\x65\x61tures\x18\x01 \x01(\x0b\x32\x14.tensorflow.Features\"i\n\x0fSequenceExample\x12%\n\x07\x63ontext\x18\x01 \x01(\x0b\x32\x14.tensorflow.Features\x12/\n\rfeature_lists\x18\x02 \x01(\x0b\x32\x18.tensorflow.FeatureListsB\x81\x01\n\x16org.tensorflow.exampleB\rExampleProtosP\x01ZSgithub.com/tensorflow/tensorflow/tensorflow/go/core/example/example_protos_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.example.example_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\026org.tensorflow.exampleB\rExampleProtosP\001ZSgithub.com/tensorflow/tensorflow/tensorflow/go/core/example/example_protos_go_proto\370\001\001' + _EXAMPLE._serialized_start=92 + _EXAMPLE._serialized_end=141 + _SEQUENCEEXAMPLE._serialized_start=143 + _SEQUENCEEXAMPLE._serialized_end=248 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/example/feature_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/example/feature_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..e29c9f5af57c1d2b91bfe627058bdc3827544b8d --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/example/feature_pb2.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/example/feature.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n%tensorflow/core/example/feature.proto\x12\ntensorflow\"\x1a\n\tBytesList\x12\r\n\x05value\x18\x01 \x03(\x0c\"\x1e\n\tFloatList\x12\x11\n\x05value\x18\x01 \x03(\x02\x42\x02\x10\x01\"\x1e\n\tInt64List\x12\x11\n\x05value\x18\x01 \x03(\x03\x42\x02\x10\x01\"\x98\x01\n\x07\x46\x65\x61ture\x12+\n\nbytes_list\x18\x01 \x01(\x0b\x32\x15.tensorflow.BytesListH\x00\x12+\n\nfloat_list\x18\x02 \x01(\x0b\x32\x15.tensorflow.FloatListH\x00\x12+\n\nint64_list\x18\x03 \x01(\x0b\x32\x15.tensorflow.Int64ListH\x00\x42\x06\n\x04kind\"\x83\x01\n\x08\x46\x65\x61tures\x12\x32\n\x07\x66\x65\x61ture\x18\x01 \x03(\x0b\x32!.tensorflow.Features.FeatureEntry\x1a\x43\n\x0c\x46\x65\x61tureEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\"\n\x05value\x18\x02 \x01(\x0b\x32\x13.tensorflow.Feature:\x02\x38\x01\"3\n\x0b\x46\x65\x61tureList\x12$\n\x07\x66\x65\x61ture\x18\x01 \x03(\x0b\x32\x13.tensorflow.Feature\"\x9c\x01\n\x0c\x46\x65\x61tureLists\x12?\n\x0c\x66\x65\x61ture_list\x18\x01 \x03(\x0b\x32).tensorflow.FeatureLists.FeatureListEntry\x1aK\n\x10\x46\x65\x61tureListEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.tensorflow.FeatureList:\x02\x38\x01\x42\x81\x01\n\x16org.tensorflow.exampleB\rFeatureProtosP\x01ZSgithub.com/tensorflow/tensorflow/tensorflow/go/core/example/example_protos_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.example.feature_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\026org.tensorflow.exampleB\rFeatureProtosP\001ZSgithub.com/tensorflow/tensorflow/tensorflow/go/core/example/example_protos_go_proto\370\001\001' + _FLOATLIST.fields_by_name['value']._options = None + _FLOATLIST.fields_by_name['value']._serialized_options = b'\020\001' + _INT64LIST.fields_by_name['value']._options = None + _INT64LIST.fields_by_name['value']._serialized_options = b'\020\001' + _FEATURES_FEATUREENTRY._options = None + _FEATURES_FEATUREENTRY._serialized_options = b'8\001' + _FEATURELISTS_FEATURELISTENTRY._options = None + _FEATURELISTS_FEATURELISTENTRY._serialized_options = b'8\001' + _BYTESLIST._serialized_start=53 + _BYTESLIST._serialized_end=79 + _FLOATLIST._serialized_start=81 + _FLOATLIST._serialized_end=111 + _INT64LIST._serialized_start=113 + _INT64LIST._serialized_end=143 + _FEATURE._serialized_start=146 + _FEATURE._serialized_end=298 + _FEATURES._serialized_start=301 + _FEATURES._serialized_end=432 + _FEATURES_FEATUREENTRY._serialized_start=365 + _FEATURES_FEATUREENTRY._serialized_end=432 + _FEATURELIST._serialized_start=434 + _FEATURELIST._serialized_end=485 + _FEATURELISTS._serialized_start=488 + _FEATURELISTS._serialized_end=644 + _FEATURELISTS_FEATURELISTENTRY._serialized_start=569 + _FEATURELISTS_FEATURELISTENTRY._serialized_end=644 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/allocation_description_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/allocation_description_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..d2b3d8b4b5f56f4e613af0c1ffed77c1118368fa --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/allocation_description_pb2.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/framework/allocation_description.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n6tensorflow/core/framework/allocation_description.proto\x12\ntensorflow\"\xa3\x01\n\x15\x41llocationDescription\x12\x17\n\x0frequested_bytes\x18\x01 \x01(\x03\x12\x17\n\x0f\x61llocated_bytes\x18\x02 \x01(\x03\x12\x16\n\x0e\x61llocator_name\x18\x03 \x01(\t\x12\x15\n\rallocation_id\x18\x04 \x01(\x03\x12\x1c\n\x14has_single_reference\x18\x05 \x01(\x08\x12\x0b\n\x03ptr\x18\x06 \x01(\x04\x42\x9b\x01\n\x18org.tensorflow.frameworkB\x1b\x41llocationDescriptionProtosP\x01Z]github.com/tensorflow/tensorflow/tensorflow/go/core/framework/allocation_description_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.framework.allocation_description_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\033AllocationDescriptionProtosP\001Z]github.com/tensorflow/tensorflow/tensorflow/go/core/framework/allocation_description_go_proto\370\001\001' + _ALLOCATIONDESCRIPTION._serialized_start=71 + _ALLOCATIONDESCRIPTION._serialized_end=234 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/api_def_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/api_def_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..429e8bf96ea5e916bb7948352b4b8492753964fa --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/api_def_pb2.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/framework/api_def.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\'tensorflow/core/framework/api_def.proto\x12\ntensorflow\x1a*tensorflow/core/framework/attr_value.proto\"\xe1\x05\n\x06\x41piDef\x12\x15\n\rgraph_op_name\x18\x01 \x01(\t\x12\x1b\n\x13\x64\x65precation_message\x18\x0c \x01(\t\x12\x1b\n\x13\x64\x65precation_version\x18\r \x01(\x05\x12\x31\n\nvisibility\x18\x02 \x01(\x0e\x32\x1d.tensorflow.ApiDef.Visibility\x12-\n\x08\x65ndpoint\x18\x03 \x03(\x0b\x32\x1b.tensorflow.ApiDef.Endpoint\x12&\n\x06in_arg\x18\x04 \x03(\x0b\x32\x16.tensorflow.ApiDef.Arg\x12\'\n\x07out_arg\x18\x05 \x03(\x0b\x32\x16.tensorflow.ApiDef.Arg\x12\x11\n\targ_order\x18\x0b \x03(\t\x12%\n\x04\x61ttr\x18\x06 \x03(\x0b\x32\x17.tensorflow.ApiDef.Attr\x12\x0f\n\x07summary\x18\x07 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x08 \x01(\t\x12\x1a\n\x12\x64\x65scription_prefix\x18\t \x01(\t\x12\x1a\n\x12\x64\x65scription_suffix\x18\n \x01(\t\x1aI\n\x08\x45ndpoint\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\ndeprecated\x18\x03 \x01(\x08\x12\x1b\n\x13\x64\x65precation_version\x18\x04 \x01(\x05\x1a;\n\x03\x41rg\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\trename_to\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x1aj\n\x04\x41ttr\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\trename_to\x18\x02 \x01(\t\x12,\n\rdefault_value\x18\x03 \x01(\x0b\x32\x15.tensorflow.AttrValue\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\"G\n\nVisibility\x12\x16\n\x12\x44\x45\x46\x41ULT_VISIBILITY\x10\x00\x12\x0b\n\x07VISIBLE\x10\x01\x12\x08\n\x04SKIP\x10\x02\x12\n\n\x06HIDDEN\x10\x03\")\n\x07\x41piDefs\x12\x1e\n\x02op\x18\x01 \x03(\x0b\x32\x12.tensorflow.ApiDefB}\n\x18org.tensorflow.frameworkB\x0c\x41piDefProtosP\x01ZNgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/api_def_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.framework.api_def_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\014ApiDefProtosP\001ZNgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/api_def_go_proto\370\001\001' + _APIDEF._serialized_start=100 + _APIDEF._serialized_end=837 + _APIDEF_ENDPOINT._serialized_start=522 + _APIDEF_ENDPOINT._serialized_end=595 + _APIDEF_ARG._serialized_start=597 + _APIDEF_ARG._serialized_end=656 + _APIDEF_ATTR._serialized_start=658 + _APIDEF_ATTR._serialized_end=764 + _APIDEF_VISIBILITY._serialized_start=766 + _APIDEF_VISIBILITY._serialized_end=837 + _APIDEFS._serialized_start=839 + _APIDEFS._serialized_end=880 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/attr_value_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/attr_value_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..65438a7927e30d6dc4d9a2bcd8055bda1d1ce174 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/attr_value_pb2.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/framework/attr_value.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2 +from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2 +from tensorflow.core.framework import types_pb2 as tensorflow_dot_core_dot_framework_dot_types__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*tensorflow/core/framework/attr_value.proto\x12\ntensorflow\x1a&tensorflow/core/framework/tensor.proto\x1a,tensorflow/core/framework/tensor_shape.proto\x1a%tensorflow/core/framework/types.proto\"\xa6\x04\n\tAttrValue\x12\x0b\n\x01s\x18\x02 \x01(\x0cH\x00\x12\x0b\n\x01i\x18\x03 \x01(\x03H\x00\x12\x0b\n\x01\x66\x18\x04 \x01(\x02H\x00\x12\x0b\n\x01\x62\x18\x05 \x01(\x08H\x00\x12$\n\x04type\x18\x06 \x01(\x0e\x32\x14.tensorflow.DataTypeH\x00\x12-\n\x05shape\x18\x07 \x01(\x0b\x32\x1c.tensorflow.TensorShapeProtoH\x00\x12)\n\x06tensor\x18\x08 \x01(\x0b\x32\x17.tensorflow.TensorProtoH\x00\x12/\n\x04list\x18\x01 \x01(\x0b\x32\x1f.tensorflow.AttrValue.ListValueH\x00\x12(\n\x04\x66unc\x18\n \x01(\x0b\x32\x18.tensorflow.NameAttrListH\x00\x12\x15\n\x0bplaceholder\x18\t \x01(\tH\x00\x1a\xe9\x01\n\tListValue\x12\t\n\x01s\x18\x02 \x03(\x0c\x12\r\n\x01i\x18\x03 \x03(\x03\x42\x02\x10\x01\x12\r\n\x01\x66\x18\x04 \x03(\x02\x42\x02\x10\x01\x12\r\n\x01\x62\x18\x05 \x03(\x08\x42\x02\x10\x01\x12&\n\x04type\x18\x06 \x03(\x0e\x32\x14.tensorflow.DataTypeB\x02\x10\x01\x12+\n\x05shape\x18\x07 \x03(\x0b\x32\x1c.tensorflow.TensorShapeProto\x12\'\n\x06tensor\x18\x08 \x03(\x0b\x32\x17.tensorflow.TensorProto\x12&\n\x04\x66unc\x18\t \x03(\x0b\x32\x18.tensorflow.NameAttrListB\x07\n\x05value\"\x92\x01\n\x0cNameAttrList\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x30\n\x04\x61ttr\x18\x02 \x03(\x0b\x32\".tensorflow.NameAttrList.AttrEntry\x1a\x42\n\tAttrEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12$\n\x05value\x18\x02 \x01(\x0b\x32\x15.tensorflow.AttrValue:\x02\x38\x01\x42\x83\x01\n\x18org.tensorflow.frameworkB\x0f\x41ttrValueProtosP\x01ZQgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/attr_value_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.framework.attr_value_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\017AttrValueProtosP\001ZQgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/attr_value_go_proto\370\001\001' + _ATTRVALUE_LISTVALUE.fields_by_name['i']._options = None + _ATTRVALUE_LISTVALUE.fields_by_name['i']._serialized_options = b'\020\001' + _ATTRVALUE_LISTVALUE.fields_by_name['f']._options = None + _ATTRVALUE_LISTVALUE.fields_by_name['f']._serialized_options = b'\020\001' + _ATTRVALUE_LISTVALUE.fields_by_name['b']._options = None + _ATTRVALUE_LISTVALUE.fields_by_name['b']._serialized_options = b'\020\001' + _ATTRVALUE_LISTVALUE.fields_by_name['type']._options = None + _ATTRVALUE_LISTVALUE.fields_by_name['type']._serialized_options = b'\020\001' + _NAMEATTRLIST_ATTRENTRY._options = None + _NAMEATTRLIST_ATTRENTRY._serialized_options = b'8\001' + _ATTRVALUE._serialized_start=184 + _ATTRVALUE._serialized_end=734 + _ATTRVALUE_LISTVALUE._serialized_start=492 + _ATTRVALUE_LISTVALUE._serialized_end=725 + _NAMEATTRLIST._serialized_start=737 + _NAMEATTRLIST._serialized_end=883 + _NAMEATTRLIST_ATTRENTRY._serialized_start=817 + _NAMEATTRLIST_ATTRENTRY._serialized_end=883 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/cost_graph_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/cost_graph_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..687a4ea3d711ffb58623838ad3206a21b50ddbe7 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/cost_graph_pb2.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/framework/cost_graph.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2 +from tensorflow.core.framework import types_pb2 as tensorflow_dot_core_dot_framework_dot_types__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*tensorflow/core/framework/cost_graph.proto\x12\ntensorflow\x1a,tensorflow/core/framework/tensor_shape.proto\x1a%tensorflow/core/framework/types.proto\"\xca\x06\n\x0c\x43ostGraphDef\x12+\n\x04node\x18\x01 \x03(\x0b\x32\x1d.tensorflow.CostGraphDef.Node\x12\x35\n\x04\x63ost\x18\x02 \x03(\x0b\x32\'.tensorflow.CostGraphDef.AggregatedCost\x1a\xa2\x05\n\x04Node\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06\x64\x65vice\x18\x02 \x01(\t\x12\n\n\x02id\x18\x03 \x01(\x05\x12;\n\ninput_info\x18\x04 \x03(\x0b\x32\'.tensorflow.CostGraphDef.Node.InputInfo\x12=\n\x0boutput_info\x18\x05 \x03(\x0b\x32(.tensorflow.CostGraphDef.Node.OutputInfo\x12\x1d\n\x15temporary_memory_size\x18\x06 \x01(\x03\x12\x1e\n\x16persistent_memory_size\x18\x0c \x01(\x03\x12!\n\x15host_temp_memory_size\x18\n \x01(\x03\x42\x02\x18\x01\x12#\n\x17\x64\x65vice_temp_memory_size\x18\x0b \x01(\x03\x42\x02\x18\x01\x12)\n\x1d\x64\x65vice_persistent_memory_size\x18\x10 \x01(\x03\x42\x02\x18\x01\x12\x14\n\x0c\x63ompute_cost\x18\t \x01(\x03\x12\x14\n\x0c\x63ompute_time\x18\x0e \x01(\x03\x12\x13\n\x0bmemory_time\x18\x0f \x01(\x03\x12\x10\n\x08is_final\x18\x07 \x01(\x08\x12\x15\n\rcontrol_input\x18\x08 \x03(\x05\x12\x12\n\ninaccurate\x18\x11 \x01(\x08\x1a;\n\tInputInfo\x12\x16\n\x0epreceding_node\x18\x01 \x01(\x05\x12\x16\n\x0epreceding_port\x18\x02 \x01(\x05\x1a\x86\x01\n\nOutputInfo\x12\x0c\n\x04size\x18\x01 \x01(\x03\x12\x18\n\x10\x61lias_input_port\x18\x02 \x01(\x03\x12+\n\x05shape\x18\x03 \x01(\x0b\x32\x1c.tensorflow.TensorShapeProto\x12#\n\x05\x64type\x18\x04 \x01(\x0e\x32\x14.tensorflow.DataType\x1a\x31\n\x0e\x41ggregatedCost\x12\x0c\n\x04\x63ost\x18\x01 \x01(\x02\x12\x11\n\tdimension\x18\x02 \x01(\tB\x83\x01\n\x18org.tensorflow.frameworkB\x0f\x43ostGraphProtosP\x01ZQgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/cost_graph_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.framework.cost_graph_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\017CostGraphProtosP\001ZQgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/cost_graph_go_proto\370\001\001' + _COSTGRAPHDEF_NODE.fields_by_name['host_temp_memory_size']._options = None + _COSTGRAPHDEF_NODE.fields_by_name['host_temp_memory_size']._serialized_options = b'\030\001' + _COSTGRAPHDEF_NODE.fields_by_name['device_temp_memory_size']._options = None + _COSTGRAPHDEF_NODE.fields_by_name['device_temp_memory_size']._serialized_options = b'\030\001' + _COSTGRAPHDEF_NODE.fields_by_name['device_persistent_memory_size']._options = None + _COSTGRAPHDEF_NODE.fields_by_name['device_persistent_memory_size']._serialized_options = b'\030\001' + _COSTGRAPHDEF._serialized_start=144 + _COSTGRAPHDEF._serialized_end=986 + _COSTGRAPHDEF_NODE._serialized_start=261 + _COSTGRAPHDEF_NODE._serialized_end=935 + _COSTGRAPHDEF_NODE_INPUTINFO._serialized_start=739 + _COSTGRAPHDEF_NODE_INPUTINFO._serialized_end=798 + _COSTGRAPHDEF_NODE_OUTPUTINFO._serialized_start=801 + _COSTGRAPHDEF_NODE_OUTPUTINFO._serialized_end=935 + _COSTGRAPHDEF_AGGREGATEDCOST._serialized_start=937 + _COSTGRAPHDEF_AGGREGATEDCOST._serialized_end=986 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/cpp_shape_inference_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/cpp_shape_inference_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..bc39af2d1d576c4c15b5289c38eba5041ffcd5a1 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/cpp_shape_inference_pb2.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/framework/cpp_shape_inference.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import full_type_pb2 as tensorflow_dot_core_dot_framework_dot_full__type__pb2 +from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2 +from tensorflow.core.framework import types_pb2 as tensorflow_dot_core_dot_framework_dot_types__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n3tensorflow/core/framework/cpp_shape_inference.proto\x12\x0ftensorflow.core\x1a)tensorflow/core/framework/full_type.proto\x1a,tensorflow/core/framework/tensor_shape.proto\x1a%tensorflow/core/framework/types.proto\"\xa5\x03\n\x17\x43ppShapeInferenceResult\x12+\n\x05shape\x18\x01 \x01(\x0b\x32\x1c.tensorflow.TensorShapeProto\x12H\n\x0bhandle_data\x18\x04 \x01(\x0b\x32\x33.tensorflow.core.CppShapeInferenceResult.HandleData\x1a\x93\x01\n\x12HandleShapeAndType\x12+\n\x05shape\x18\x01 \x01(\x0b\x32\x1c.tensorflow.TensorShapeProto\x12#\n\x05\x64type\x18\x02 \x01(\x0e\x32\x14.tensorflow.DataType\x12%\n\x04type\x18\x04 \x01(\x0b\x32\x17.tensorflow.FullTypeDefJ\x04\x08\x03\x10\x04\x1aq\n\nHandleData\x12\x0e\n\x06is_set\x18\x01 \x01(\x08\x12S\n\x0eshape_and_type\x18\x02 \x03(\x0b\x32;.tensorflow.core.CppShapeInferenceResult.HandleShapeAndTypeJ\x04\x08\x02\x10\x03J\x04\x08\x03\x10\x04\"e\n\x1d\x43ppShapeInferenceInputsNeeded\x12\x1c\n\x14input_tensors_needed\x18\x01 \x03(\x05\x12&\n\x1einput_tensors_as_shapes_needed\x18\x02 \x03(\x05\x42\x61Z\\github.com/tensorflow/tensorflow/tensorflow/go/python/framework/cpp_shape_inference_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.framework.cpp_shape_inference_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'Z\\github.com/tensorflow/tensorflow/tensorflow/go/python/framework/cpp_shape_inference_go_proto\370\001\001' + _CPPSHAPEINFERENCERESULT._serialized_start=201 + _CPPSHAPEINFERENCERESULT._serialized_end=622 + _CPPSHAPEINFERENCERESULT_HANDLESHAPEANDTYPE._serialized_start=348 + _CPPSHAPEINFERENCERESULT_HANDLESHAPEANDTYPE._serialized_end=495 + _CPPSHAPEINFERENCERESULT_HANDLEDATA._serialized_start=497 + _CPPSHAPEINFERENCERESULT_HANDLEDATA._serialized_end=610 + _CPPSHAPEINFERENCEINPUTSNEEDED._serialized_start=624 + _CPPSHAPEINFERENCEINPUTSNEEDED._serialized_end=725 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/dataset_metadata_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/dataset_metadata_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..9e2c5938b9a6dd319b804339f9dae9f075ba508e --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/dataset_metadata_pb2.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/framework/dataset_metadata.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n0tensorflow/core/framework/dataset_metadata.proto\x12\x0ftensorflow.data\"\x18\n\x08Metadata\x12\x0c\n\x04name\x18\x01 \x01(\x0c\x42YZWgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/dataset_metadata_go_protob\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.framework.dataset_metadata_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'ZWgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/dataset_metadata_go_proto' + _METADATA._serialized_start=69 + _METADATA._serialized_end=93 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/dataset_options_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/dataset_options_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..a32ec10af6dbf90dec0708b545c9b6b75b0f0c55 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/dataset_options_pb2.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/framework/dataset_options.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import model_pb2 as tensorflow_dot_core_dot_framework_dot_model__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n/tensorflow/core/framework/dataset_options.proto\x12\x0ftensorflow.data\x1a%tensorflow/core/framework/model.proto\"\xf9\x01\n\x0f\x41utotuneOptions\x12\x11\n\x07\x65nabled\x18\x01 \x01(\x08H\x00\x12\x14\n\ncpu_budget\x18\x02 \x01(\x05H\x01\x12\x14\n\nram_budget\x18\x03 \x01(\x03H\x02\x12\x46\n\x12\x61utotune_algorithm\x18\x04 \x01(\x0e\x32(.tensorflow.data.model.AutotuneAlgorithmH\x03\x42\x12\n\x10optional_enabledB\x15\n\x13optional_cpu_budgetB\x15\n\x13optional_ram_budgetB\x1d\n\x1boptional_autotune_algorithm\"\xd1\x01\n\x12\x43\x61rdinalityOptions\x12G\n\rcompute_level\x18\x01 \x01(\x0e\x32\x30.tensorflow.data.CardinalityOptions.ComputeLevel\"r\n\x0c\x43omputeLevel\x12#\n\x1f\x43\x41RDINALITY_COMPUTE_UNSPECIFIED\x10\x00\x12\x1b\n\x17\x43\x41RDINALITY_COMPUTE_LOW\x10\x01\x12 \n\x1c\x43\x41RDINALITY_COMPUTE_MODERATE\x10\x02\"\x7f\n\x11\x44istributeOptions\x12;\n\x11\x61uto_shard_policy\x18\x01 \x01(\x0e\x32 .tensorflow.data.AutoShardPolicy\x12\x15\n\x0bnum_devices\x18\x02 \x01(\x05H\x00\x42\x16\n\x14optional_num_devices\"\xf2\x05\n\x13OptimizationOptions\x12%\n\x1b\x61pply_default_optimizations\x18\x01 \x01(\x08H\x00\x12\x17\n\rfilter_fusion\x18\x06 \x01(\x08H\x01\x12\x1e\n\x14map_and_batch_fusion\x18\t \x01(\x08H\x02\x12\x1f\n\x15map_and_filter_fusion\x18\n \x01(\x08H\x03\x12\x14\n\nmap_fusion\x18\x0b \x01(\x08H\x04\x12\x1d\n\x13map_parallelization\x18\x0c \x01(\x08H\x05\x12\x1a\n\x10noop_elimination\x18\x0e \x01(\x08H\x06\x12\x18\n\x0eparallel_batch\x18\x0f \x01(\x08H\x07\x12#\n\x19shuffle_and_repeat_fusion\x18\x11 \x01(\x08H\x08\x12 \n\x16\x66ilter_parallelization\x18\x12 \x01(\x08H\t\x12\x19\n\x0finject_prefetch\x18\x13 \x01(\x08H\nB&\n$optional_apply_default_optimizationsB\x18\n\x16optional_filter_fusionB\x1f\n\x1doptional_map_and_batch_fusionB \n\x1eoptional_map_and_filter_fusionB\x15\n\x13optional_map_fusionB\x1e\n\x1coptional_map_parallelizationB\x1b\n\x19optional_noop_eliminationB\x19\n\x17optional_parallel_batchB$\n\"optional_shuffle_and_repeat_fusionB!\n\x1foptional_filter_parallelizationB\x1a\n\x18optional_inject_prefetchJ\x04\x08\x02\x10\x03J\x04\x08\x03\x10\x04J\x04\x08\x04\x10\x05J\x04\x08\x05\x10\x06J\x04\x08\x07\x10\x08J\x04\x08\x08\x10\tJ\x04\x08\r\x10\x0eJ\x04\x08\x10\x10\x11J\x04\x08\x14\x10\x15\"\xa2\x01\n\x10ThreadingOptions\x12\"\n\x18max_intra_op_parallelism\x18\x01 \x01(\x05H\x00\x12!\n\x17private_threadpool_size\x18\x02 \x01(\x05H\x01\x42#\n!optional_max_intra_op_parallelismB\"\n optional_private_threadpool_size\"\xb2\x04\n\x07Options\x12\x17\n\rdeterministic\x18\x01 \x01(\x08H\x00\x12:\n\x10\x61utotune_options\x18\x07 \x01(\x0b\x32 .tensorflow.data.AutotuneOptions\x12>\n\x12\x64istribute_options\x18\x02 \x01(\x0b\x32\".tensorflow.data.DistributeOptions\x12\x42\n\x14optimization_options\x18\x03 \x01(\x0b\x32$.tensorflow.data.OptimizationOptions\x12\x0f\n\x05slack\x18\x04 \x01(\x08H\x01\x12<\n\x11threading_options\x18\x05 \x01(\x0b\x32!.tensorflow.data.ThreadingOptions\x12\x45\n\x15\x65xternal_state_policy\x18\x06 \x01(\x0e\x32$.tensorflow.data.ExternalStatePolicyH\x02\x12\x1d\n\x13symbolic_checkpoint\x18\x08 \x01(\x08H\x03\x12\x14\n\nwarm_start\x18\t \x01(\x08H\x04\x42\x18\n\x16optional_deterministicB\x10\n\x0eoptional_slackB \n\x1eoptional_external_state_policyB\x1e\n\x1coptional_symbolic_checkpointB\x15\n\x13optional_warm_start*K\n\x0f\x41utoShardPolicy\x12\x08\n\x04\x41UTO\x10\x00\x12\x08\n\x04\x46ILE\x10\x01\x12\x08\n\x04\x44\x41TA\x10\x02\x12\x08\n\x04HINT\x10\x03\x12\x10\n\x03OFF\x10\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01*J\n\x13\x45xternalStatePolicy\x12\x0f\n\x0bPOLICY_WARN\x10\x00\x12\x11\n\rPOLICY_IGNORE\x10\x01\x12\x0f\n\x0bPOLICY_FAIL\x10\x02\x42XZVgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/dataset_options_go_protob\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.framework.dataset_options_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'ZVgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/dataset_options_go_proto' + _AUTOSHARDPOLICY._serialized_start=2187 + _AUTOSHARDPOLICY._serialized_end=2262 + _EXTERNALSTATEPOLICY._serialized_start=2264 + _EXTERNALSTATEPOLICY._serialized_end=2338 + _AUTOTUNEOPTIONS._serialized_start=108 + _AUTOTUNEOPTIONS._serialized_end=357 + _CARDINALITYOPTIONS._serialized_start=360 + _CARDINALITYOPTIONS._serialized_end=569 + _CARDINALITYOPTIONS_COMPUTELEVEL._serialized_start=455 + _CARDINALITYOPTIONS_COMPUTELEVEL._serialized_end=569 + _DISTRIBUTEOPTIONS._serialized_start=571 + _DISTRIBUTEOPTIONS._serialized_end=698 + _OPTIMIZATIONOPTIONS._serialized_start=701 + _OPTIMIZATIONOPTIONS._serialized_end=1455 + _THREADINGOPTIONS._serialized_start=1458 + _THREADINGOPTIONS._serialized_end=1620 + _OPTIONS._serialized_start=1623 + _OPTIONS._serialized_end=2185 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/dataset_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/dataset_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..6651abc2e95bd7825610df26baaee4832b679c55 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/dataset_pb2.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/framework/dataset.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2 +from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2 +from tensorflow.core.framework import types_pb2 as tensorflow_dot_core_dot_framework_dot_types__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\'tensorflow/core/framework/dataset.proto\x12\x0ftensorflow.data\x1a&tensorflow/core/framework/tensor.proto\x1a,tensorflow/core/framework/tensor_shape.proto\x1a%tensorflow/core/framework/types.proto\"\x98\x01\n\x1b\x43ompressedComponentMetadata\x12#\n\x05\x64type\x18\x01 \x01(\x0e\x32\x14.tensorflow.DataType\x12\x32\n\x0ctensor_shape\x18\x02 \x01(\x0b\x32\x1c.tensorflow.TensorShapeProto\x12\x1a\n\x12uncompressed_bytes\x18\x04 \x03(\x04J\x04\x08\x03\x10\x04\"|\n\x11\x43ompressedElement\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x12H\n\x12\x63omponent_metadata\x18\x02 \x03(\x0b\x32,.tensorflow.data.CompressedComponentMetadata\x12\x0f\n\x07version\x18\x03 \x01(\x05\"B\n\x13UncompressedElement\x12+\n\ncomponents\x18\x01 \x03(\x0b\x32\x17.tensorflow.TensorProtoB\x03\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.framework.dataset_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\370\001\001' + _COMPRESSEDCOMPONENTMETADATA._serialized_start=186 + _COMPRESSEDCOMPONENTMETADATA._serialized_end=338 + _COMPRESSEDELEMENT._serialized_start=340 + _COMPRESSEDELEMENT._serialized_end=464 + _UNCOMPRESSEDELEMENT._serialized_start=466 + _UNCOMPRESSEDELEMENT._serialized_end=532 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/device_attributes_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/device_attributes_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..a2f099f3cd4a5a943e8223abaf37f2110d434cb3 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/device_attributes_pb2.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/framework/device_attributes.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n1tensorflow/core/framework/device_attributes.proto\x12\ntensorflow\"E\n\x10InterconnectLink\x12\x11\n\tdevice_id\x18\x01 \x01(\x05\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x10\n\x08strength\x18\x03 \x01(\x05\"8\n\nLocalLinks\x12*\n\x04link\x18\x01 \x03(\x0b\x32\x1c.tensorflow.InterconnectLink\"Z\n\x0e\x44\x65viceLocality\x12\x0e\n\x06\x62us_id\x18\x01 \x01(\x05\x12\x11\n\tnuma_node\x18\x02 \x01(\x05\x12%\n\x05links\x18\x03 \x01(\x0b\x32\x16.tensorflow.LocalLinks\"\xc3\x01\n\x10\x44\x65viceAttributes\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12\x14\n\x0cmemory_limit\x18\x04 \x01(\x03\x12,\n\x08locality\x18\x05 \x01(\x0b\x32\x1a.tensorflow.DeviceLocality\x12\x13\n\x0bincarnation\x18\x06 \x01(\x06\x12\x1c\n\x14physical_device_desc\x18\x07 \x01(\t\x12\x15\n\rxla_global_id\x18\x08 \x01(\x03\x42\x91\x01\n\x18org.tensorflow.frameworkB\x16\x44\x65viceAttributesProtosP\x01ZXgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/device_attributes_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.framework.device_attributes_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\026DeviceAttributesProtosP\001ZXgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/device_attributes_go_proto\370\001\001' + _INTERCONNECTLINK._serialized_start=65 + _INTERCONNECTLINK._serialized_end=134 + _LOCALLINKS._serialized_start=136 + _LOCALLINKS._serialized_end=192 + _DEVICELOCALITY._serialized_start=194 + _DEVICELOCALITY._serialized_end=284 + _DEVICEATTRIBUTES._serialized_start=287 + _DEVICEATTRIBUTES._serialized_end=482 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/full_type_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/full_type_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..ffe019e9a0bf365f977b702bbb15638b911655bd --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/full_type_pb2.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/framework/full_type.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n)tensorflow/core/framework/full_type.proto\x12\ntensorflow\"\x7f\n\x0b\x46ullTypeDef\x12\'\n\x07type_id\x18\x01 \x01(\x0e\x32\x16.tensorflow.FullTypeId\x12%\n\x04\x61rgs\x18\x02 \x03(\x0b\x32\x17.tensorflow.FullTypeDef\x12\x0b\n\x01s\x18\x03 \x01(\tH\x00\x12\x0b\n\x01i\x18\x04 \x01(\x03H\x00\x42\x06\n\x04\x61ttr*\xda\x04\n\nFullTypeId\x12\r\n\tTFT_UNSET\x10\x00\x12\x0b\n\x07TFT_VAR\x10\x01\x12\x0b\n\x07TFT_ANY\x10\x02\x12\x0f\n\x0bTFT_PRODUCT\x10\x03\x12\r\n\tTFT_NAMED\x10\x04\x12\x10\n\x0cTFT_FOR_EACH\x10\x14\x12\x10\n\x0cTFT_CALLABLE\x10\x64\x12\x0f\n\nTFT_TENSOR\x10\xe8\x07\x12\x0e\n\tTFT_ARRAY\x10\xe9\x07\x12\x11\n\x0cTFT_OPTIONAL\x10\xea\x07\x12\x10\n\x0bTFT_LITERAL\x10\xeb\x07\x12\x10\n\x0bTFT_ENCODED\x10\xec\x07\x12\x15\n\x10TFT_SHAPE_TENSOR\x10\xed\x07\x12\r\n\x08TFT_BOOL\x10\xc8\x01\x12\x0e\n\tTFT_UINT8\x10\xc9\x01\x12\x0f\n\nTFT_UINT16\x10\xca\x01\x12\x0f\n\nTFT_UINT32\x10\xcb\x01\x12\x0f\n\nTFT_UINT64\x10\xcc\x01\x12\r\n\x08TFT_INT8\x10\xcd\x01\x12\x0e\n\tTFT_INT16\x10\xce\x01\x12\x0e\n\tTFT_INT32\x10\xcf\x01\x12\x0e\n\tTFT_INT64\x10\xd0\x01\x12\r\n\x08TFT_HALF\x10\xd1\x01\x12\x0e\n\tTFT_FLOAT\x10\xd2\x01\x12\x0f\n\nTFT_DOUBLE\x10\xd3\x01\x12\x11\n\x0cTFT_BFLOAT16\x10\xd7\x01\x12\x12\n\rTFT_COMPLEX64\x10\xd4\x01\x12\x13\n\x0eTFT_COMPLEX128\x10\xd5\x01\x12\x0f\n\nTFT_STRING\x10\xd6\x01\x12\x10\n\x0bTFT_DATASET\x10\xf6N\x12\x0f\n\nTFT_RAGGED\x10\xf7N\x12\x11\n\x0cTFT_ITERATOR\x10\xf8N\x12\x13\n\x0eTFT_MUTEX_LOCK\x10\xdaO\x12\x17\n\x12TFT_LEGACY_VARIANT\x10\xdbOB\x81\x01\n\x18org.tensorflow.frameworkB\x0e\x46ullTypeProtosP\x01ZPgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/full_type_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.framework.full_type_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\016FullTypeProtosP\001ZPgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/full_type_go_proto\370\001\001' + _FULLTYPEID._serialized_start=187 + _FULLTYPEID._serialized_end=789 + _FULLTYPEDEF._serialized_start=57 + _FULLTYPEDEF._serialized_end=184 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/function_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/function_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..d23aa616c3aa86c3a9a6fef0fc9cf0d36530afbc --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/function_pb2.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/framework/function.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2 +from tensorflow.core.framework import node_def_pb2 as tensorflow_dot_core_dot_framework_dot_node__def__pb2 +from tensorflow.core.framework import op_def_pb2 as tensorflow_dot_core_dot_framework_dot_op__def__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(tensorflow/core/framework/function.proto\x12\ntensorflow\x1a*tensorflow/core/framework/attr_value.proto\x1a(tensorflow/core/framework/node_def.proto\x1a&tensorflow/core/framework/op_def.proto\"\xa8\x01\n\x12\x46unctionDefLibrary\x12)\n\x08\x66unction\x18\x01 \x03(\x0b\x32\x17.tensorflow.FunctionDef\x12)\n\x08gradient\x18\x02 \x03(\x0b\x32\x17.tensorflow.GradientDef\x12<\n\x14registered_gradients\x18\x03 \x03(\x0b\x32\x1e.tensorflow.RegisteredGradient\"\xc4\x06\n\x0b\x46unctionDef\x12$\n\tsignature\x18\x01 \x01(\x0b\x32\x11.tensorflow.OpDef\x12/\n\x04\x61ttr\x18\x05 \x03(\x0b\x32!.tensorflow.FunctionDef.AttrEntry\x12\x36\n\x08\x61rg_attr\x18\x07 \x03(\x0b\x32$.tensorflow.FunctionDef.ArgAttrEntry\x12P\n\x16resource_arg_unique_id\x18\x08 \x03(\x0b\x32\x30.tensorflow.FunctionDef.ResourceArgUniqueIdEntry\x12%\n\x08node_def\x18\x03 \x03(\x0b\x32\x13.tensorflow.NodeDef\x12-\n\x03ret\x18\x04 \x03(\x0b\x32 .tensorflow.FunctionDef.RetEntry\x12<\n\x0b\x63ontrol_ret\x18\x06 \x03(\x0b\x32\'.tensorflow.FunctionDef.ControlRetEntry\x1a\x42\n\tAttrEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12$\n\x05value\x18\x02 \x01(\x0b\x32\x15.tensorflow.AttrValue:\x02\x38\x01\x1a\x88\x01\n\x08\x41rgAttrs\x12\x38\n\x04\x61ttr\x18\x01 \x03(\x0b\x32*.tensorflow.FunctionDef.ArgAttrs.AttrEntry\x1a\x42\n\tAttrEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12$\n\x05value\x18\x02 \x01(\x0b\x32\x15.tensorflow.AttrValue:\x02\x38\x01\x1aP\n\x0c\x41rgAttrEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12/\n\x05value\x18\x02 \x01(\x0b\x32 .tensorflow.FunctionDef.ArgAttrs:\x02\x38\x01\x1a:\n\x18ResourceArgUniqueIdEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\r\n\x05value\x18\x02 \x01(\r:\x02\x38\x01\x1a*\n\x08RetEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x31\n\x0f\x43ontrolRetEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01J\x04\x08\x02\x10\x03\";\n\x0bGradientDef\x12\x15\n\rfunction_name\x18\x01 \x01(\t\x12\x15\n\rgradient_func\x18\x02 \x01(\t\"G\n\x12RegisteredGradient\x12\x15\n\rgradient_func\x18\x01 \x01(\t\x12\x1a\n\x12registered_op_type\x18\x02 \x01(\tB\x80\x01\n\x18org.tensorflow.frameworkB\x0e\x46unctionProtosP\x01ZOgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/function_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.framework.function_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\016FunctionProtosP\001ZOgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/function_go_proto\370\001\001' + _FUNCTIONDEF_ATTRENTRY._options = None + _FUNCTIONDEF_ATTRENTRY._serialized_options = b'8\001' + _FUNCTIONDEF_ARGATTRS_ATTRENTRY._options = None + _FUNCTIONDEF_ARGATTRS_ATTRENTRY._serialized_options = b'8\001' + _FUNCTIONDEF_ARGATTRENTRY._options = None + _FUNCTIONDEF_ARGATTRENTRY._serialized_options = b'8\001' + _FUNCTIONDEF_RESOURCEARGUNIQUEIDENTRY._options = None + _FUNCTIONDEF_RESOURCEARGUNIQUEIDENTRY._serialized_options = b'8\001' + _FUNCTIONDEF_RETENTRY._options = None + _FUNCTIONDEF_RETENTRY._serialized_options = b'8\001' + _FUNCTIONDEF_CONTROLRETENTRY._options = None + _FUNCTIONDEF_CONTROLRETENTRY._serialized_options = b'8\001' + _FUNCTIONDEFLIBRARY._serialized_start=183 + _FUNCTIONDEFLIBRARY._serialized_end=351 + _FUNCTIONDEF._serialized_start=354 + _FUNCTIONDEF._serialized_end=1190 + _FUNCTIONDEF_ATTRENTRY._serialized_start=742 + _FUNCTIONDEF_ATTRENTRY._serialized_end=808 + _FUNCTIONDEF_ARGATTRS._serialized_start=811 + _FUNCTIONDEF_ARGATTRS._serialized_end=947 + _FUNCTIONDEF_ARGATTRS_ATTRENTRY._serialized_start=742 + _FUNCTIONDEF_ARGATTRS_ATTRENTRY._serialized_end=808 + _FUNCTIONDEF_ARGATTRENTRY._serialized_start=949 + _FUNCTIONDEF_ARGATTRENTRY._serialized_end=1029 + _FUNCTIONDEF_RESOURCEARGUNIQUEIDENTRY._serialized_start=1031 + _FUNCTIONDEF_RESOURCEARGUNIQUEIDENTRY._serialized_end=1089 + _FUNCTIONDEF_RETENTRY._serialized_start=1091 + _FUNCTIONDEF_RETENTRY._serialized_end=1133 + _FUNCTIONDEF_CONTROLRETENTRY._serialized_start=1135 + _FUNCTIONDEF_CONTROLRETENTRY._serialized_end=1184 + _GRADIENTDEF._serialized_start=1192 + _GRADIENTDEF._serialized_end=1251 + _REGISTEREDGRADIENT._serialized_start=1253 + _REGISTEREDGRADIENT._serialized_end=1324 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/graph_debug_info_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/graph_debug_info_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..6bfaaf2fa92262a19a5308ac2a628a194add4c04 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/graph_debug_info_pb2.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/framework/graph_debug_info.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n0tensorflow/core/framework/graph_debug_info.proto\x12\ntensorflow\"\xa3\x06\n\x0eGraphDebugInfo\x12\r\n\x05\x66iles\x18\x01 \x03(\t\x12@\n\x0c\x66rames_by_id\x18\x04 \x03(\x0b\x32*.tensorflow.GraphDebugInfo.FramesByIdEntry\x12@\n\x0ctraces_by_id\x18\x06 \x03(\x0b\x32*.tensorflow.GraphDebugInfo.TracesByIdEntry\x12\x36\n\x06traces\x18\x02 \x03(\x0b\x32&.tensorflow.GraphDebugInfo.TracesEntry\x12G\n\x10name_to_trace_id\x18\x05 \x03(\x0b\x32-.tensorflow.GraphDebugInfo.NameToTraceIdEntry\x1aX\n\x0b\x46ileLineCol\x12\x12\n\nfile_index\x18\x01 \x01(\x05\x12\x0c\n\x04line\x18\x02 \x01(\x05\x12\x0b\n\x03\x63ol\x18\x03 \x01(\x05\x12\x0c\n\x04\x66unc\x18\x04 \x01(\t\x12\x0c\n\x04\x63ode\x18\x05 \x01(\t\x1a\x62\n\nStackTrace\x12>\n\x0e\x66ile_line_cols\x18\x01 \x03(\x0b\x32&.tensorflow.GraphDebugInfo.FileLineCol\x12\x14\n\x08\x66rame_id\x18\x02 \x03(\x06\x42\x02\x10\x01\x1aY\n\x0f\x46ramesByIdEntry\x12\x0b\n\x03key\x18\x01 \x01(\x06\x12\x35\n\x05value\x18\x02 \x01(\x0b\x32&.tensorflow.GraphDebugInfo.FileLineCol:\x02\x38\x01\x1aX\n\x0fTracesByIdEntry\x12\x0b\n\x03key\x18\x01 \x01(\x06\x12\x34\n\x05value\x18\x02 \x01(\x0b\x32%.tensorflow.GraphDebugInfo.StackTrace:\x02\x38\x01\x1aT\n\x0bTracesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x34\n\x05value\x18\x02 \x01(\x0b\x32%.tensorflow.GraphDebugInfo.StackTrace:\x02\x38\x01\x1a\x34\n\x12NameToTraceIdEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x06:\x02\x38\x01\x42\x8c\x01\n\x18org.tensorflow.frameworkB\x14GraphDebugInfoProtosP\x01ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\xf8\x01\x01') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.framework.graph_debug_info_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\024GraphDebugInfoProtosP\001ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\370\001\001' + _GRAPHDEBUGINFO_STACKTRACE.fields_by_name['frame_id']._options = None + _GRAPHDEBUGINFO_STACKTRACE.fields_by_name['frame_id']._serialized_options = b'\020\001' + _GRAPHDEBUGINFO_FRAMESBYIDENTRY._options = None + _GRAPHDEBUGINFO_FRAMESBYIDENTRY._serialized_options = b'8\001' + _GRAPHDEBUGINFO_TRACESBYIDENTRY._options = None + _GRAPHDEBUGINFO_TRACESBYIDENTRY._serialized_options = b'8\001' + _GRAPHDEBUGINFO_TRACESENTRY._options = None + _GRAPHDEBUGINFO_TRACESENTRY._serialized_options = b'8\001' + _GRAPHDEBUGINFO_NAMETOTRACEIDENTRY._options = None + _GRAPHDEBUGINFO_NAMETOTRACEIDENTRY._serialized_options = b'8\001' + _GRAPHDEBUGINFO._serialized_start=65 + _GRAPHDEBUGINFO._serialized_end=868 + _GRAPHDEBUGINFO_FILELINECOL._serialized_start=359 + _GRAPHDEBUGINFO_FILELINECOL._serialized_end=447 + _GRAPHDEBUGINFO_STACKTRACE._serialized_start=449 + _GRAPHDEBUGINFO_STACKTRACE._serialized_end=547 + _GRAPHDEBUGINFO_FRAMESBYIDENTRY._serialized_start=549 + _GRAPHDEBUGINFO_FRAMESBYIDENTRY._serialized_end=638 + _GRAPHDEBUGINFO_TRACESBYIDENTRY._serialized_start=640 + _GRAPHDEBUGINFO_TRACESBYIDENTRY._serialized_end=728 + _GRAPHDEBUGINFO_TRACESENTRY._serialized_start=730 + _GRAPHDEBUGINFO_TRACESENTRY._serialized_end=814 + _GRAPHDEBUGINFO_NAMETOTRACEIDENTRY._serialized_start=816 + _GRAPHDEBUGINFO_NAMETOTRACEIDENTRY._serialized_end=868 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/graph_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/graph_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..d20b8765eabdf30493580c4c9d29f30487450306 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/graph_pb2.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/framework/graph.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import function_pb2 as tensorflow_dot_core_dot_framework_dot_function__pb2 +from tensorflow.core.framework import graph_debug_info_pb2 as tensorflow_dot_core_dot_framework_dot_graph__debug__info__pb2 +from tensorflow.core.framework import node_def_pb2 as tensorflow_dot_core_dot_framework_dot_node__def__pb2 +from tensorflow.core.framework import versions_pb2 as tensorflow_dot_core_dot_framework_dot_versions__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n%tensorflow/core/framework/graph.proto\x12\ntensorflow\x1a(tensorflow/core/framework/function.proto\x1a\x30tensorflow/core/framework/graph_debug_info.proto\x1a(tensorflow/core/framework/node_def.proto\x1a(tensorflow/core/framework/versions.proto\"\xcd\x01\n\x08GraphDef\x12!\n\x04node\x18\x01 \x03(\x0b\x32\x13.tensorflow.NodeDef\x12(\n\x08versions\x18\x04 \x01(\x0b\x32\x16.tensorflow.VersionDef\x12\x13\n\x07version\x18\x03 \x01(\x05\x42\x02\x18\x01\x12/\n\x07library\x18\x02 \x01(\x0b\x32\x1e.tensorflow.FunctionDefLibrary\x12.\n\ndebug_info\x18\x05 \x01(\x0b\x32\x1a.tensorflow.GraphDebugInfoBz\n\x18org.tensorflow.frameworkB\x0bGraphProtosP\x01ZLgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/graph_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.framework.graph_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\013GraphProtosP\001ZLgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/graph_go_proto\370\001\001' + _GRAPHDEF.fields_by_name['version']._options = None + _GRAPHDEF.fields_by_name['version']._serialized_options = b'\030\001' + _GRAPHDEF._serialized_start=230 + _GRAPHDEF._serialized_end=435 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/graph_transfer_info_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/graph_transfer_info_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..ae304545ce58f8a5492031b430a6db3e44d1e7e0 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/graph_transfer_info_pb2.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/framework/graph_transfer_info.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import types_pb2 as tensorflow_dot_core_dot_framework_dot_types__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n3tensorflow/core/framework/graph_transfer_info.proto\x12\ntensorflow\x1a%tensorflow/core/framework/types.proto\">\n\x16GraphTransferNodeInput\x12\x0f\n\x07node_id\x18\x01 \x01(\x05\x12\x13\n\x0boutput_port\x18\x02 \x01(\x05\"\x9b\x01\n\x15GraphTransferNodeInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\x05\x12\x11\n\ttype_name\x18\x03 \x01(\t\x12\x11\n\tsoc_op_id\x18\x04 \x01(\x05\x12\x12\n\npadding_id\x18\x05 \x01(\x05\x12\x13\n\x0binput_count\x18\x06 \x01(\x05\x12\x14\n\x0coutput_count\x18\x07 \x01(\x05\"}\n\x1aGraphTransferConstNodeInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\x05\x12\r\n\x05shape\x18\x03 \x03(\x03\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\x0c\x12#\n\x05\x64type\x18\x05 \x01(\x0e\x32\x14.tensorflow.DataType\"e\n\x1aGraphTransferNodeInputInfo\x12\x0f\n\x07node_id\x18\x01 \x01(\x05\x12\x36\n\nnode_input\x18\x02 \x03(\x0b\x32\".tensorflow.GraphTransferNodeInput\"E\n\x1bGraphTransferNodeOutputInfo\x12\x0f\n\x07node_id\x18\x01 \x01(\x05\x12\x15\n\rmax_byte_size\x18\x02 \x03(\x05\"c\n\x1fGraphTransferGraphInputNodeInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05shape\x18\x02 \x03(\x03\x12#\n\x05\x64type\x18\x03 \x01(\x0e\x32\x14.tensorflow.DataType\"d\n GraphTransferGraphOutputNodeInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05shape\x18\x02 \x03(\x03\x12#\n\x05\x64type\x18\x03 \x01(\x0e\x32\x14.tensorflow.DataType\"\x8d\x04\n\x11GraphTransferInfo\x12\x34\n\tnode_info\x18\x01 \x03(\x0b\x32!.tensorflow.GraphTransferNodeInfo\x12?\n\x0f\x63onst_node_info\x18\x02 \x03(\x0b\x32&.tensorflow.GraphTransferConstNodeInfo\x12?\n\x0fnode_input_info\x18\x03 \x03(\x0b\x32&.tensorflow.GraphTransferNodeInputInfo\x12\x41\n\x10node_output_info\x18\x04 \x03(\x0b\x32\'.tensorflow.GraphTransferNodeOutputInfo\x12J\n\x15graph_input_node_info\x18\x05 \x03(\x0b\x32+.tensorflow.GraphTransferGraphInputNodeInfo\x12L\n\x16graph_output_node_info\x18\x06 \x03(\x0b\x32,.tensorflow.GraphTransferGraphOutputNodeInfo\x12>\n\x0b\x64\x65stination\x18\x07 \x01(\x0e\x32).tensorflow.GraphTransferInfo.Destination\"#\n\x0b\x44\x65stination\x12\x07\n\x03NOP\x10\x00\x12\x0b\n\x07HEXAGON\x10\x01\x42\x93\x01\n\x18org.tensorflow.frameworkB\x16GraphTransferInfoProtoP\x01ZZgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/graph_transfer_info_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.framework.graph_transfer_info_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\026GraphTransferInfoProtoP\001ZZgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/graph_transfer_info_go_proto\370\001\001' + _GRAPHTRANSFERNODEINPUT._serialized_start=106 + _GRAPHTRANSFERNODEINPUT._serialized_end=168 + _GRAPHTRANSFERNODEINFO._serialized_start=171 + _GRAPHTRANSFERNODEINFO._serialized_end=326 + _GRAPHTRANSFERCONSTNODEINFO._serialized_start=328 + _GRAPHTRANSFERCONSTNODEINFO._serialized_end=453 + _GRAPHTRANSFERNODEINPUTINFO._serialized_start=455 + _GRAPHTRANSFERNODEINPUTINFO._serialized_end=556 + _GRAPHTRANSFERNODEOUTPUTINFO._serialized_start=558 + _GRAPHTRANSFERNODEOUTPUTINFO._serialized_end=627 + _GRAPHTRANSFERGRAPHINPUTNODEINFO._serialized_start=629 + _GRAPHTRANSFERGRAPHINPUTNODEINFO._serialized_end=728 + _GRAPHTRANSFERGRAPHOUTPUTNODEINFO._serialized_start=730 + _GRAPHTRANSFERGRAPHOUTPUTNODEINFO._serialized_end=830 + _GRAPHTRANSFERINFO._serialized_start=833 + _GRAPHTRANSFERINFO._serialized_end=1358 + _GRAPHTRANSFERINFO_DESTINATION._serialized_start=1323 + _GRAPHTRANSFERINFO_DESTINATION._serialized_end=1358 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/kernel_def_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/kernel_def_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..215d45979f67a26a0788b17831f5cbec3a3c2789 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/kernel_def_pb2.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/framework/kernel_def.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*tensorflow/core/framework/kernel_def.proto\x12\ntensorflow\x1a*tensorflow/core/framework/attr_value.proto\"\xef\x01\n\tKernelDef\x12\n\n\x02op\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12\x38\n\nconstraint\x18\x03 \x03(\x0b\x32$.tensorflow.KernelDef.AttrConstraint\x12\x17\n\x0fhost_memory_arg\x18\x04 \x03(\t\x12\r\n\x05label\x18\x05 \x01(\t\x12\x10\n\x08priority\x18\x06 \x01(\x05\x1aM\n\x0e\x41ttrConstraint\x12\x0c\n\x04name\x18\x01 \x01(\t\x12-\n\x0e\x61llowed_values\x18\x02 \x01(\x0b\x32\x15.tensorflow.AttrValue\"3\n\nKernelList\x12%\n\x06kernel\x18\x01 \x03(\x0b\x32\x15.tensorflow.KernelDefB\x83\x01\n\x18org.tensorflow.frameworkB\x0fKernelDefProtosP\x01ZQgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/kernel_def_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.framework.kernel_def_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\017KernelDefProtosP\001ZQgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/kernel_def_go_proto\370\001\001' + _KERNELDEF._serialized_start=103 + _KERNELDEF._serialized_end=342 + _KERNELDEF_ATTRCONSTRAINT._serialized_start=265 + _KERNELDEF_ATTRCONSTRAINT._serialized_end=342 + _KERNELLIST._serialized_start=344 + _KERNELLIST._serialized_end=395 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/log_memory_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/log_memory_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..e1fffcb69a4858282539429d636c99d801186c0f --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/log_memory_pb2.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/framework/log_memory.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import tensor_description_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__description__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*tensorflow/core/framework/log_memory.proto\x12\ntensorflow\x1a\x32tensorflow/core/framework/tensor_description.proto\"0\n\rMemoryLogStep\x12\x0f\n\x07step_id\x18\x01 \x01(\x03\x12\x0e\n\x06handle\x18\x02 \x01(\t\"p\n\x19MemoryLogTensorAllocation\x12\x0f\n\x07step_id\x18\x01 \x01(\x03\x12\x13\n\x0bkernel_name\x18\x02 \x01(\t\x12-\n\x06tensor\x18\x03 \x01(\x0b\x32\x1d.tensorflow.TensorDescription\"L\n\x1bMemoryLogTensorDeallocation\x12\x15\n\rallocation_id\x18\x01 \x01(\x03\x12\x16\n\x0e\x61llocator_name\x18\x02 \x01(\t\"{\n\x15MemoryLogTensorOutput\x12\x0f\n\x07step_id\x18\x01 \x01(\x03\x12\x13\n\x0bkernel_name\x18\x02 \x01(\t\x12\r\n\x05index\x18\x03 \x01(\x05\x12-\n\x06tensor\x18\x04 \x01(\x0b\x32\x1d.tensorflow.TensorDescription\"\x8b\x01\n\x16MemoryLogRawAllocation\x12\x0f\n\x07step_id\x18\x01 \x01(\x03\x12\x11\n\toperation\x18\x02 \x01(\t\x12\x11\n\tnum_bytes\x18\x03 \x01(\x03\x12\x0b\n\x03ptr\x18\x04 \x01(\x04\x12\x15\n\rallocation_id\x18\x05 \x01(\x03\x12\x16\n\x0e\x61llocator_name\x18\x06 \x01(\t\"\x7f\n\x18MemoryLogRawDeallocation\x12\x0f\n\x07step_id\x18\x01 \x01(\x03\x12\x11\n\toperation\x18\x02 \x01(\t\x12\x15\n\rallocation_id\x18\x03 \x01(\x03\x12\x16\n\x0e\x61llocator_name\x18\x04 \x01(\t\x12\x10\n\x08\x64\x65\x66\x65rred\x18\x05 \x01(\x08\x42\x83\x01\n\x18org.tensorflow.frameworkB\x0fLogMemoryProtosP\x01ZQgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/log_memory_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.framework.log_memory_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\017LogMemoryProtosP\001ZQgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/log_memory_go_proto\370\001\001' + _MEMORYLOGSTEP._serialized_start=110 + _MEMORYLOGSTEP._serialized_end=158 + _MEMORYLOGTENSORALLOCATION._serialized_start=160 + _MEMORYLOGTENSORALLOCATION._serialized_end=272 + _MEMORYLOGTENSORDEALLOCATION._serialized_start=274 + _MEMORYLOGTENSORDEALLOCATION._serialized_end=350 + _MEMORYLOGTENSOROUTPUT._serialized_start=352 + _MEMORYLOGTENSOROUTPUT._serialized_end=475 + _MEMORYLOGRAWALLOCATION._serialized_start=478 + _MEMORYLOGRAWALLOCATION._serialized_end=617 + _MEMORYLOGRAWDEALLOCATION._serialized_start=619 + _MEMORYLOGRAWDEALLOCATION._serialized_end=746 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/model_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/model_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..70b948f9b142d8e3272d981fdd33bad094a05bc5 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/model_pb2.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/framework/model.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n%tensorflow/core/framework/model.proto\x12\x15tensorflow.data.model\"\x87\x08\n\nModelProto\x12;\n\x05nodes\x18\x01 \x03(\x0b\x32,.tensorflow.data.model.ModelProto.NodesEntry\x12\x0e\n\x06output\x18\x02 \x01(\x03\x12\x12\n\nid_counter\x18\x03 \x01(\x03\x12Q\n\x13optimization_params\x18\x05 \x01(\x0b\x32\x34.tensorflow.data.model.ModelProto.OptimizationParams\x12\x11\n\tgap_times\x18\x06 \x03(\x04\x1a\xbf\x04\n\x04Node\x12\n\n\x02id\x18\x01 \x01(\x03\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x10\n\x08\x61utotune\x18\x03 \x01(\x08\x12\x16\n\x0e\x62uffered_bytes\x18\x04 \x01(\x03\x12\x19\n\x11\x62uffered_elements\x18\x05 \x01(\x03\x12\x16\n\x0e\x62ytes_consumed\x18\x06 \x01(\x03\x12\x16\n\x0e\x62ytes_produced\x18\x07 \x01(\x03\x12\x14\n\x0cnum_elements\x18\x08 \x01(\x03\x12\x17\n\x0fprocessing_time\x18\t \x01(\x03\x12\x16\n\x0erecord_metrics\x18\n \x01(\x08\x12\x44\n\nparameters\x18\x0b \x03(\x0b\x32\x30.tensorflow.data.model.ModelProto.Node.Parameter\x12!\n\x19input_processing_time_sum\x18\x0c \x01(\x01\x12#\n\x1binput_processing_time_count\x18\r \x01(\x03\x12\x0e\n\x06inputs\x18\x0e \x03(\x03\x12\x34\n\nnode_class\x18\x0f \x01(\x0e\x32 .tensorflow.data.model.NodeClass\x12\r\n\x05ratio\x18\x10 \x01(\x01\x12\x14\n\x0cmemory_ratio\x18\x11 \x01(\x01\x1ah\n\tParameter\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x01\x12\x13\n\x0bstate_value\x18\x03 \x01(\x01\x12\x0b\n\x03min\x18\x04 \x01(\x01\x12\x0b\n\x03max\x18\x05 \x01(\x01\x12\x0f\n\x07tunable\x18\x06 \x01(\x08\x1aT\n\nNodesEntry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12\x35\n\x05value\x18\x02 \x01(\x0b\x32&.tensorflow.data.model.ModelProto.Node:\x02\x38\x01\x1a\x93\x01\n\x12OptimizationParams\x12;\n\talgorithm\x18\x01 \x01(\x0e\x32(.tensorflow.data.model.AutotuneAlgorithm\x12\x12\n\ncpu_budget\x18\x02 \x01(\x03\x12\x12\n\nram_budget\x18\x03 \x01(\x03\x12\x18\n\x10model_input_time\x18\x04 \x01(\x01J\x04\x08\x04\x10\x05*\x9c\x01\n\tNodeClass\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x13\n\x0fINTERLEAVE_MANY\x10\x01\x12\x19\n\x15\x41SYNC_INTERLEAVE_MANY\x10\x02\x12\x0f\n\x0bKNOWN_RATIO\x10\x03\x12\x15\n\x11\x41SYNC_KNOWN_RATIO\x10\x04\x12\x11\n\rUNKNOWN_RATIO\x10\x05\x12\x17\n\x13\x41SYNC_UNKNOWN_RATIO\x10\x06*l\n\x11\x41utotuneAlgorithm\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x00\x12\x0e\n\nHILL_CLIMB\x10\x01\x12\x14\n\x10GRADIENT_DESCENT\x10\x02\x12\x13\n\x0fMAX_PARALLELISM\x10\x03\x12\x0f\n\x0bSTAGE_BASED\x10\x04\x42QZLgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/model_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.framework.model_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'ZLgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/model_go_proto\370\001\001' + _MODELPROTO_NODESENTRY._options = None + _MODELPROTO_NODESENTRY._serialized_options = b'8\001' + _NODECLASS._serialized_start=1099 + _NODECLASS._serialized_end=1255 + _AUTOTUNEALGORITHM._serialized_start=1257 + _AUTOTUNEALGORITHM._serialized_end=1365 + _MODELPROTO._serialized_start=65 + _MODELPROTO._serialized_end=1096 + _MODELPROTO_NODE._serialized_start=279 + _MODELPROTO_NODE._serialized_end=854 + _MODELPROTO_NODE_PARAMETER._serialized_start=750 + _MODELPROTO_NODE_PARAMETER._serialized_end=854 + _MODELPROTO_NODESENTRY._serialized_start=856 + _MODELPROTO_NODESENTRY._serialized_end=940 + _MODELPROTO_OPTIMIZATIONPARAMS._serialized_start=943 + _MODELPROTO_OPTIMIZATIONPARAMS._serialized_end=1090 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/node_def_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/node_def_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..64bb5e7b46fd7e1d48995152da849ff2fbafeaaf --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/node_def_pb2.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/framework/node_def.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2 +from tensorflow.core.framework import full_type_pb2 as tensorflow_dot_core_dot_framework_dot_full__type__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(tensorflow/core/framework/node_def.proto\x12\ntensorflow\x1a*tensorflow/core/framework/attr_value.proto\x1a)tensorflow/core/framework/full_type.proto\"\x86\x03\n\x07NodeDef\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\n\n\x02op\x18\x02 \x01(\t\x12\r\n\x05input\x18\x03 \x03(\t\x12\x0e\n\x06\x64\x65vice\x18\x04 \x01(\t\x12+\n\x04\x61ttr\x18\x05 \x03(\x0b\x32\x1d.tensorflow.NodeDef.AttrEntry\x12J\n\x17\x65xperimental_debug_info\x18\x06 \x01(\x0b\x32).tensorflow.NodeDef.ExperimentalDebugInfo\x12\x32\n\x11\x65xperimental_type\x18\x07 \x01(\x0b\x32\x17.tensorflow.FullTypeDef\x1a\x42\n\tAttrEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12$\n\x05value\x18\x02 \x01(\x0b\x32\x15.tensorflow.AttrValue:\x02\x38\x01\x1aQ\n\x15\x45xperimentalDebugInfo\x12\x1b\n\x13original_node_names\x18\x01 \x03(\t\x12\x1b\n\x13original_func_names\x18\x02 \x03(\tB{\n\x18org.tensorflow.frameworkB\tNodeProtoP\x01ZOgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/node_def_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.framework.node_def_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\tNodeProtoP\001ZOgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/node_def_go_proto\370\001\001' + _NODEDEF_ATTRENTRY._options = None + _NODEDEF_ATTRENTRY._serialized_options = b'8\001' + _NODEDEF._serialized_start=144 + _NODEDEF._serialized_end=534 + _NODEDEF_ATTRENTRY._serialized_start=385 + _NODEDEF_ATTRENTRY._serialized_end=451 + _NODEDEF_EXPERIMENTALDEBUGINFO._serialized_start=453 + _NODEDEF_EXPERIMENTALDEBUGINFO._serialized_end=534 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/op_def_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/op_def_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..fc41fa31a8754d33df74da43ef139bb49eba57b9 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/op_def_pb2.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/framework/op_def.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2 +from tensorflow.core.framework import full_type_pb2 as tensorflow_dot_core_dot_framework_dot_full__type__pb2 +from tensorflow.core.framework import resource_handle_pb2 as tensorflow_dot_core_dot_framework_dot_resource__handle__pb2 +from tensorflow.core.framework import types_pb2 as tensorflow_dot_core_dot_framework_dot_types__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n&tensorflow/core/framework/op_def.proto\x12\ntensorflow\x1a*tensorflow/core/framework/attr_value.proto\x1a)tensorflow/core/framework/full_type.proto\x1a/tensorflow/core/framework/resource_handle.proto\x1a%tensorflow/core/framework/types.proto\"\xf3\x06\n\x05OpDef\x12\x0c\n\x04name\x18\x01 \x01(\t\x12+\n\tinput_arg\x18\x02 \x03(\x0b\x32\x18.tensorflow.OpDef.ArgDef\x12,\n\noutput_arg\x18\x03 \x03(\x0b\x32\x18.tensorflow.OpDef.ArgDef\x12\x16\n\x0e\x63ontrol_output\x18\x14 \x03(\t\x12\'\n\x04\x61ttr\x18\x04 \x03(\x0b\x32\x19.tensorflow.OpDef.AttrDef\x12.\n\x0b\x64\x65precation\x18\x08 \x01(\x0b\x32\x19.tensorflow.OpDeprecation\x12\x0f\n\x07summary\x18\x05 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x06 \x01(\t\x12\x16\n\x0eis_commutative\x18\x12 \x01(\x08\x12\x14\n\x0cis_aggregate\x18\x10 \x01(\x08\x12\x13\n\x0bis_stateful\x18\x11 \x01(\x08\x12\"\n\x1a\x61llows_uninitialized_input\x18\x13 \x01(\x08\x12$\n\x1cis_distributed_communication\x18\x15 \x01(\x08\x1a\x9c\x02\n\x06\x41rgDef\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\"\n\x04type\x18\x03 \x01(\x0e\x32\x14.tensorflow.DataType\x12\x11\n\ttype_attr\x18\x04 \x01(\t\x12\x13\n\x0bnumber_attr\x18\x05 \x01(\t\x12\x16\n\x0etype_list_attr\x18\x06 \x01(\t\x12\x42\n\x0bhandle_data\x18\x07 \x03(\x0b\x32-.tensorflow.ResourceHandleProto.DtypeAndShape\x12\x0e\n\x06is_ref\x18\x10 \x01(\x08\x12\x37\n\x16\x65xperimental_full_type\x18\x11 \x01(\x0b\x32\x17.tensorflow.FullTypeDef\x1a\xbd\x01\n\x07\x41ttrDef\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\x12,\n\rdefault_value\x18\x03 \x01(\x0b\x32\x15.tensorflow.AttrValue\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\x13\n\x0bhas_minimum\x18\x05 \x01(\x08\x12\x0f\n\x07minimum\x18\x06 \x01(\x03\x12-\n\x0e\x61llowed_values\x18\x07 \x01(\x0b\x32\x15.tensorflow.AttrValue\"5\n\rOpDeprecation\x12\x0f\n\x07version\x18\x01 \x01(\x05\x12\x13\n\x0b\x65xplanation\x18\x02 \x01(\t\"\'\n\x06OpList\x12\x1d\n\x02op\x18\x01 \x03(\x0b\x32\x11.tensorflow.OpDefB{\n\x18org.tensorflow.frameworkB\x0bOpDefProtosP\x01ZMgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/op_def_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.framework.op_def_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\013OpDefProtosP\001ZMgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/op_def_go_proto\370\001\001' + _OPDEF._serialized_start=230 + _OPDEF._serialized_end=1113 + _OPDEF_ARGDEF._serialized_start=637 + _OPDEF_ARGDEF._serialized_end=921 + _OPDEF_ATTRDEF._serialized_start=924 + _OPDEF_ATTRDEF._serialized_end=1113 + _OPDEPRECATION._serialized_start=1115 + _OPDEPRECATION._serialized_end=1168 + _OPLIST._serialized_start=1170 + _OPLIST._serialized_end=1209 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/optimized_function_graph_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/optimized_function_graph_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..e7a1435dda2b96fe260f8fdb790a1ca2f37d8640 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/optimized_function_graph_pb2.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/framework/optimized_function_graph.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import graph_pb2 as tensorflow_dot_core_dot_framework_dot_graph__pb2 +from tensorflow.core.framework import types_pb2 as tensorflow_dot_core_dot_framework_dot_types__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n8tensorflow/core/framework/optimized_function_graph.proto\x12\ntensorflow\x1a%tensorflow/core/framework/graph.proto\x1a%tensorflow/core/framework/types.proto\"\x93\x04\n\x16OptimizedFunctionGraph\x12\x0c\n\x04name\x18\x01 \x01(\t\x12,\n\x0e\x66unction_graph\x18\x02 \x01(\x0b\x32\x14.tensorflow.GraphDef\x12^\n\x18node_name_to_control_ret\x18\x03 \x03(\x0b\x32<.tensorflow.OptimizedFunctionGraph.NodeNameToControlRetEntry\x12\'\n\tret_types\x18\x04 \x03(\x0e\x32\x14.tensorflow.DataType\x12\x18\n\x10num_return_nodes\x18\x05 \x01(\r\x12J\n\x06source\x18\x07 \x01(\x0e\x32\x35.tensorflow.OptimizedFunctionGraph.OptimizationSourceH\x00\x88\x01\x01\x12$\n\x17optimization_time_usecs\x18\x08 \x01(\x04H\x01\x88\x01\x01\x1a;\n\x19NodeNameToControlRetEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\">\n\x12OptimizationSource\x12\x16\n\x12SOURCE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41OT\x10\x01\x12\x07\n\x03JIT\x10\x02\x42\t\n\x07_sourceB\x1a\n\x18_optimization_time_usecsJ\x04\x08\x06\x10\x07\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.framework.optimized_function_graph_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + _OPTIMIZEDFUNCTIONGRAPH_NODENAMETOCONTROLRETENTRY._options = None + _OPTIMIZEDFUNCTIONGRAPH_NODENAMETOCONTROLRETENTRY._serialized_options = b'8\001' + _OPTIMIZEDFUNCTIONGRAPH._serialized_start=151 + _OPTIMIZEDFUNCTIONGRAPH._serialized_end=682 + _OPTIMIZEDFUNCTIONGRAPH_NODENAMETOCONTROLRETENTRY._serialized_start=514 + _OPTIMIZEDFUNCTIONGRAPH_NODENAMETOCONTROLRETENTRY._serialized_end=573 + _OPTIMIZEDFUNCTIONGRAPH_OPTIMIZATIONSOURCE._serialized_start=575 + _OPTIMIZEDFUNCTIONGRAPH_OPTIMIZATIONSOURCE._serialized_end=637 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/reader_base_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/reader_base_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..60de66ab69eaac9f12e4d42bf69ebd9406f57bdc --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/reader_base_pb2.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/framework/reader_base.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n+tensorflow/core/framework/reader_base.proto\x12\ntensorflow\"r\n\x0fReaderBaseState\x12\x14\n\x0cwork_started\x18\x01 \x01(\x03\x12\x15\n\rwork_finished\x18\x02 \x01(\x03\x12\x1c\n\x14num_records_produced\x18\x03 \x01(\x03\x12\x14\n\x0c\x63urrent_work\x18\x04 \x01(\x0c\x42\x85\x01\n\x18org.tensorflow.frameworkB\x10ReaderBaseProtosP\x01ZRgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/reader_base_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.framework.reader_base_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\020ReaderBaseProtosP\001ZRgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/reader_base_go_proto\370\001\001' + _READERBASESTATE._serialized_start=59 + _READERBASESTATE._serialized_end=173 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/resource_handle_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/resource_handle_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..401580874db1115664ebfcb8abcffa87539bb648 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/resource_handle_pb2.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/framework/resource_handle.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2 +from tensorflow.core.framework import types_pb2 as tensorflow_dot_core_dot_framework_dot_types__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n/tensorflow/core/framework/resource_handle.proto\x12\ntensorflow\x1a,tensorflow/core/framework/tensor_shape.proto\x1a%tensorflow/core/framework/types.proto\"\xa5\x02\n\x13ResourceHandleProto\x12\x0e\n\x06\x64\x65vice\x18\x01 \x01(\t\x12\x11\n\tcontainer\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x11\n\thash_code\x18\x04 \x01(\x04\x12\x17\n\x0fmaybe_type_name\x18\x05 \x01(\t\x12H\n\x11\x64types_and_shapes\x18\x06 \x03(\x0b\x32-.tensorflow.ResourceHandleProto.DtypeAndShape\x1a\x61\n\rDtypeAndShape\x12#\n\x05\x64type\x18\x01 \x01(\x0e\x32\x14.tensorflow.DataType\x12+\n\x05shape\x18\x02 \x01(\x0b\x32\x1c.tensorflow.TensorShapeProtoJ\x04\x08\x07\x10\x08\x42\x87\x01\n\x18org.tensorflow.frameworkB\x0eResourceHandleP\x01ZVgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/resource_handle_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.framework.resource_handle_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\016ResourceHandleP\001ZVgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/resource_handle_go_proto\370\001\001' + _RESOURCEHANDLEPROTO._serialized_start=149 + _RESOURCEHANDLEPROTO._serialized_end=442 + _RESOURCEHANDLEPROTO_DTYPEANDSHAPE._serialized_start=339 + _RESOURCEHANDLEPROTO_DTYPEANDSHAPE._serialized_end=436 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/step_stats_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/step_stats_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..05a9669ac5c5b60179309eb5c31951e726939988 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/step_stats_pb2.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/framework/step_stats.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import allocation_description_pb2 as tensorflow_dot_core_dot_framework_dot_allocation__description__pb2 +from tensorflow.core.framework import tensor_description_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__description__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*tensorflow/core/framework/step_stats.proto\x12\ntensorflow\x1a\x36tensorflow/core/framework/allocation_description.proto\x1a\x32tensorflow/core/framework/tensor_description.proto\"=\n\x10\x41llocationRecord\x12\x14\n\x0c\x61lloc_micros\x18\x01 \x01(\x03\x12\x13\n\x0b\x61lloc_bytes\x18\x02 \x01(\x03\"\xc4\x01\n\x13\x41llocatorMemoryUsed\x12\x16\n\x0e\x61llocator_name\x18\x01 \x01(\t\x12\x13\n\x0btotal_bytes\x18\x02 \x01(\x03\x12\x12\n\npeak_bytes\x18\x03 \x01(\x03\x12\x12\n\nlive_bytes\x18\x04 \x01(\x03\x12\x38\n\x12\x61llocation_records\x18\x06 \x03(\x0b\x32\x1c.tensorflow.AllocationRecord\x12\x1e\n\x16\x61llocator_bytes_in_use\x18\x05 \x01(\x03\"U\n\nNodeOutput\x12\x0c\n\x04slot\x18\x01 \x01(\x05\x12\x39\n\x12tensor_description\x18\x03 \x01(\x0b\x32\x1d.tensorflow.TensorDescription\"\xec\x01\n\x0bMemoryStats\x12\x18\n\x10temp_memory_size\x18\x01 \x01(\x03\x12\x1e\n\x16persistent_memory_size\x18\x03 \x01(\x03\x12#\n\x1bpersistent_tensor_alloc_ids\x18\x05 \x03(\x03\x12#\n\x17\x64\x65vice_temp_memory_size\x18\x02 \x01(\x03\x42\x02\x18\x01\x12)\n\x1d\x64\x65vice_persistent_memory_size\x18\x04 \x01(\x03\x42\x02\x18\x01\x12.\n\"device_persistent_tensor_alloc_ids\x18\x06 \x03(\x03\x42\x02\x18\x01\"\x9e\x04\n\rNodeExecStats\x12\x11\n\tnode_name\x18\x01 \x01(\t\x12\x18\n\x10\x61ll_start_micros\x18\x02 \x01(\x03\x12\x1b\n\x13op_start_rel_micros\x18\x03 \x01(\x03\x12\x19\n\x11op_end_rel_micros\x18\x04 \x01(\x03\x12\x1a\n\x12\x61ll_end_rel_micros\x18\x05 \x01(\x03\x12/\n\x06memory\x18\x06 \x03(\x0b\x32\x1f.tensorflow.AllocatorMemoryUsed\x12&\n\x06output\x18\x07 \x03(\x0b\x32\x16.tensorflow.NodeOutput\x12\x16\n\x0etimeline_label\x18\x08 \x01(\t\x12\x18\n\x10scheduled_micros\x18\t \x01(\x03\x12\x11\n\tthread_id\x18\n \x01(\r\x12<\n\x11referenced_tensor\x18\x0b \x03(\x0b\x32!.tensorflow.AllocationDescription\x12-\n\x0cmemory_stats\x18\x0c \x01(\x0b\x32\x17.tensorflow.MemoryStats\x12\x17\n\x0f\x61ll_start_nanos\x18\r \x01(\x03\x12\x1a\n\x12op_start_rel_nanos\x18\x0e \x01(\x03\x12\x18\n\x10op_end_rel_nanos\x18\x0f \x01(\x03\x12\x19\n\x11\x61ll_end_rel_nanos\x18\x10 \x01(\x03\x12\x17\n\x0fscheduled_nanos\x18\x11 \x01(\x03\"\xc8\x01\n\x0f\x44\x65viceStepStats\x12\x0e\n\x06\x64\x65vice\x18\x01 \x01(\t\x12-\n\nnode_stats\x18\x02 \x03(\x0b\x32\x19.tensorflow.NodeExecStats\x12\x42\n\x0cthread_names\x18\x03 \x03(\x0b\x32,.tensorflow.DeviceStepStats.ThreadNamesEntry\x1a\x32\n\x10ThreadNamesEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\";\n\tStepStats\x12.\n\tdev_stats\x18\x01 \x03(\x0b\x32\x1b.tensorflow.DeviceStepStatsB\x83\x01\n\x18org.tensorflow.frameworkB\x0fStepStatsProtosP\x01ZQgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/step_stats_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.framework.step_stats_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\017StepStatsProtosP\001ZQgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/step_stats_go_proto\370\001\001' + _MEMORYSTATS.fields_by_name['device_temp_memory_size']._options = None + _MEMORYSTATS.fields_by_name['device_temp_memory_size']._serialized_options = b'\030\001' + _MEMORYSTATS.fields_by_name['device_persistent_memory_size']._options = None + _MEMORYSTATS.fields_by_name['device_persistent_memory_size']._serialized_options = b'\030\001' + _MEMORYSTATS.fields_by_name['device_persistent_tensor_alloc_ids']._options = None + _MEMORYSTATS.fields_by_name['device_persistent_tensor_alloc_ids']._serialized_options = b'\030\001' + _DEVICESTEPSTATS_THREADNAMESENTRY._options = None + _DEVICESTEPSTATS_THREADNAMESENTRY._serialized_options = b'8\001' + _ALLOCATIONRECORD._serialized_start=166 + _ALLOCATIONRECORD._serialized_end=227 + _ALLOCATORMEMORYUSED._serialized_start=230 + _ALLOCATORMEMORYUSED._serialized_end=426 + _NODEOUTPUT._serialized_start=428 + _NODEOUTPUT._serialized_end=513 + _MEMORYSTATS._serialized_start=516 + _MEMORYSTATS._serialized_end=752 + _NODEEXECSTATS._serialized_start=755 + _NODEEXECSTATS._serialized_end=1297 + _DEVICESTEPSTATS._serialized_start=1300 + _DEVICESTEPSTATS._serialized_end=1500 + _DEVICESTEPSTATS_THREADNAMESENTRY._serialized_start=1450 + _DEVICESTEPSTATS_THREADNAMESENTRY._serialized_end=1500 + _STEPSTATS._serialized_start=1502 + _STEPSTATS._serialized_end=1561 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/summary_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/summary_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..0f1d432cae1c61355a7a478da6768210843e9526 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/summary_pb2.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/framework/summary.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.tsl.protobuf import histogram_pb2 as tsl_dot_protobuf_dot_histogram__pb2 +from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2 + +from tensorflow.tsl.protobuf.histogram_pb2 import * + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\'tensorflow/core/framework/summary.proto\x12\ntensorflow\x1a\x1ctsl/protobuf/histogram.proto\x1a&tensorflow/core/framework/tensor.proto\"\'\n\x12SummaryDescription\x12\x11\n\ttype_hint\x18\x01 \x01(\t\"\xe0\x01\n\x0fSummaryMetadata\x12;\n\x0bplugin_data\x18\x01 \x01(\x0b\x32&.tensorflow.SummaryMetadata.PluginData\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x1b\n\x13summary_description\x18\x03 \x01(\t\x12)\n\ndata_class\x18\x04 \x01(\x0e\x32\x15.tensorflow.DataClass\x1a\x32\n\nPluginData\x12\x13\n\x0bplugin_name\x18\x01 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\x0c\"\xde\x04\n\x07Summary\x12(\n\x05value\x18\x01 \x03(\x0b\x32\x19.tensorflow.Summary.Value\x1aX\n\x05Image\x12\x0e\n\x06height\x18\x01 \x01(\x05\x12\r\n\x05width\x18\x02 \x01(\x05\x12\x12\n\ncolorspace\x18\x03 \x01(\x05\x12\x1c\n\x14\x65ncoded_image_string\x18\x04 \x01(\x0c\x1a}\n\x05\x41udio\x12\x13\n\x0bsample_rate\x18\x01 \x01(\x02\x12\x14\n\x0cnum_channels\x18\x02 \x01(\x03\x12\x15\n\rlength_frames\x18\x03 \x01(\x03\x12\x1c\n\x14\x65ncoded_audio_string\x18\x04 \x01(\x0c\x12\x14\n\x0c\x63ontent_type\x18\x05 \x01(\t\x1a\xcf\x02\n\x05Value\x12\x11\n\tnode_name\x18\x07 \x01(\t\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12-\n\x08metadata\x18\t \x01(\x0b\x32\x1b.tensorflow.SummaryMetadata\x12\x16\n\x0csimple_value\x18\x02 \x01(\x02H\x00\x12&\n\x1cobsolete_old_style_histogram\x18\x03 \x01(\x0cH\x00\x12*\n\x05image\x18\x04 \x01(\x0b\x32\x19.tensorflow.Summary.ImageH\x00\x12+\n\x05histo\x18\x05 \x01(\x0b\x32\x1a.tensorflow.HistogramProtoH\x00\x12*\n\x05\x61udio\x18\x06 \x01(\x0b\x32\x19.tensorflow.Summary.AudioH\x00\x12)\n\x06tensor\x18\x08 \x01(\x0b\x32\x17.tensorflow.TensorProtoH\x00\x42\x07\n\x05value*o\n\tDataClass\x12\x16\n\x12\x44\x41TA_CLASS_UNKNOWN\x10\x00\x12\x15\n\x11\x44\x41TA_CLASS_SCALAR\x10\x01\x12\x15\n\x11\x44\x41TA_CLASS_TENSOR\x10\x02\x12\x1c\n\x18\x44\x41TA_CLASS_BLOB_SEQUENCE\x10\x03\x42~\n\x18org.tensorflow.frameworkB\rSummaryProtosP\x01ZNgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/summary_go_proto\xf8\x01\x01P\x00\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.framework.summary_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\rSummaryProtosP\001ZNgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/summary_go_proto\370\001\001' + _DATACLASS._serialized_start=1002 + _DATACLASS._serialized_end=1113 + _SUMMARYDESCRIPTION._serialized_start=125 + _SUMMARYDESCRIPTION._serialized_end=164 + _SUMMARYMETADATA._serialized_start=167 + _SUMMARYMETADATA._serialized_end=391 + _SUMMARYMETADATA_PLUGINDATA._serialized_start=341 + _SUMMARYMETADATA_PLUGINDATA._serialized_end=391 + _SUMMARY._serialized_start=394 + _SUMMARY._serialized_end=1000 + _SUMMARY_IMAGE._serialized_start=447 + _SUMMARY_IMAGE._serialized_end=535 + _SUMMARY_AUDIO._serialized_start=537 + _SUMMARY_AUDIO._serialized_end=662 + _SUMMARY_VALUE._serialized_start=665 + _SUMMARY_VALUE._serialized_end=1000 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/tensor_description_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/tensor_description_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..50a0c30478c0110f23fc6964e98dee24f88ac9ec --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/tensor_description_pb2.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/framework/tensor_description.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import allocation_description_pb2 as tensorflow_dot_core_dot_framework_dot_allocation__description__pb2 +from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2 +from tensorflow.core.framework import types_pb2 as tensorflow_dot_core_dot_framework_dot_types__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n2tensorflow/core/framework/tensor_description.proto\x12\ntensorflow\x1a\x36tensorflow/core/framework/allocation_description.proto\x1a,tensorflow/core/framework/tensor_shape.proto\x1a%tensorflow/core/framework/types.proto\"\xa8\x01\n\x11TensorDescription\x12#\n\x05\x64type\x18\x01 \x01(\x0e\x32\x14.tensorflow.DataType\x12+\n\x05shape\x18\x02 \x01(\x0b\x32\x1c.tensorflow.TensorShapeProto\x12\x41\n\x16\x61llocation_description\x18\x04 \x01(\x0b\x32!.tensorflow.AllocationDescriptionB\x93\x01\n\x18org.tensorflow.frameworkB\x17TensorDescriptionProtosP\x01ZYgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/tensor_description_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.framework.tensor_description_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\027TensorDescriptionProtosP\001ZYgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/tensor_description_go_proto\370\001\001' + _TENSORDESCRIPTION._serialized_start=208 + _TENSORDESCRIPTION._serialized_end=376 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/tensor_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/tensor_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..4b1fd94655ed63850316f67f17ae0f31cb3f2552 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/tensor_pb2.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/framework/tensor.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import resource_handle_pb2 as tensorflow_dot_core_dot_framework_dot_resource__handle__pb2 +from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2 +from tensorflow.core.framework import types_pb2 as tensorflow_dot_core_dot_framework_dot_types__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n&tensorflow/core/framework/tensor.proto\x12\ntensorflow\x1a/tensorflow/core/framework/resource_handle.proto\x1a,tensorflow/core/framework/tensor_shape.proto\x1a%tensorflow/core/framework/types.proto\"\xa0\x04\n\x0bTensorProto\x12#\n\x05\x64type\x18\x01 \x01(\x0e\x32\x14.tensorflow.DataType\x12\x32\n\x0ctensor_shape\x18\x02 \x01(\x0b\x32\x1c.tensorflow.TensorShapeProto\x12\x16\n\x0eversion_number\x18\x03 \x01(\x05\x12\x16\n\x0etensor_content\x18\x04 \x01(\x0c\x12\x14\n\x08half_val\x18\r \x03(\x05\x42\x02\x10\x01\x12\x15\n\tfloat_val\x18\x05 \x03(\x02\x42\x02\x10\x01\x12\x16\n\ndouble_val\x18\x06 \x03(\x01\x42\x02\x10\x01\x12\x13\n\x07int_val\x18\x07 \x03(\x05\x42\x02\x10\x01\x12\x12\n\nstring_val\x18\x08 \x03(\x0c\x12\x18\n\x0cscomplex_val\x18\t \x03(\x02\x42\x02\x10\x01\x12\x15\n\tint64_val\x18\n \x03(\x03\x42\x02\x10\x01\x12\x14\n\x08\x62ool_val\x18\x0b \x03(\x08\x42\x02\x10\x01\x12\x18\n\x0c\x64\x63omplex_val\x18\x0c \x03(\x01\x42\x02\x10\x01\x12<\n\x13resource_handle_val\x18\x0e \x03(\x0b\x32\x1f.tensorflow.ResourceHandleProto\x12\x37\n\x0bvariant_val\x18\x0f \x03(\x0b\x32\".tensorflow.VariantTensorDataProto\x12\x16\n\nuint32_val\x18\x10 \x03(\rB\x02\x10\x01\x12\x16\n\nuint64_val\x18\x11 \x03(\x04\x42\x02\x10\x01\x12\x12\n\nfloat8_val\x18\x12 \x01(\x0c\"g\n\x16VariantTensorDataProto\x12\x11\n\ttype_name\x18\x01 \x01(\t\x12\x10\n\x08metadata\x18\x02 \x01(\x0c\x12(\n\x07tensors\x18\x03 \x03(\x0b\x32\x17.tensorflow.TensorProtoB|\n\x18org.tensorflow.frameworkB\x0cTensorProtosP\x01ZMgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/tensor_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.framework.tensor_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\014TensorProtosP\001ZMgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/tensor_go_proto\370\001\001' + _TENSORPROTO.fields_by_name['half_val']._options = None + _TENSORPROTO.fields_by_name['half_val']._serialized_options = b'\020\001' + _TENSORPROTO.fields_by_name['float_val']._options = None + _TENSORPROTO.fields_by_name['float_val']._serialized_options = b'\020\001' + _TENSORPROTO.fields_by_name['double_val']._options = None + _TENSORPROTO.fields_by_name['double_val']._serialized_options = b'\020\001' + _TENSORPROTO.fields_by_name['int_val']._options = None + _TENSORPROTO.fields_by_name['int_val']._serialized_options = b'\020\001' + _TENSORPROTO.fields_by_name['scomplex_val']._options = None + _TENSORPROTO.fields_by_name['scomplex_val']._serialized_options = b'\020\001' + _TENSORPROTO.fields_by_name['int64_val']._options = None + _TENSORPROTO.fields_by_name['int64_val']._serialized_options = b'\020\001' + _TENSORPROTO.fields_by_name['bool_val']._options = None + _TENSORPROTO.fields_by_name['bool_val']._serialized_options = b'\020\001' + _TENSORPROTO.fields_by_name['dcomplex_val']._options = None + _TENSORPROTO.fields_by_name['dcomplex_val']._serialized_options = b'\020\001' + _TENSORPROTO.fields_by_name['uint32_val']._options = None + _TENSORPROTO.fields_by_name['uint32_val']._serialized_options = b'\020\001' + _TENSORPROTO.fields_by_name['uint64_val']._options = None + _TENSORPROTO.fields_by_name['uint64_val']._serialized_options = b'\020\001' + _TENSORPROTO._serialized_start=189 + _TENSORPROTO._serialized_end=733 + _VARIANTTENSORDATAPROTO._serialized_start=735 + _VARIANTTENSORDATAPROTO._serialized_end=838 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/tensor_shape_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/tensor_shape_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..4724ef16413934550b4dc6db490893704bc2da15 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/tensor_shape_pb2.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/framework/tensor_shape.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,tensorflow/core/framework/tensor_shape.proto\x12\ntensorflow\"z\n\x10TensorShapeProto\x12-\n\x03\x64im\x18\x02 \x03(\x0b\x32 .tensorflow.TensorShapeProto.Dim\x12\x14\n\x0cunknown_rank\x18\x03 \x01(\x08\x1a!\n\x03\x44im\x12\x0c\n\x04size\x18\x01 \x01(\x03\x12\x0c\n\x04name\x18\x02 \x01(\tB\x87\x01\n\x18org.tensorflow.frameworkB\x11TensorShapeProtosP\x01ZSgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/tensor_shape_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.framework.tensor_shape_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\021TensorShapeProtosP\001ZSgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/tensor_shape_go_proto\370\001\001' + _TENSORSHAPEPROTO._serialized_start=60 + _TENSORSHAPEPROTO._serialized_end=182 + _TENSORSHAPEPROTO_DIM._serialized_start=149 + _TENSORSHAPEPROTO_DIM._serialized_end=182 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/tensor_slice_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/tensor_slice_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..412063f873fb5178692cb7cd1282b69eea37fe3f --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/tensor_slice_pb2.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/framework/tensor_slice.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,tensorflow/core/framework/tensor_slice.proto\x12\ntensorflow\"\x80\x01\n\x10TensorSliceProto\x12\x33\n\x06\x65xtent\x18\x01 \x03(\x0b\x32#.tensorflow.TensorSliceProto.Extent\x1a\x37\n\x06\x45xtent\x12\r\n\x05start\x18\x01 \x01(\x03\x12\x10\n\x06length\x18\x02 \x01(\x03H\x00\x42\x0c\n\nhas_lengthB\x87\x01\n\x18org.tensorflow.frameworkB\x11TensorSliceProtosP\x01ZSgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/tensor_slice_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.framework.tensor_slice_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\021TensorSliceProtosP\001ZSgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/tensor_slice_go_proto\370\001\001' + _TENSORSLICEPROTO._serialized_start=61 + _TENSORSLICEPROTO._serialized_end=189 + _TENSORSLICEPROTO_EXTENT._serialized_start=134 + _TENSORSLICEPROTO_EXTENT._serialized_end=189 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/types_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/types_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..3f3db1b8bcefe56b45a2a48bca593bfd6eb9ebb6 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/types_pb2.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/framework/types.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n%tensorflow/core/framework/types.proto\x12\ntensorflow\"9\n\x0fSerializedDType\x12&\n\x08\x64\x61tatype\x18\x01 \x01(\x0e\x32\x14.tensorflow.DataType*\xc6\x07\n\x08\x44\x61taType\x12\x0e\n\nDT_INVALID\x10\x00\x12\x0c\n\x08\x44T_FLOAT\x10\x01\x12\r\n\tDT_DOUBLE\x10\x02\x12\x0c\n\x08\x44T_INT32\x10\x03\x12\x0c\n\x08\x44T_UINT8\x10\x04\x12\x0c\n\x08\x44T_INT16\x10\x05\x12\x0b\n\x07\x44T_INT8\x10\x06\x12\r\n\tDT_STRING\x10\x07\x12\x10\n\x0c\x44T_COMPLEX64\x10\x08\x12\x0c\n\x08\x44T_INT64\x10\t\x12\x0b\n\x07\x44T_BOOL\x10\n\x12\x0c\n\x08\x44T_QINT8\x10\x0b\x12\r\n\tDT_QUINT8\x10\x0c\x12\r\n\tDT_QINT32\x10\r\x12\x0f\n\x0b\x44T_BFLOAT16\x10\x0e\x12\r\n\tDT_QINT16\x10\x0f\x12\x0e\n\nDT_QUINT16\x10\x10\x12\r\n\tDT_UINT16\x10\x11\x12\x11\n\rDT_COMPLEX128\x10\x12\x12\x0b\n\x07\x44T_HALF\x10\x13\x12\x0f\n\x0b\x44T_RESOURCE\x10\x14\x12\x0e\n\nDT_VARIANT\x10\x15\x12\r\n\tDT_UINT32\x10\x16\x12\r\n\tDT_UINT64\x10\x17\x12\x12\n\x0e\x44T_FLOAT8_E5M2\x10\x18\x12\x14\n\x10\x44T_FLOAT8_E4M3FN\x10\x19\x12\x0b\n\x07\x44T_INT4\x10\x1d\x12\x0c\n\x08\x44T_UINT4\x10\x1e\x12\x10\n\x0c\x44T_FLOAT_REF\x10\x65\x12\x11\n\rDT_DOUBLE_REF\x10\x66\x12\x10\n\x0c\x44T_INT32_REF\x10g\x12\x10\n\x0c\x44T_UINT8_REF\x10h\x12\x10\n\x0c\x44T_INT16_REF\x10i\x12\x0f\n\x0b\x44T_INT8_REF\x10j\x12\x11\n\rDT_STRING_REF\x10k\x12\x14\n\x10\x44T_COMPLEX64_REF\x10l\x12\x10\n\x0c\x44T_INT64_REF\x10m\x12\x0f\n\x0b\x44T_BOOL_REF\x10n\x12\x10\n\x0c\x44T_QINT8_REF\x10o\x12\x11\n\rDT_QUINT8_REF\x10p\x12\x11\n\rDT_QINT32_REF\x10q\x12\x13\n\x0f\x44T_BFLOAT16_REF\x10r\x12\x11\n\rDT_QINT16_REF\x10s\x12\x12\n\x0e\x44T_QUINT16_REF\x10t\x12\x11\n\rDT_UINT16_REF\x10u\x12\x15\n\x11\x44T_COMPLEX128_REF\x10v\x12\x0f\n\x0b\x44T_HALF_REF\x10w\x12\x13\n\x0f\x44T_RESOURCE_REF\x10x\x12\x12\n\x0e\x44T_VARIANT_REF\x10y\x12\x11\n\rDT_UINT32_REF\x10z\x12\x11\n\rDT_UINT64_REF\x10{\x12\x16\n\x12\x44T_FLOAT8_E5M2_REF\x10|\x12\x18\n\x14\x44T_FLOAT8_E4M3FN_REF\x10}\x12\x10\n\x0b\x44T_INT4_REF\x10\x81\x01\x12\x11\n\x0c\x44T_UINT4_REF\x10\x82\x01\x42z\n\x18org.tensorflow.frameworkB\x0bTypesProtosP\x01ZLgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/types_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.framework.types_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\013TypesProtosP\001ZLgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/types_go_proto\370\001\001' + _DATATYPE._serialized_start=113 + _DATATYPE._serialized_end=1079 + _SERIALIZEDDTYPE._serialized_start=53 + _SERIALIZEDDTYPE._serialized_end=110 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/variable_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/variable_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..953a3335747ddff5b19f49e5ff9a0a147e8b8fcf --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/variable_pb2.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/framework/variable.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(tensorflow/core/framework/variable.proto\x12\ntensorflow\"\xc8\x02\n\x0bVariableDef\x12\x15\n\rvariable_name\x18\x01 \x01(\t\x12\x1a\n\x12initial_value_name\x18\x06 \x01(\t\x12\x18\n\x10initializer_name\x18\x02 \x01(\t\x12\x15\n\rsnapshot_name\x18\x03 \x01(\t\x12\x39\n\x13save_slice_info_def\x18\x04 \x01(\x0b\x32\x1c.tensorflow.SaveSliceInfoDef\x12\x13\n\x0bis_resource\x18\x05 \x01(\x08\x12\x11\n\ttrainable\x18\x07 \x01(\x08\x12<\n\x0fsynchronization\x18\x08 \x01(\x0e\x32#.tensorflow.VariableSynchronization\x12\x34\n\x0b\x61ggregation\x18\t \x01(\x0e\x32\x1f.tensorflow.VariableAggregation\"`\n\x10SaveSliceInfoDef\x12\x11\n\tfull_name\x18\x01 \x01(\t\x12\x12\n\nfull_shape\x18\x02 \x03(\x03\x12\x12\n\nvar_offset\x18\x03 \x03(\x03\x12\x11\n\tvar_shape\x18\x04 \x03(\x03*\xac\x01\n\x17VariableSynchronization\x12!\n\x1dVARIABLE_SYNCHRONIZATION_AUTO\x10\x00\x12!\n\x1dVARIABLE_SYNCHRONIZATION_NONE\x10\x01\x12%\n!VARIABLE_SYNCHRONIZATION_ON_WRITE\x10\x02\x12$\n VARIABLE_SYNCHRONIZATION_ON_READ\x10\x03*\x9e\x01\n\x13VariableAggregation\x12\x1d\n\x19VARIABLE_AGGREGATION_NONE\x10\x00\x12\x1c\n\x18VARIABLE_AGGREGATION_SUM\x10\x01\x12\x1d\n\x19VARIABLE_AGGREGATION_MEAN\x10\x02\x12+\n\'VARIABLE_AGGREGATION_ONLY_FIRST_REPLICA\x10\x03\x42\x80\x01\n\x18org.tensorflow.frameworkB\x0eVariableProtosP\x01ZOgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/variable_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.framework.variable_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\016VariableProtosP\001ZOgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/variable_go_proto\370\001\001' + _VARIABLESYNCHRONIZATION._serialized_start=486 + _VARIABLESYNCHRONIZATION._serialized_end=658 + _VARIABLEAGGREGATION._serialized_start=661 + _VARIABLEAGGREGATION._serialized_end=819 + _VARIABLEDEF._serialized_start=57 + _VARIABLEDEF._serialized_end=385 + _SAVESLICEINFODEF._serialized_start=387 + _SAVESLICEINFODEF._serialized_end=483 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/versions_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/versions_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..4e3b13ff65da9add5484f0e27b8f85b8efeeb594 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/framework/versions_pb2.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/framework/versions.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(tensorflow/core/framework/versions.proto\x12\ntensorflow\"K\n\nVersionDef\x12\x10\n\x08producer\x18\x01 \x01(\x05\x12\x14\n\x0cmin_consumer\x18\x02 \x01(\x05\x12\x15\n\rbad_consumers\x18\x03 \x03(\x05\x42\x80\x01\n\x18org.tensorflow.frameworkB\x0eVersionsProtosP\x01ZOgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/versions_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.framework.versions_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\016VersionsProtosP\001ZOgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/versions_go_proto\370\001\001' + _VERSIONDEF._serialized_start=56 + _VERSIONDEF._serialized_end=131 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/capture/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/capture/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/capture/capture_container.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/capture/capture_container.py new file mode 100644 index 0000000000000000000000000000000000000000..ede63a6a688959d18a3a161887cc584b41f7db1b --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/capture/capture_container.py @@ -0,0 +1,344 @@ +# Copyright 2022 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. +# ============================================================================== +"""FuncGraph and related functionality.""" + +import collections as py_collections +import functools +from typing import Any, Callable, Hashable, Mapping, Optional + +from tensorflow.core.function import trace_type +from tensorflow.python import pywrap_tfe +from tensorflow.python.framework import dtypes +from tensorflow.python.types import core +from tensorflow.python.util import object_identity + + +_EAGER_CONST_THRESHOLD = 128 + + +class MutationAwareDict(py_collections.OrderedDict): + """A dict with a mutation flag.""" + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self._mutated = True + + def pop(self, key, default=None): + self._mutated = True + return super().pop(key, default) + + def __setitem__(self, key, value): + self._mutated = True + return super().__setitem__(key, value) + + def __delitem__(self, key): + self._mutated = True + return super().__delitem__(key) + + def clear(self): + self._mutated = True + return super().clear() + + @property + def mutated(self): + return self._mutated + + @mutated.setter + def mutated(self, value): + self._mutated = value + + +class FunctionCaptures(object): + """A container for all capture usages within FuncGraph.""" + + def __init__(self): + self._by_ref_internal = py_collections.OrderedDict() + self._by_ref_external = py_collections.OrderedDict() + self._by_ref_tracetype = py_collections.OrderedDict() + self._by_val_internal = MutationAwareDict() + self._by_val_external = MutationAwareDict() + self._by_val_tracetype = py_collections.OrderedDict() + + # Set of external ops on which the graph has a control dependency + self.control = object_identity.ObjectIdentitySet() + + # Cached properties derived from the above. + self._cached_by_val_capture_tuples = [] + self._cached_capture_types = py_collections.OrderedDict() + + def clear(self): + self._by_ref_internal.clear() + self._by_ref_external.clear() + self._by_ref_tracetype.clear() + self._by_val_internal.clear() + self._by_val_external.clear() + + def capture_by_value( + self, graph: Any, tensor: core.Tensor, name: Optional[str] = None + ) -> core.Tensor: + """Captures `tensor` if it's external to this graph. + + If `tensor` is from a different graph, returns a placeholder for it. + `tensor` and the placeholder will appear in self.captures, and the + placeholder will appear in self.inputs. Multiple calls to this method with + the same `tensor` argument will return the same placeholder. If `tensor` is + from this graph, returns `tensor`. + + Args: + graph: The FuncGraph that captures this tensor. + tensor: Tensor. May be from this FuncGraph or a different graph. + name: Optional name if a placeholder is created. + + Returns: + Tensor from this FuncGraph. + + Raises: + InaccessibleTensorError: if any tensors are accessed in a manner that + bypasses the mechanisms required for the data dependencies to be correctly + wired. + """ + if isinstance(tensor, core.Value): + if name is None: + # A unique (within the program execution) integer. + name = str(pywrap_tfe.TFE_Py_UID()) + + # Small EagerTensors are captured with Const ops + if ( + tensor.dtype in dtypes.TF_VALUE_DTYPES + and functools.reduce(lambda a, b: a * b, tensor.shape, 1) + <= _EAGER_CONST_THRESHOLD + ): + graph_const = self.by_val_internal.get(id(tensor)) + if graph_const is None: + graph_const = tensor._capture_as_const(name) # pylint: disable=protected-access + if graph_const is None: + # Some eager tensors, e.g. parallel tensors, are not convertible to + # a single constant. We'll use a placeholder for this case. + graph_const = self._create_placeholder_helper(graph, tensor, name) + self.add_or_replace( + key=id(tensor), + external=tensor, + internal=graph_const, + is_by_ref=False, + ) + graph.inputs.append(graph_const) + graph_const._record_tape(tensor) # pylint: disable=protected-access + return graph_const + + # Large EagerTensors and resources are captured with Placeholder ops + return self._create_placeholder_helper(graph, tensor, name) + + if tensor.graph is not graph: + graph._validate_in_scope(tensor) # pylint: disable=protected-access + if name is None: + assert tensor.op is not None, ( + tensor.__class__, + dir(tensor), + tensor.__class__.__name__, + ) + name = tensor.op.name + # cond/while graphs override _capture_helper() so cannot call + # self.create_placeholder_helper() here directly. + return graph._capture_helper(tensor, name) # pylint: disable=protected-access + return tensor + + def add_or_replace( + self, + key: Hashable, + external: Any, + internal: core.Tensor, + tracetype: Any = None, + is_by_ref: bool = False, + ) -> None: + """Replace a already exsiting capture, otherwise add it.""" + if is_by_ref: + self._by_ref_external[key] = external + self._by_ref_internal[key] = internal + self._by_ref_tracetype[key] = tracetype + else: + self._by_val_internal[key] = internal + self._by_val_external[key] = external + if tracetype is not None: + self._by_val_tracetype[key] = tracetype + else: + self._by_val_tracetype[key] = trace_type.from_value(external) + + def pop(self, key: Hashable, is_by_ref: bool = False) -> Any: + if is_by_ref: + return ( + self._by_ref_external.pop(key, None), + self._by_ref_internal.pop(key, None), + self._by_ref_tracetype.pop(key, None), + ) + else: + return ( + self._by_val_external.pop(key, None), + self._by_val_internal.pop(key, None), + self._by_val_tracetype.pop(key, None), + ) + + def reset_captures(self, tensors, placeholders): + """Set the captures with the provided list of captures & placeholder.""" + self._by_val_external = MutationAwareDict() + self._by_val_internal = MutationAwareDict() + self._by_val_tracetype = MutationAwareDict() + for external, internal in zip(tensors, placeholders): + key = id(external) + self._by_val_external[key] = external + self._by_val_internal[key] = internal + self._by_val_tracetype[key] = trace_type.from_value(external) + + # TODO(panzf): make the method public after supporting lam() returns + # non-tensor values. Currently, this method is only used by + # FuncGraph._experimental_capture_side_input_by_ref(), which contains the + # logics for converting non-tensor values to tensor. + def _capture_by_ref( + self, graph: Any, lam: Callable[[], Any], key: Hashable = None + ) -> Any: + """Used during tracing process to create/retrive by-ref captures. + + Args: + graph: The FuncGraph that captures this tensor. + lam: A callable that takes no arguments and returns tensor captures. + key: A hashable identifier. + + Returns: + Tensor from this FuncGraph. + """ + # Check if the capture exists in self._by_ref + if key is not None and key in self._by_ref_internal: + return self._by_ref_internal[key] + if key is None: + key = len(self._by_ref_internal) + while key in self._by_ref_internal: + key += 1 + + value_nested = lam() + capture_trace_type = trace_type.from_value(value_nested) + ctx = trace_type.InternalPlaceholderContext(graph) + internal = capture_trace_type.placeholder_value(ctx) + + def lam_fn(): + # pytype: disable=attribute-error + value = lam() + return capture_trace_type.to_tensors(value) + # pytype: enable=attribute-error + + self._by_ref_external[key] = lam_fn + self._by_ref_internal[key] = internal + self._by_ref_tracetype[key] = capture_trace_type + return self._by_ref_internal[key] + + def merge_by_ref_with(self, other: "FunctionCaptures") -> None: + """Add by-ref captures from `other` to `self` if not exist.""" + assert isinstance(other, FunctionCaptures) + for key in other.by_ref_external: + if key not in self._by_ref_external: + self._by_ref_external[key] = other.by_ref_external[key] + self._by_ref_tracetype[key] = other.by_ref_tracetype[key] + + # TODO(panzf): Return structured values instead of flat tensors. + def get_by_ref_snapshot(self) -> Mapping[Hashable, Any]: + """Get a snapshot of current values of by-ref captures.""" + snapshot = {} + for key in self._by_ref_external: + func = self._by_ref_external[key] + try: + value = func() + except (AttributeError, RuntimeError): + # b/269680071 In case of by-ref captures are unavailable at dispatch + # time, use the predefined trace_type instead. + value = self._by_ref_tracetype[key] + snapshot[key] = value + return snapshot + + def _create_placeholder_helper( + self, graph: Any, tensor: core.Tensor, name: str + ): + """A helper function to create capture placeholder.""" + placeholder = self._by_val_internal.get(id(tensor)) + if placeholder is None: + tracing_ctx = trace_type.InternalTracingContext() + spec = trace_type.from_value(tensor, tracing_ctx) + spec._name = name # pylint: disable=protected-access + if isinstance(tensor, core.Value) and tensor.is_packed: + composite_device_name = tensor.device + else: + composite_device_name = None + placeholder_ctx = trace_type.InternalPlaceholderContext( + graph, + with_none_control_dependencies=True, + composite_device_name=composite_device_name, + ) + placeholder = spec.placeholder_value(placeholder_ctx) + self.add_or_replace( + key=id(tensor), external=tensor, internal=placeholder, is_by_ref=False + ) + graph.inputs.append(placeholder) + placeholder._record_tape(tensor) # pylint: disable=protected-access + return placeholder + + def _recompute_cached_properties(self): + """Regenerates cached properties if there have been mutations.""" + self._by_val_internal.mutated = False + self._by_val_external.mutated = False + assert len(self._by_val_internal) == len(self._by_val_external) + self._cached_by_val_capture_tuples = [] + for key in self._by_val_internal: + assert key in self._by_val_external + internal = self._by_val_internal[key] + external = self._by_val_external[key] + self._cached_by_val_capture_tuples.append((external, internal)) + + self._cached_capture_types = py_collections.OrderedDict( + list(self._by_val_tracetype.items()) + + list(self._by_ref_tracetype.items()) + ) + + @property + def capture_types(self): + if self._by_val_internal.mutated or self._by_val_external.mutated: + self._recompute_cached_properties() + return self._cached_capture_types + + @property + def by_val_capture_tuples(self): + if self._by_val_internal.mutated or self._by_val_external.mutated: + self._recompute_cached_properties() + return self._cached_by_val_capture_tuples + + @property + def by_ref_internal(self): + return self._by_ref_internal + + @property + def by_ref_external(self): + return self._by_ref_external + + @property + def by_ref_tracetype(self): + return self._by_ref_tracetype + + @property + def by_val_internal(self): + return self._by_val_internal + + @property + def by_val_external(self): + return self._by_val_external + + @property + def by_val_tracetype(self): + return self._by_val_tracetype diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/capture/restore_captures.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/capture/restore_captures.py new file mode 100644 index 0000000000000000000000000000000000000000..afdd0c6af6928728935a4ffc1f93059e20c2c337 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/capture/restore_captures.py @@ -0,0 +1,142 @@ +# Copyright 2023 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. +# ============================================================================== +# pylint: disable=unidiomatic-typecheck +"""A shim layer for working with functions exported/restored from saved models. + +This functionality should ultimately be moved into a first-class core API. +""" + +import warnings + +from tensorflow.core.function.polymorphism import function_type as function_type_lib +from tensorflow.python.framework import dtypes +from tensorflow.python.framework import ops +from tensorflow.python.framework import tensor_util +from tensorflow.python.ops import handle_data_util +from tensorflow.python.ops import resource_variable_ops +from tensorflow.python.ops import variables as variables_lib +from tensorflow.python.trackable import asset +from tensorflow.python.trackable import resource + + +def get_tensor_from_node(node): + """Resolves a saved model graph node into a tensor to be captured. + + Args: + node: a tensor, variable, or resource to be resolved into a capturable + tensor + + Returns: + A list of tensors. + Raises: + ValueError: if the node cannot be converted into a tensor. + """ + with ops.init_scope(): + # TODO(b/210144904): Use __tf_tensor__ instead of `is_[...]` checks + if getattr(node, "is_distributed_variable", False): + return node + elif getattr(node, "is_distributed_table", False): + return node + elif getattr(node, "is_sharded_variable", False): + return node + elif resource_variable_ops.is_resource_variable(node): + return node.handle + elif isinstance(node, asset.Asset): + return node.asset_path + elif tensor_util.is_tf_type(node): + return node + elif isinstance(node, resource.CapturableResource): + # Note: this executes restored functions in the CapturableResource. + return node.resource_handle + raise ValueError(f"Cannot convert node {node} to tensor.") + + +def restore_captures(concrete_function, inputs): + """Restore captures for the concrete function. + + Used at deserialization time. For functions that are being deserialized, + saved model restores objects that tensors were captured from, but functions + only know about their tensors -- object information is destroyed by tracing. + This additional logic extracts the tensors which the function originally + captured. + + Args: + concrete_function: the concrete function for which to restore captures + inputs: a list tensors or other Python objects (such as variables) which + contain tensors that were originally captured by the function + """ + bound_inputs = [get_tensor_from_node(obj) for obj in inputs] + # pylint: disable=g-complex-comprehension + bound_variables = [ + obj + for obj in inputs + if isinstance( + obj, + (variables_lib.Variable, resource_variable_ops.BaseResourceVariable), + ) + ] + # TODO(b/205010575): This is only injecting the captured inputs into the + # concrete function, note that we did not modify the FuncGraph + # itself. + captured_inputs_list = [] + concrete_function.set_variables(bound_variables) + if bound_inputs: + for bound_input, internal_capture in zip( + bound_inputs, concrete_function.inputs[-len(bound_inputs) :] + ): + # Distributed inputs have special logic for capturing, so we call their + # custom restoration methods + if hasattr(bound_input, "__tf_experimental_restore_capture__"): + captured_inputs_list.append( + bound_input.__tf_experimental_restore_capture__( + concrete_function, internal_capture + ) + ) + else: + captured_inputs_list.append(bound_input) + concrete_function.graph.replace_capture(bound_input, internal_capture) + if internal_capture.dtype == dtypes.resource: + if resource_variable_ops.is_resource_variable(bound_input): + try: + handle = bound_input.handle + except ValueError: + # For mirrored variables we'll copy handle data for components + # as they get captured. + pass + else: + handle_data_util.copy_handle_data(handle, internal_capture) + else: + # TODO(b/213451747): Remove need to call copy_handle_data + handle_data_util.copy_handle_data(bound_input, internal_capture) + # Setting "captures" first means "capture" won't create a new + # placeholder for this input. + concrete_function.graph.capture(bound_input) + + if any([inp is None for inp in captured_inputs_list]): + warnings.warn( + "Trying to load ShardedVariables using tf.saved_model.load. " + "This won't work if using a tf.distribute.Strategy, and may " + "use excess memory if not using a Strategy. Ignore this " + "warning if using tf.keras.models.load_model." + ) + concrete_function.set_external_captures(captured_inputs_list) + + # Update FunctionType with new captures. + if concrete_function.function_type: + concrete_function._function_type = function_type_lib.FunctionType( # pylint: disable=protected-access + concrete_function.function_type.parameters.values(), + concrete_function.graph.function_captures.capture_types, + return_annotation=concrete_function.function_type.output, + ) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/polymorphism/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/polymorphism/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/polymorphism/function_cache.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/polymorphism/function_cache.py new file mode 100644 index 0000000000000000000000000000000000000000..d22ff95b11a1050f369f9d6f476f24741cfd644d --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/polymorphism/function_cache.py @@ -0,0 +1,103 @@ +# Copyright 2021 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. +# ============================================================================== +"""Cache to manage functions based on their FunctionType.""" + +import collections +from typing import Any, NamedTuple, Optional + +from tensorflow.core.function.polymorphism import function_type as function_type_lib +from tensorflow.core.function.polymorphism import type_dispatch + + +class FunctionContext(NamedTuple): + """Contains information regarding tf.function execution context.""" + context: Any = None + scope_type: Any = None + + +class FunctionCache: + """A container for managing functions.""" + + __slots__ = ["_primary", "_dispatch_dict", "_garbage_collectors"] + + def __init__(self): + # Maps (FunctionContext, FunctionType) to a function. + self._primary = collections.OrderedDict() + + # Maps FunctionContext to a TypeDispatchTable containing FunctionTypes of + # that particular context. + self._dispatch_dict = {} + + def lookup(self, function_type: function_type_lib.FunctionType, + context: Optional[FunctionContext] = None) -> Optional[Any]: + """Looks up a function based on the context and type.""" + context = context or FunctionContext() + if context in self._dispatch_dict: + dispatch_type = self._dispatch_dict[context].dispatch(function_type) + if dispatch_type: + return self._primary[(context, dispatch_type)] + + return None + + def delete(self, function_type: function_type_lib.FunctionType, + context: Optional[FunctionContext] = None, + ) -> bool: + """Deletes a function given the context and type.""" + context = context or FunctionContext() + if (context, function_type) not in self._primary: + return False + + del self._primary[(context, function_type)] + self._dispatch_dict[context].delete(function_type) + + return True + + def add(self, fn: Any, context: Optional[FunctionContext] = None) -> None: + """Adds a new function using its function_type. + + Args: + fn: The function to be added to the cache. + context: A FunctionContext representing the current context. + """ + context = context or FunctionContext() + self._primary[(context, fn.function_type)] = fn + if context not in self._dispatch_dict: + self._dispatch_dict[context] = type_dispatch.TypeDispatchTable() + + self._dispatch_dict[context].add_target(fn.function_type) + + def generalize( + self, context: FunctionContext, + function_type: function_type_lib.FunctionType + ) -> function_type_lib.FunctionType: + """Try to generalize a FunctionType within a FunctionContext.""" + if context in self._dispatch_dict: + return self._dispatch_dict[context].try_generalizing_function_type( + function_type) + else: + return function_type + + # TODO(b/205971333): Remove this function. + def clear(self): + """Removes all functions from the cache.""" + self._primary.clear() + self._dispatch_dict.clear() + + def values(self): + """Returns a list of all functions held by this cache.""" + return list(self._primary.values()) + + def __len__(self): + return len(self._primary) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/polymorphism/function_type.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/polymorphism/function_type.py new file mode 100644 index 0000000000000000000000000000000000000000..e06dcedadab1666361855b640adad2b3ad0bc330 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/polymorphism/function_type.py @@ -0,0 +1,720 @@ +# Copyright 2022 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. +# ============================================================================== +"""Represents the types of TF functions.""" + +import collections +import inspect +from typing import Any, Callable, Dict, List, Mapping, Optional, Sequence, Tuple + +from absl import logging + +from tensorflow.core.function import trace_type +from tensorflow.core.function.polymorphism import function_type_pb2 +from tensorflow.core.function.trace_type import serialization +from tensorflow.python.types import core +from tensorflow.python.types import trace + + +# Represents a defined parameter default value that is saved alongside the +# function's captures. +class CapturedDefaultValue: + def __repr__(self): + return "" + + def __str__(self): + return "" + +CAPTURED_DEFAULT_VALUE = CapturedDefaultValue() + +PROTO_TO_PY_ENUM = { + function_type_pb2.Parameter.Kind.POSITIONAL_ONLY: + inspect.Parameter.POSITIONAL_ONLY, + function_type_pb2.Parameter.Kind.POSITIONAL_OR_KEYWORD: + inspect.Parameter.POSITIONAL_OR_KEYWORD, + function_type_pb2.Parameter.Kind.VAR_POSITIONAL: + inspect.Parameter.VAR_POSITIONAL, + function_type_pb2.Parameter.Kind.KEYWORD_ONLY: + inspect.Parameter.KEYWORD_ONLY, + function_type_pb2.Parameter.Kind.VAR_KEYWORD: + inspect.Parameter.VAR_KEYWORD, +} + +PY_TO_PROTO_ENUM = {v: k for k, v in PROTO_TO_PY_ENUM.items()} + + +class Parameter(inspect.Parameter): + """Represents a parameter to a function.""" + + def __init__(self, name: str, kind: Any, optional: bool, + type_constraint: Optional[trace.TraceType]): + if optional and kind not in [ + self.POSITIONAL_ONLY, self.KEYWORD_ONLY, self.POSITIONAL_OR_KEYWORD + ]: + raise ValueError( + "Parameter " + name + + " is optional and its kind must be one of {POSITIONAL_ONLY, " + + "KEYWORD_ONLY, POSITIONAL_OR_KEYWORD}. Got: " + str(kind)) + + if type_constraint and kind in [self.VAR_POSITIONAL, self.VAR_KEYWORD]: + raise TypeError("Variable args/kwargs can not have type constraints.") + + if not isinstance(type_constraint, (trace.TraceType, type(None))): + raise TypeError( + "Type constraints can only be an instance of a TraceType but got " + + "type_constraint=" + str(type_constraint) + " for Parameter " + name) + + super().__init__( + name, + kind, + default=CAPTURED_DEFAULT_VALUE if optional else self.empty, + annotation=type_constraint + if type_constraint is not None else self.empty) + + @classmethod + def from_proto(cls, proto: Any) -> "Parameter": + """Generate a Parameter from the proto representation.""" + deserialized_type_constraint = serialization.deserialize( + proto.type_constraint) if proto.HasField("type_constraint") else None + return Parameter(proto.name, PROTO_TO_PY_ENUM[proto.kind], + proto.is_optional, deserialized_type_constraint) + + def to_proto(self) -> function_type_pb2.Parameter: + """Generate a proto representation of the Parameter.""" + serialized_type_constraint = serialization.serialize( + self.type_constraint) if self.type_constraint else None + return function_type_pb2.Parameter( + name=self.name, + kind=PY_TO_PROTO_ENUM[self.kind], + is_optional=self.optional, + type_constraint=serialized_type_constraint) + + @property + def optional(self) -> bool: + """If this parameter might not be supplied for a call.""" + return self.default is not self.empty + + @property + def type_constraint(self) -> Optional[trace.TraceType]: + """A supertype that the parameter's type must subtype for validity.""" + return self.annotation if self.annotation is not self.empty else None + + def is_subtype_of(self, other: "Parameter") -> bool: + """Returns True if self is a supertype of other Parameter.""" + if not self.type_constraint or not other.type_constraint: + raise TypeError( + "Can not determine relationship between partially specified types.") + + if ((self.name, self.kind, self.optional) != + (other.name, other.kind, other.optional)): + return False + + return self.type_constraint.is_subtype_of(other.type_constraint) + + def most_specific_common_supertype( + self, others: Sequence["Parameter"]) -> Optional["Parameter"]: + """Returns a common supertype (if exists).""" + if not self.type_constraint or any( + not other.type_constraint for other in others): + raise TypeError( + "Can not determine relationship between partially specified types.") + + for other in others: + if ((self.name, self.kind, self.optional) != + (other.name, other.kind, other.optional)): + return None + + supertyped_constraint = self.type_constraint.most_specific_common_supertype( + [other.type_constraint for other in others]) + if supertyped_constraint: + return Parameter(self.name, self.kind, self.optional, + supertyped_constraint) + else: + return None + + def __eq__(self, other: Any) -> bool: + if not isinstance(other, Parameter): + return NotImplemented + + return ((self.name, self.kind, self.optional, + self.type_constraint) == (other.name, other.kind, other.optional, + other.type_constraint)) + + def __hash__(self): + return hash((self.name, self.kind, self.optional, self.type_constraint)) + + def __repr__(self): + return ("Parameter(name=" + self.name + ", kind=" + str(self.kind) + + ", optional=" + repr(self.optional) + ", type_constraint=" + + repr(self.type_constraint) + ")") + + def __reduce__(self): + return (self.__class__, (self.name, self.kind, self.optional, + self.type_constraint)) + + +class FunctionType(core.FunctionType): + """Represents the type of a TensorFlow function. + + FunctionType is the canonical way to represent the input/output contract of + all kinds of functions within the tf.function domain, including: + - Polymorphic Function + - Concrete Function + - Atomic Function + + It provides consistent, centralized and layered logic for: + - Canonicalization of Python input arguments + - Type-based dispatch to monomorphic functions + - Packing/unpacking structured python values to Tensors + - Generation of structured placeholder values for tracing + + Additionaly, it also provides: + - Lossless serialization + - Native integration with Python function signature representation + - Seamless migration from older representation formats + """ + + def __init__(self, + parameters: Sequence[inspect.Parameter], + captures: Optional[collections.OrderedDict] = None, + **kwargs): + super().__init__(parameters, **kwargs) + self._captures = captures if captures else collections.OrderedDict() + + @property + def parameters(self) -> Mapping[str, Any]: + """Returns an ordered mapping of parameter name to specification.""" + return super().parameters + + @property + def captures(self) -> collections.OrderedDict: + """Returns an ordered mapping of capture id to type.""" + return self._captures + + @property + def output(self) -> Optional[trace.TraceType]: + """Return the output TraceType if specified.""" + return ( + self.return_annotation + if self.return_annotation is not self.empty + else None + ) + + @classmethod + def from_callable(cls, + obj: Callable[..., Any], + *, + follow_wrapped: bool = True) -> "FunctionType": + """Generate FunctionType from a python Callable.""" + signature = super().from_callable(obj, follow_wrapped=follow_wrapped) + # TODO(fmuham): Support TraceType-based annotations. + parameters = [ + Parameter(p.name, p.kind, p.default is not p.empty, None) + for p in signature.parameters.values() + ] + + return FunctionType(parameters) + + @classmethod + def get_default_values(cls, + obj: Callable[..., Any], + *, + follow_wrapped: bool = True) -> Dict[str, Any]: + """Inspects and returns a dictionary of default values.""" + signature = super().from_callable(obj, follow_wrapped=follow_wrapped) + default_values = {} + for p in signature.parameters.values(): + if p.default is not p.empty: + default_values[p.name] = p.default + return default_values + + @classmethod + def from_proto(cls, proto: Any) -> "FunctionType": + """Generate a FunctionType from the proto representation.""" + return FunctionType([Parameter.from_proto(p) for p in proto.parameters], + collections.OrderedDict([ + (c.name, + serialization.deserialize(c.type_constraint)) + for c in proto.captures + ])) + + def to_proto(self) -> Any: + """Generate a proto representation from the FunctionType.""" + return function_type_pb2.FunctionType( + parameters=[p.to_proto() for p in self.parameters.values()], + captures=[ + function_type_pb2.Capture( + name=n, type_constraint=serialization.serialize(t)) + for n, t in self.captures.items() + ]) + + def bind_with_defaults(self, args, kwargs, default_values): + """Returns BoundArguments with default values filled in.""" + bound_arguments = self.bind(*args, **kwargs) + bound_arguments.apply_defaults() + + with_default_args = collections.OrderedDict() + for name, value in bound_arguments.arguments.items(): + if value is CAPTURED_DEFAULT_VALUE: + with_default_args[name] = default_values[name] + else: + with_default_args[name] = value + + for arg_name in with_default_args: + constraint = self.parameters[arg_name].type_constraint + if constraint: + with_default_args[arg_name] = constraint.cast( + with_default_args[arg_name], + trace_type.InternalCastContext(allow_specs=True), + ) + bound_arguments = inspect.BoundArguments(self, with_default_args) + return bound_arguments + + def is_supertype_of(self, other: "FunctionType") -> bool: + """Returns True if self is a supertype of other FunctionType.""" + if len(self.parameters) != len(other.parameters): + return False + + for self_param, other_param in zip(self.parameters.values(), + other.parameters.values()): + # Functions are contravariant on their parameter types. + if not self_param.is_subtype_of(other_param): + return False + + # Other must have all capture names of self. + if not all(name in other.captures for name in self.captures): + return False + + # Functions are contravariant upon the capture types. + return all(capture_type.is_subtype_of(other.captures[name]) + for name, capture_type in self.captures.items()) + + def most_specific_common_subtype( + self, others: Sequence["FunctionType"]) -> Optional["FunctionType"]: + """Returns a common subtype (if exists).""" + subtyped_parameters = [] + + for i, parameter in enumerate(self.parameters.values()): + # Functions are contravariant on their parameter types. + subtyped_parameter = parameter.most_specific_common_supertype( + [list(other.parameters.values())[i] for other in others]) + if subtyped_parameter is None: + return None + subtyped_parameters.append(subtyped_parameter) + + if not all(subtyped_parameters): + return None + + # Common subtype has superset of all captures. + capture_names = set(self.captures.keys()) + for other in others: + capture_names = capture_names.union(other.captures.keys()) + + subtyped_captures = collections.OrderedDict() + for name in capture_names: + containing = [t for t in [self, *others] if name in t.captures] + # Pick the first type that has the capture as the base. + base = containing[0] + relevant_others = containing[1:] + + # Functions are contravariant upon the capture types. + common_type = base.captures[name].most_specific_common_supertype( + [other.captures[name] for other in relevant_others] + ) + if common_type is None: + return None + else: + subtyped_captures[name] = common_type + + return FunctionType(subtyped_parameters, subtyped_captures) + + def placeholder_arguments( + self, placeholder_context: trace.PlaceholderContext + ) -> inspect.BoundArguments: + """Returns BoundArguments of values that can be used for tracing.""" + arguments = collections.OrderedDict() + for parameter in self.parameters.values(): + if parameter.kind in {Parameter.VAR_POSITIONAL, Parameter.VAR_KEYWORD}: + raise ValueError("Can not generate placeholder values for " + "variable length function type.") + + if not parameter.type_constraint: + raise ValueError("Can not generate placeholder value for " + "partially defined function type.") + placeholder_context.update_naming_scope(parameter.name) + arguments[parameter.name] = parameter.type_constraint.placeholder_value( + placeholder_context) + + return inspect.BoundArguments(self, arguments) + + @property + def flat_inputs(self) -> List[trace.TraceType]: + """Flat tensor inputs accepted by this FunctionType.""" + if not hasattr(self, "_cached_flat_inputs"): + cached_flat_inputs = [] + for p in self.parameters.values(): + cached_flat_inputs.extend(p.type_constraint.flatten()) + self._cached_flat_inputs = cached_flat_inputs + + return self._cached_flat_inputs + + def unpack_inputs( + self, bound_parameters: inspect.BoundArguments + ) -> List[core.Tensor]: + """Unpacks python arguments to flat tensor inputs accepted by this type.""" + # Sort keyword-only parameters by name. + sorted_parameters = [] + kwonly_parameters = [] + for p in self.parameters.values(): + if p.kind is Parameter.KEYWORD_ONLY: + kwonly_parameters.append(p) + else: + sorted_parameters.append(p) + sorted_parameters = sorted_parameters + sorted( + kwonly_parameters, key=lambda p: p.name + ) + + flat = [] + for p in sorted_parameters: + flat.extend( + p.type_constraint.to_tensors(bound_parameters.arguments[p.name]) + ) + + dealiased_inputs = [] + ids_used = set() + for tensor, input_type in zip(flat, self.flat_inputs): + alias_id = input_type._alias_id() # pylint: disable=protected-access + if alias_id is None or alias_id not in ids_used: + dealiased_inputs.append(tensor) + + if alias_id is not None: + ids_used.add(alias_id) + + return dealiased_inputs + + @property + def flat_captures(self) -> List[trace.TraceType]: + """Flat tensor captures needed by this FunctionType.""" + if not hasattr(self, "_cached_flat_captures"): + cached_flat_captures = [] + for t in self.captures.values(): + cached_flat_captures.extend(t.flatten()) + self._cached_flat_captures = cached_flat_captures + + return self._cached_flat_captures + + def unpack_captures(self, captures) -> List[core.Tensor]: + """Unpacks captures to flat tensors.""" + flat = [] + for v, t in zip(captures, self.captures.values()): + flat.extend(t.to_tensors(v)) + if len(flat) != len(self.flat_captures): + raise TypeError( + f"Flattening captures {captures} with type {self!r} produced" + f" {len(flat)} tensors instead of {len(self.flat_captures)}" + ) + return flat + + @property + def flat_outputs(self) -> List[trace.TraceType]: + """Flat tensor outputs returned by this FunctionType.""" + if not hasattr(self, "_cached_flat_outputs"): + if self.output is not None: + self._cached_flat_outputs = self.output.flatten() + + return self._cached_flat_outputs + + def pack_output(self, flat_values: Sequence[core.Tensor]) -> Any: + """Packs flat tensors to generate a value of the output type.""" + if flat_values is None: + flat_values = [] + + if self.output is None: + raise ValueError("Can not pack outputs for undefined output type.") + else: + return self.output.from_tensors(iter(flat_values)) + + def __eq__(self, other: Any) -> bool: + if not isinstance(other, FunctionType): + return NotImplemented + + return (self.parameters, self.captures) == (other.parameters, + other.captures) + + def __hash__(self) -> int: + return hash((tuple(self.parameters.items()), tuple(self.captures.items()))) + + def __repr__(self): + if hasattr(self, "_cached_repr"): + return self._cached_repr + + lines = ["Input Parameters:"] + for parameter in self.parameters.values(): + lines.append( + f" {parameter.name} ({parameter.kind}): {parameter.type_constraint}" + ) + + lines.append("Output Type:") + lines.append(f" {self.output}") + + lines.append("Captures:") + if self.captures: + for capture_id, capture_type in self.captures.items(): + lines.append(f" {capture_id}: {capture_type}") + else: + lines.append(" None") + + self._cached_repr = "\n".join(lines) + return self._cached_repr + + +MAX_SANITIZATION_WARNINGS = 5 +sanitization_warnings_given = 0 + + +# TODO(fmuham): In future, replace warning with exception. +# TODO(fmuham): Sanitize to graph node conventions. +def sanitize_arg_name(name: str) -> str: + """Sanitizes function argument names. + + Matches Python symbol naming rules. + + Without sanitization, names that are not legal Python parameter names can be + set which makes it challenging to represent callables supporting the named + calling capability. + + Args: + name: The name to sanitize. + + Returns: + A string that meets Python parameter conventions. + """ + # Replace non-alphanumeric chars with '_' + swapped = "".join([c if c.isalnum() else "_" for c in name]) + result = swapped if swapped[0].isalpha() else "arg_" + swapped + + global sanitization_warnings_given + if name != result and sanitization_warnings_given < MAX_SANITIZATION_WARNINGS: + logging.warning( + "`%s` is not a valid tf.function parameter name. Sanitizing to `%s`.", + name, result) + sanitization_warnings_given += 1 + + return result + + +# TODO(fmuham): Consider forcing kind to be always POSITIONAL_OR_KEYWORD. +def _make_validated_mono_param( + name, value, kind, type_context, poly_type +) -> Parameter: + """Generates and validates a parameter for Monomorphic FunctionType.""" + mono_type = trace_type.from_value(value, type_context) + + if poly_type and not mono_type.is_subtype_of(poly_type): + raise TypeError(f"Parameter `{name}` was expected to be of type " + f"{poly_type} but is {mono_type}") + + return Parameter(name, kind, False, mono_type) + + +def canonicalize_to_monomorphic( + args: Tuple[Any, ...], kwargs: Dict[Any, Any], default_values: Dict[Any, + Any], + capture_types: collections.OrderedDict, polymorphic_type: FunctionType +) -> Tuple[FunctionType, trace_type.InternalTracingContext]: + """Generates a monomorphic type out of polymorphic type for given args.""" + poly_bound_arguments = polymorphic_type.bind(*args, **kwargs) + + # Inject Default Values. + if default_values: + poly_bound_arguments.apply_defaults() + default_values_injected = poly_bound_arguments.arguments + for name, value in default_values_injected.items(): + if value is CAPTURED_DEFAULT_VALUE: + default_values_injected[name] = default_values[name] + poly_bound_arguments = inspect.BoundArguments( + poly_bound_arguments.signature, default_values_injected + ) + + parameters = [] + type_context = trace_type.InternalTracingContext() + has_var_positional = any(p.kind is Parameter.VAR_POSITIONAL + for p in polymorphic_type.parameters.values()) + + for name, arg in poly_bound_arguments.arguments.items(): + poly_parameter = polymorphic_type.parameters[name] + if (has_var_positional and + poly_parameter.kind is Parameter.POSITIONAL_OR_KEYWORD): + # If there is a VAR_POSITIONAL, all POSITIONAL_OR_KEYWORD become + # POSITIONAL_ONLY. + parameters.append( + _make_validated_mono_param(name, arg, Parameter.POSITIONAL_ONLY, + type_context, + poly_parameter.type_constraint)) + + elif poly_parameter.kind is Parameter.VAR_POSITIONAL: + # Unbundle VAR_POSITIONAL into individual POSITIONAL_ONLY args. + for i, value in enumerate(arg): + parameters.append( + _make_validated_mono_param(f"{poly_parameter.name}_{i}", value, + Parameter.POSITIONAL_ONLY, type_context, + poly_parameter.type_constraint)) + + elif poly_parameter.kind is Parameter.VAR_KEYWORD: + # Unbundle VAR_KEYWORD into individual KEYWORD_ONLY args. + for kwarg_name in sorted(arg.keys()): + parameters.append( + _make_validated_mono_param(kwarg_name, arg[kwarg_name], + Parameter.KEYWORD_ONLY, type_context, + poly_parameter.type_constraint)) + else: + parameters.append( + _make_validated_mono_param(name, arg, poly_parameter.kind, + type_context, + poly_parameter.type_constraint)) + + return FunctionType(parameters, capture_types), type_context + + +# TODO(fmuham): Share code with canonicalize_to_monomorphic. +# TODO(fmuham): Lift unnecessary restrictions on input_signature validity. +def add_type_constraints(function_type: FunctionType, input_signature: Any, + default_values: Dict[str, Any]) -> FunctionType: + """Adds type constraints to a FunctionType based on the input_signature.""" + context = trace_type.InternalTracingContext(is_legacy_signature=True) + constraints = [trace_type.from_value(c, context) for c in input_signature] + parameters = [] + + has_var_pos = any( + p.kind is p.VAR_POSITIONAL for p in function_type.parameters.values()) + + for param in function_type.parameters.values(): + # VAR_POSITIONAL does not allow POSITIONAL_OR_KEYWORD args. + sanitized_kind = ( + param.POSITIONAL_ONLY if has_var_pos and + param.kind is param.POSITIONAL_OR_KEYWORD else param.kind) + + if param.name == "self": + # Type constraints do not apply on them. + parameters.append(Parameter("self", sanitized_kind, param.optional, None)) + + elif param.kind is param.VAR_KEYWORD: + # Disabled when input_signature is specified. + continue + + elif param.kind is param.VAR_POSITIONAL: + # Convert into Positional Only args based on length of constraints. + for i in range(len(constraints)): + parameters.append( + Parameter(param.name + "_" + str(i), Parameter.POSITIONAL_ONLY, + False, constraints.pop(0))) + + elif (param.kind in [ + param.POSITIONAL_ONLY, param.POSITIONAL_OR_KEYWORD, param.KEYWORD_ONLY + ]): + if param.kind is param.KEYWORD_ONLY and param.name not in default_values: + raise TypeError( + "Since input_signature is defined, keyword-only parameter" + f" `{param.name}` must have a default value" + ) + + if constraints: + parameters.append( + Parameter(param.name, sanitized_kind, param.optional, + constraints.pop(0))) + elif param.name in default_values: + type_constraint = trace_type.from_value(default_values[param.name]) + parameters.append( + Parameter(param.name, sanitized_kind, param.optional, + type_constraint)) + else: + raise TypeError( + f"input_signature missing type constraint for {param.name}") + + if constraints: + raise TypeError( + f"input_signature contains {len(constraints)} extra type constraints.") + + return FunctionType(parameters) + + +def from_structured_signature( + input_signature=None, output_signature=None, capture_types=None +) -> FunctionType: + """Generates a FunctionType from legacy signature representation.""" + if input_signature is None: + input_signature = ((), {}) + + args, kwargs = input_signature + parameters = [] + + for i, arg in enumerate(args): + parameters.append( + Parameter( + "arg_" + str(i), + Parameter.POSITIONAL_ONLY, + False, + trace_type.from_value( + arg, trace_type.InternalTracingContext(is_legacy_signature=True) + ), + ) + ) + + for name, kwarg in kwargs.items(): + parameters.append( + Parameter( + sanitize_arg_name(name), + Parameter.KEYWORD_ONLY, + False, + trace_type.from_value( + kwarg, + trace_type.InternalTracingContext(is_legacy_signature=True), + ), + ) + ) + + return_type = trace_type.from_value( + output_signature, + trace_type.InternalTracingContext(is_legacy_signature=True), + ) + + return FunctionType( + parameters, capture_types or {}, return_annotation=return_type + ) + + +def to_structured_signature(function_type: FunctionType) -> Tuple[Any, Any]: + """Returns structured input and output signatures from a FunctionType.""" + def to_signature(x_type): + if x_type is None: + raise TypeError( + "Can not generate structured signature if FunctionType is not fully" + f" specified. Received {function_type}" + ) + return x_type.placeholder_value( + trace_type.InternalPlaceholderContext(unnest_only=True) + ) + + args_signature = [] + kwargs_signature = {} + for p in function_type.parameters.values(): + if p.kind == Parameter.POSITIONAL_ONLY: + args_signature.append(to_signature(p.type_constraint)) + else: + kwargs_signature[p.name] = to_signature(p.type_constraint) + + input_signature = (tuple(args_signature), kwargs_signature) + output_signature = to_signature(function_type.output) + + return input_signature, output_signature diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/polymorphism/function_type_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/polymorphism/function_type_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..c143163df8199aaa5cc039f9633738bba98f2fcc --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/polymorphism/function_type_pb2.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/function/polymorphism/function_type.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.function.trace_type import serialization_pb2 as tensorflow_dot_core_dot_function_dot_trace__type_dot_serialization__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n9tensorflow/core/function/polymorphism/function_type.proto\x12\x33tensorflow.core.function.polymorphism.function_type\x1a\x37tensorflow/core/function/trace_type/serialization.proto\"\xe0\x02\n\tParameter\x12\x0c\n\x04name\x18\x01 \x01(\t\x12Q\n\x04kind\x18\x02 \x01(\x0e\x32\x43.tensorflow.core.function.polymorphism.function_type.Parameter.Kind\x12\x13\n\x0bis_optional\x18\x03 \x01(\x08\x12_\n\x0ftype_constraint\x18\x04 \x01(\x0b\x32\x46.tensorflow.core.function.trace_type.serialization.SerializedTraceType\"|\n\x04Kind\x12\r\n\tUNDEFINED\x10\x00\x12\x13\n\x0fPOSITIONAL_ONLY\x10\x01\x12\x19\n\x15POSITIONAL_OR_KEYWORD\x10\x02\x12\x12\n\x0eVAR_POSITIONAL\x10\x03\x12\x10\n\x0cKEYWORD_ONLY\x10\x04\x12\x0f\n\x0bVAR_KEYWORD\x10\x05\"x\n\x07\x43\x61pture\x12\x0c\n\x04name\x18\x01 \x01(\t\x12_\n\x0ftype_constraint\x18\x02 \x01(\x0b\x32\x46.tensorflow.core.function.trace_type.serialization.SerializedTraceType\"\xb2\x01\n\x0c\x46unctionType\x12R\n\nparameters\x18\x01 \x03(\x0b\x32>.tensorflow.core.function.polymorphism.function_type.Parameter\x12N\n\x08\x63\x61ptures\x18\x02 \x03(\x0b\x32<.tensorflow.core.function.polymorphism.function_type.Capture') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.function.polymorphism.function_type_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + _PARAMETER._serialized_start=172 + _PARAMETER._serialized_end=524 + _PARAMETER_KIND._serialized_start=400 + _PARAMETER_KIND._serialized_end=524 + _CAPTURE._serialized_start=526 + _CAPTURE._serialized_end=646 + _FUNCTIONTYPE._serialized_start=649 + _FUNCTIONTYPE._serialized_end=827 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/polymorphism/type_dispatch.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/polymorphism/type_dispatch.py new file mode 100644 index 0000000000000000000000000000000000000000..0898e4676352411471145813e82e1b46ae955f6d --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/polymorphism/type_dispatch.py @@ -0,0 +1,131 @@ +# Copyright 2022 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. +# ============================================================================== +"""Polymorphic Type Dispatch.""" + +import collections +from typing import Optional, Iterable + +from tensorflow.core.function.polymorphism import function_type + +# The maximum number of dispatch lookups to cache. +_MAX_DISPATCH_CACHE = 1024 + + +class TypeDispatchTable: + """Type dispatch table implementation. + + A type dispatch table is a list, L, of target types. Given a request type, R, + the table selects a target type, T, according to the following dispatch rules: + 1. R == T or R is supertype of T (functions are contravariant on args) + 2. There does not exist O in L such that R is supertype of O and O is a + supertype of T (in other words, T is the closest to R, within list L). + 3. If the above two rules are satisfied by multiple targets, the earliest + inserted one is chosen. + """ + + def __init__(self): + """Creates a TypeDispatchTable object.""" + # Holds all inserted types as keys mapping to None. + # (Using OrderedDict as a set for determinism) + self._dispatch_table = collections.OrderedDict() + + # LRU cache for dispatch results. + # Maps request types to target types (see class description). + # Does not contain exact matches, i.e, if cache[a] is b then a is not b. + self._dispatch_cache = collections.OrderedDict() + + def add_target(self, target: function_type.FunctionType) -> None: + """Adds a new target type.""" + self._dispatch_table[target] = None + for request in self._dispatch_cache: + if target.is_supertype_of(self._dispatch_cache[request]): + self._dispatch_cache[request] = target + + @property + def targets(self) -> Iterable[function_type.FunctionType]: + """Returns an iterable to all targets in the table.""" + return self._dispatch_table.keys() + + def delete(self, target: function_type.FunctionType) -> None: + """Deletes a target in the table if it exists.""" + if target in self._dispatch_table: + del self._dispatch_table[target] + for request in list(self._dispatch_cache.keys()): + if self._dispatch_cache[request] == target: + del self._dispatch_cache[request] + + # TODO(b/205971333): remove once FunctionCache 'clear' is removed. + def clear(self) -> None: + """Deletes all targets in the table.""" + self._dispatch_table.clear() + self._dispatch_cache.clear() + + def dispatch( + self, request: function_type.FunctionType + ) -> Optional[function_type.FunctionType]: + """Returns the most specific supertype target if it exists in the table.""" + # For known exact matches. + if request in self._dispatch_table: + return request + + # For known non-exact matches. + # (self._dispatch cache does not contain exact matches) + if request in self._dispatch_cache: + # Move to the front of LRU cache. + result = self._dispatch_cache.pop(request) + self._dispatch_cache[request] = result + return result + + most_specific_supertype = None + for other in self._dispatch_table: + if request.is_supertype_of(other): + if most_specific_supertype is None or other.is_supertype_of( + most_specific_supertype): + most_specific_supertype = other + + self._cache_dispatch(request, most_specific_supertype) + return most_specific_supertype + + def _cache_dispatch(self, request, target): + """Caches the dispatch lookup result for a target.""" + if target is not None: + # LRU Cache removes oldest item + if len(self._dispatch_cache) > _MAX_DISPATCH_CACHE: + self._dispatch_cache.popitem(last=False) + self._dispatch_cache[request] = target + + def try_generalizing_function_type( + self, target: function_type.FunctionType) -> function_type.FunctionType: + """Returns a generalized subtype of the one given. + + This heuristic aims to reduce the number of future traces by computing a + type that represents more general function inputs. + + The original "experimental_relax_shapes" heuristic identified a known type + which shared a common subtype with the current unknown type and then + traced with that common subtype. However, the notion of "common subtype" + was only limited to shapes. This heuristic extends that to FunctionType. + + Returns `target` if a generalized subtype can not be found. + + Args: + target: The FunctionType to generalize + """ + relaxed = target + for other in self._dispatch_table: + subtype = relaxed.most_specific_common_subtype([other]) + if subtype is not None: + relaxed = subtype + return relaxed diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/trace_type/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/trace_type/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2ae2583b4274b6051e1efe537ce89e2d133cb00a --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/trace_type/__init__.py @@ -0,0 +1,38 @@ +# Copyright 2021 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. +# ============================================================================== +"""Trace-time type system for tf.function (TraceType). + +Trace-time types describe things like tf.function signatures and type +constraints in some ops. + +This module provides utilities and concrete tf.types.experimental.TraceType +definitions for common Python types like containers, along with a generic +implementation for Python objects. +See also: tf.types.experimental.TraceType + +Other implementations of TraceType include tf.TypeSpec and its subclasses. +""" + +from tensorflow.core.function.trace_type.default_types import register_tensor_type +from tensorflow.core.function.trace_type.default_types import Weakref +from tensorflow.core.function.trace_type.serialization import deserialize +from tensorflow.core.function.trace_type.serialization import register_serializable +from tensorflow.core.function.trace_type.serialization import Serializable +from tensorflow.core.function.trace_type.serialization import serialize +from tensorflow.core.function.trace_type.serialization import SerializedTraceType +from tensorflow.core.function.trace_type.trace_type_builder import from_value +from tensorflow.core.function.trace_type.trace_type_builder import InternalCastContext +from tensorflow.core.function.trace_type.trace_type_builder import InternalPlaceholderContext +from tensorflow.core.function.trace_type.trace_type_builder import InternalTracingContext diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/trace_type/custom_nest_trace_type.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/trace_type/custom_nest_trace_type.py new file mode 100644 index 0000000000000000000000000000000000000000..28216bfe8340a423c08c3895528fcb116a4afaeb --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/trace_type/custom_nest_trace_type.py @@ -0,0 +1,143 @@ +# Copyright 2023 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. +# ============================================================================== +"""TraceType implementations for classes thatimplement the CustomNestProtocol.""" + +from typing import Any, Iterator, List as PythonList, Optional, Sequence, Tuple as PythonTuple, Type + +from tensorflow.core.function.trace_type import util +from tensorflow.python.types import trace +from tensorflow.python.util import custom_nest_protocol + + +class CustomNestTraceType(trace.TraceType): + """Represents the TraceType of a class implmenting the CustomNestProtocol.""" + + def __init__( + self, + value_type: Type[Any], + metadata: Any, + components: PythonTuple[trace.TraceType], + ): + if not issubclass(value_type, custom_nest_protocol.CustomNestProtocol): + raise ValueError(f"{value_type!r} does not implement CustomNestProtocol.") + self.value_type = value_type + self.metadata = metadata + self.components = components + + def is_subtype_of(self, other: trace.TraceType) -> bool: + if not self._is_same_trace_type(other): + return False + for c_self, c_other in zip(self.components, other.components): # pytype: disable=attribute-error + if not c_self.is_subtype_of(c_other): + return False + return True + + def most_specific_common_supertype( + self, others: Sequence[trace.TraceType] + ) -> Optional["CustomNestTraceType"]: + for other in others: + if not self._is_same_trace_type(other): + return None + + others_components = [other.components for other in others] # pytype: disable=attribute-error + supertyped_components = tuple( + self_component.most_specific_common_supertype(others_component) + for self_component, *others_component in zip( + self.components, *others_components + ) + ) + return CustomNestTraceType( + self.value_type, self.metadata, supertyped_components + ) + + def __eq__(self, other: trace.TraceType) -> bool: + return ( + isinstance(other, CustomNestTraceType) + and self.value_type == other.value_type + and self.metadata == other.metadata + and self.components == other.components + ) + + def __hash__(self) -> int: + # The hash computation doesn't use self.metadata, so unhashable metadata can + # be used. The `self.__eq__` method is used instead to differentiate between + # two objects with the same components but different metadata. + return hash((self.value_type, self.components)) + + def __repr__(self) -> str: + return ( + f"{self.__class__.__name__} [metadata={self.metadata!r}, " + f"components={self.components!r}]" + ) + + def placeholder_value(self, placeholder_context: Any) -> Any: + components_placeholder_value = tuple( + c.placeholder_value(placeholder_context) for c in self.components + ) + return self.value_type.__tf_unflatten__( + self.metadata, components_placeholder_value + ) + + def to_tensors(self, value: Any) -> PythonList[Any]: + if not isinstance(value, self.value_type): + raise TypeError(f"{value!r} is not of type {self.value_type}.") + _, value_components = value.__tf_flatten__() + flattened_values = [] + for value_comp, type_comp in zip(value_components, self.components): + flattened_values.extend(type_comp.to_tensors(value_comp)) + return flattened_values + + def from_tensors(self, tensors: Iterator[Any]) -> Any: + return self.value_type.__tf_unflatten__( + self.metadata, tuple(c.from_tensors(tensors) for c in self.components) + ) + + def flatten(self) -> PythonList[trace.TraceType]: + flat_list = [] + for c in self.components: + flat_list.extend(c.flatten()) + return flat_list + + def cast(self, value: Any, casting_context: Any) -> Any: + if not isinstance(value, self.value_type): + raise TypeError(f"[{value!r}] is not of type {self.value_type}.") + value_metadata, value_components = value.__tf_flatten__() + if self.metadata != value_metadata: + raise ValueError( + f"Metadata mismatch: [{self.metadata!r}] != [{value_metadata!r}]." + ) + if len(self.components) != len(value_components): + raise ValueError( + f"Lengths of components mismatch: {len(self.components)} != " + f"{len(value_components)}." + ) + + casted_value_components, was_casted = util.cast_and_return_whether_casted( + self.components, value_components, casting_context + ) + if was_casted: + return self.value_type.__tf_unflatten__( + self.metadata, casted_value_components + ) + else: + return value + + def _is_same_trace_type(self, other: trace.TraceType) -> bool: + return ( + isinstance(other, CustomNestTraceType) + and self.value_type == other.value_type + and self.metadata == other.metadata + and len(self.components) == len(other.components) + ) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/trace_type/default_types.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/trace_type/default_types.py new file mode 100644 index 0000000000000000000000000000000000000000..d07bd43c8929d88d6822653128affbba72a5e8c9 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/trace_type/default_types.py @@ -0,0 +1,826 @@ +# Copyright 2021 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. +# ============================================================================== +"""TraceType implementations for common Python types.""" + +import collections +import math +import numbers +from typing import Any, Dict as PythonDict, Hashable, List as PythonList, Optional, Sequence, Tuple as PythonTuple, Type +import weakref + +from tensorflow.core.function.trace_type import default_types_pb2 +from tensorflow.core.function.trace_type import serialization +from tensorflow.core.function.trace_type import util +from tensorflow.python.types import trace + +# Register the TraceType of Tensor (aka TensorSpec) to avoid cyclic dependency. +TENSOR = None + + +def register_tensor_type(tensor_type): + global TENSOR + if not TENSOR: + TENSOR = tensor_type + else: + raise AssertionError("Tensor type is already registered.") + +NanMarker = object() + + +def is_nan(x): + """Checks if given value is a Python NaN.""" + if not isinstance(x, numbers.Number): + return False + + if isinstance(x, complex): + return math.isnan(x.real) or math.isnan(x.imag) + else: + return math.isnan(x) + + +class Literal(trace.TraceType, serialization.Serializable): + """Represents a Literal type like bool, int or string.""" + + def __init__(self, value: Any): + # We match nan values against each other even though Python doesn't. + if is_nan(value): + value = NanMarker + + self.value = value + self._value_hash = hash(value) + + def is_subtype_of(self, other: trace.TraceType) -> bool: + return self == other + + def most_specific_common_supertype( + self, types: Sequence[trace.TraceType]) -> Optional["Literal"]: + return self if all(self == other for other in types) else None + + @classmethod + def experimental_type_proto(cls) -> Type[default_types_pb2.SerializedLiteral]: + return default_types_pb2.SerializedLiteral + + @classmethod + def experimental_from_proto( + cls, proto: default_types_pb2.SerializedLiteral) -> "Literal": + if proto.HasField("bool_value"): + return Literal(proto.bool_value) + + if proto.HasField("int_value"): + return Literal(proto.int_value) + + if proto.HasField("float_value"): + return Literal(proto.float_value) + + if proto.HasField("str_value"): + return Literal(proto.str_value) + + if proto.HasField("none_value"): + return Literal(None) + + raise ValueError("Malformed Literal proto can not be deserialized") + + def experimental_as_proto(self) -> default_types_pb2.SerializedLiteral: + if isinstance(self.value, bool): + return default_types_pb2.SerializedLiteral(bool_value=self.value) + + if isinstance(self.value, int): + return default_types_pb2.SerializedLiteral(int_value=self.value) + + if isinstance(self.value, float): + return default_types_pb2.SerializedLiteral(float_value=self.value) + + if isinstance(self.value, str): + return default_types_pb2.SerializedLiteral(str_value=self.value) + + if self.value is None: + return default_types_pb2.SerializedLiteral( + none_value=default_types_pb2.SerializedLiteral.NoneValue()) + + raise ValueError("Can not serialize Literal of type " + + type(self.value).__name__) + + def placeholder_value(self, placeholder_context) -> Any: + # TODO(b/263505796): Remove this check when a range's placeholder output + # is expected to be a range and not a list. + if isinstance(self.value, range): + return list(self.value) + + if self.value is NanMarker: + return float("nan") + + return self.value + + def cast(self, value: Any, casting_context: Any) -> Any: + if self.value is NanMarker and is_nan(value): + return value + + if value == self.value: + return value + else: + raise ValueError(f"Can not cast {value!r} to {self!r}") + + def __eq__(self, other) -> bool: + if not isinstance(other, trace.TraceType): + return NotImplemented + + return isinstance(other, Literal) and self.value == other.value + + def __hash__(self) -> int: + return self._value_hash + + def __repr__(self) -> str: + return f"{self.__class__.__name__}[{self.value!r}]" + + +class Weakref(trace.TraceType): + """Represents weakref of an arbitrary Python object. + + When a function argument is a custom class, instead of making a copy of it + just for the sake of function cache, a weakref is instead kept to save memory. + """ + + def __init__(self, ref: weakref.ReferenceType): + self._ref = ref + self._ref_hash = hash(ref) + + def is_subtype_of(self, other: trace.TraceType) -> bool: + return self == other + + def most_specific_common_supertype( + self, types: Sequence[trace.TraceType]) -> Optional["Weakref"]: + return self if all(self == other for other in types) else None + + def placeholder_value(self, placeholder_context) -> Any: + return self._ref() + + def cast(self, value, _): + if value is self._ref() or value == self._ref(): + return value + + # We unwrap objects when generating the TraceType so we allow matching now. + while hasattr(value, "__wrapped__"): + value = value.__wrapped__ + if value is self._ref(): + return value + + raise ValueError(f"Can not cast {value!r} to {self!r}") + + def __eq__(self, other): + if not isinstance(other, trace.TraceType): + return NotImplemented + + if not isinstance(other, Weakref): + return False + + if self._ref() is None or other._ref() is None: + return False + + if self._ref() is other._ref(): + return True + + return self._ref == other._ref + + def __hash__(self): + return self._ref_hash + + def __repr__(self) -> str: + return f"{self.__class__.__name__}[{self._ref!r}])" + + +class Tuple(trace.TraceType, serialization.Serializable): + """Represents a tuple of TraceType objects.""" + + def __init__(self, *components: trace.TraceType): + self.components = components + + def is_subtype_of(self, other: trace.TraceType) -> bool: + if (not isinstance(other, Tuple) or + len(self.components) != len(other.components)): + return False + + return all( + self_component.is_subtype_of(other_component) for self_component, + other_component in zip(self.components, other.components)) + + def most_specific_common_supertype( + self, others: Sequence[trace.TraceType]) -> Optional["Tuple"]: + """See base class.""" + if not all( + isinstance(other, Tuple) and + len(self.components) == len(other.components) for other in others): + return None + + supertyped_components = [] + for i, component in enumerate(self.components): + supertyped_component = component.most_specific_common_supertype( + [other.components[i] for other in others]) + if supertyped_component is None: + return None + supertyped_components.append(supertyped_component) + + return Tuple(*supertyped_components) + + @classmethod + def experimental_type_proto(cls) -> Type[default_types_pb2.SerializedTuple]: + return default_types_pb2.SerializedTuple + + @classmethod + def experimental_from_proto( + cls, proto: default_types_pb2.SerializedTuple) -> "Tuple": + return Tuple(*[serialization.deserialize(c) for c in proto.components]) + + def experimental_as_proto(self) -> default_types_pb2.SerializedTuple: + return default_types_pb2.SerializedTuple( + components=[serialization.serialize(c) for c in self.components]) + + def placeholder_value(self, placeholder_context) -> Any: + components = [ + component.placeholder_value(placeholder_context) + for component in self.components + ] + return tuple(components) + + def to_tensors(self, value) -> Any: + assert isinstance(value, tuple) + flattened_values = [] + for comp_value, comp_type in zip(value, self.components): + flattened_values.extend(comp_type.to_tensors(comp_value)) + return flattened_values + + def from_tensors(self, tensors) -> Any: + return tuple(c.from_tensors(tensors) for c in self.components) + + def flatten(self) -> PythonList[trace.TraceType]: + flattened_types = [] + for component in self.components: + flattened_types.extend(component.flatten()) + return flattened_types + + def cast(self, value: Any, casting_context) -> Any: + assert isinstance(value, tuple), f"Can not cast {value!r} to tuple type." + assert len(value) == len( + self.components + ), f"Expected {value} to have length of {len(self.components)}" + + casted_values, was_casted = util.cast_and_return_whether_casted( + self.components, value, casting_context + ) + if was_casted: + return tuple(casted_values) + else: + return value + + def __eq__(self, other: Any) -> bool: + if not isinstance(other, trace.TraceType): + return NotImplemented + + if not isinstance(other, Tuple): + return False + + return self.components == other.components + + def __hash__(self) -> int: + return hash(self.components) + + def __repr__(self) -> str: + return f"Tuple[{', '.join(map(repr, self.components))}]" + + +class List(trace.TraceType, serialization.Serializable): + """Represents a list of TraceType objects.""" + + def __init__(self, *components: trace.TraceType): + self.components_tuple = Tuple(*components) + + def is_subtype_of(self, other: trace.TraceType) -> bool: + if not isinstance(other, List): + return False + + return self.components_tuple.is_subtype_of(other.components_tuple) + + def most_specific_common_supertype( + self, others: Sequence[trace.TraceType]) -> Optional["Tuple"]: + """See base class.""" + if not all(isinstance(other, List) for other in others): + return None + + supertyped_components_tuple = ( + self.components_tuple.most_specific_common_supertype( + [other.components_tuple for other in others] + ) + ) + + if supertyped_components_tuple is None: + return None + + return List(*supertyped_components_tuple.components) + + @classmethod + def experimental_type_proto(cls) -> Type[default_types_pb2.SerializedList]: + return default_types_pb2.SerializedList + + @classmethod + def experimental_from_proto( + cls, proto: default_types_pb2.SerializedList) -> "List": + return List( + *Tuple.experimental_from_proto(proto.components_tuple).components) + + def experimental_as_proto(self) -> default_types_pb2.SerializedList: + return default_types_pb2.SerializedList( + components_tuple=self.components_tuple.experimental_as_proto()) + + def placeholder_value(self, placeholder_context) -> Any: + return list(self.components_tuple.placeholder_value(placeholder_context)) + + def to_tensors(self, value): + assert isinstance(value, list) + return self.components_tuple.to_tensors(tuple(value)) + + def from_tensors(self, tensors) -> Any: + return list(self.components_tuple.from_tensors(tensors)) + + def flatten(self) -> PythonList[trace.TraceType]: + return self.components_tuple.flatten() + + def cast(self, value: Any, casting_context) -> Any: + assert isinstance(value, list), f"Can not cast {value!r} to list type." + assert len(value) == len( + self.components_tuple.components + ), f"Expected {value} to have length of {len(self.components_tuple)}" + + casted_values, was_casted = util.cast_and_return_whether_casted( + self.components_tuple.components, value, casting_context + ) + if was_casted: + return list(casted_values) + else: + return value + + def __eq__(self, other: Any) -> bool: + if not isinstance(other, trace.TraceType): + return NotImplemented + + if not isinstance(other, List): + return False + + return self.components_tuple == other.components_tuple + + def __hash__(self) -> int: + return hash(self.components_tuple) + + def __repr__(self) -> str: + return f"List[{', '.join(map(repr, self.components_tuple.components))}]" + + +class NamedTuple(trace.TraceType, serialization.Serializable): + """Represents a NamedTuple of TraceType objects.""" + + def __init__(self, + type_name: str, + attribute_names: PythonTuple[str], + attributes: PythonTuple[trace.TraceType], + placeholder_type: Optional[Type[Any]] = None): + self.type_name = type_name + self.attribute_names = attribute_names + self.attributes = Tuple(*attributes) + self._placeholder_type = placeholder_type + + @classmethod + def from_type_and_attributes( + cls, named_tuple_type: Any, + attributes: PythonTuple[trace.TraceType]) -> "NamedTuple": + return NamedTuple(named_tuple_type.__name__, named_tuple_type._fields, + attributes, named_tuple_type) + + def is_subtype_of(self, other: trace.TraceType) -> bool: + if not isinstance(other, NamedTuple): + return False + + return (self.type_name == other.type_name and + self.attribute_names == other.attribute_names and + self.attributes.is_subtype_of(other.attributes)) + + def most_specific_common_supertype( + self, others: Sequence[trace.TraceType]) -> Optional["NamedTuple"]: + """See base class.""" + if not all( + isinstance(other, NamedTuple) and self.type_name == other.type_name and + self.attribute_names == other.attribute_names for other in others): + return None + + supertyped_attributes = self.attributes.most_specific_common_supertype( + [other.attributes for other in others]) + + if supertyped_attributes is None: + return None + + return NamedTuple(self.type_name, self.attribute_names, + supertyped_attributes.components, self._placeholder_type) + + @classmethod + def experimental_type_proto( + cls) -> Type[default_types_pb2.SerializedNamedTuple]: + return default_types_pb2.SerializedNamedTuple + + @classmethod + def experimental_from_proto( + cls, proto: default_types_pb2.SerializedNamedTuple) -> "NamedTuple": + return NamedTuple( + proto.type_name, tuple(proto.attribute_names), + Tuple.experimental_from_proto(proto.attributes).components) + + def experimental_as_proto(self) -> default_types_pb2.SerializedNamedTuple: + return default_types_pb2.SerializedNamedTuple( + type_name=self.type_name, + attribute_names=list(self.attribute_names), + attributes=self.attributes.experimental_as_proto()) + + def placeholder_value(self, placeholder_context) -> Any: + if self._placeholder_type is None: + # We don't need to trace after serialization so it is not needed but we + # can generate a placeholder type using the description if ever needed. + raise ValueError("Can not generate placeholder value for NamedTuple with" + " unspecified placeholder_type. Note: placeholder_type " + "is lost during serialization.") + attribute_placeholders = [ + attribute.placeholder_value(placeholder_context) + for attribute in self.attributes.components + ] + return self._placeholder_type(*attribute_placeholders) + + def to_tensors(self, value: Any): + assert util.is_namedtuple(value) + flattened_values = [] + for attribute_name, attribute_type in zip( + self.attribute_names, self.attributes.components): + attribute_value = getattr(value, attribute_name) + flattened_values.extend(attribute_type.to_tensors(attribute_value)) + return flattened_values + + def from_tensors(self, tensors) -> Any: + if self._placeholder_type is None: + raise ValueError("Packing serialized NamedTuples is not supported.") + + return self._placeholder_type( + *[c.from_tensors(tensors) for c in self.attributes.components] + ) + + def flatten(self) -> PythonList[trace.TraceType]: + flattened_types = [] + + for component in self.attributes.components: + flattened_types.extend(component.flatten()) + + return flattened_types + + def cast(self, value: Any, casting_context) -> Any: + # Value must have same attributes with the TraceType + assert util.is_namedtuple( + value + ), f"Cannot cast {value!r} to type {self._placeholder_type!r}." + value_dict = value._asdict() + assert set(value_dict.keys()) == set( + self.attribute_names + ), f"{value!r} has different attributes with the TraceType {self!r}" + + casted_values, was_casted = util.cast_and_return_whether_casted( + self.attributes.components, + [getattr(value, name) for name in self.attribute_names], + casting_context, + ) + if was_casted: + return self._placeholder_type(*casted_values) + else: + return value + + def __hash__(self) -> int: + return hash((self.type_name, self.attribute_names, self.attributes)) + + def __eq__(self, other: Any) -> bool: + if not isinstance(other, trace.TraceType): + return NotImplemented + + if not isinstance(other, NamedTuple): + return False + + return (self.type_name == other.type_name and + self.attribute_names == other.attribute_names and + self.attributes == other.attributes) + + def __repr__(self) -> str: + paired = [ + f"[{n!r}, {c!r}]" + for n, c in zip(self.attribute_names, self.attributes.components) + ] + return f"{self.type_name}[{', '.join(paired)}]" + + +class Attrs(trace.TraceType): + """Represents a class annotated by attr.s.""" + + def __init__(self, + type_name: str, + attribute_names: PythonTuple[str], + attributes: PythonTuple[trace.TraceType], + placeholder_type: Optional[Type[Any]] = None): + self.named_attributes = NamedTuple(type_name, attribute_names, attributes) + self._placeholder_type = placeholder_type + + @classmethod + def from_type_and_attributes( + cls, attrs_type: Any, + attributes: PythonTuple[trace.TraceType]) -> "Attrs": + return Attrs(attrs_type.__name__, + tuple(attr.name for attr in attrs_type.__attrs_attrs__), + attributes, attrs_type) + + def is_subtype_of(self, other: trace.TraceType) -> bool: + if not isinstance(other, Attrs): + return False + + return self.named_attributes.is_subtype_of(other.named_attributes) + + def most_specific_common_supertype( + self, others: Sequence[trace.TraceType]) -> Optional["Attrs"]: + """See base class.""" + if not all(isinstance(other, Attrs) for other in others): + return None + + supertyped_attributes = ( + self.named_attributes.most_specific_common_supertype( + [other.named_attributes for other in others] + ) + ) + + if supertyped_attributes is None: + return None + + return Attrs(self.named_attributes.type_name, + self.named_attributes.attribute_names, + supertyped_attributes.attributes.components, + self._placeholder_type) + + @classmethod + def experimental_type_proto(cls) -> Type[default_types_pb2.SerializedAttrs]: + return default_types_pb2.SerializedAttrs + + @classmethod + def experimental_from_proto( + cls, proto: default_types_pb2.SerializedAttrs) -> "Attrs": + return Attrs( + proto.named_attributes.type_name, + tuple(proto.named_attributes.attribute_names), + Tuple.experimental_from_proto( + proto.named_attributes.attributes).components) + + def experimental_as_proto(self) -> default_types_pb2.SerializedAttrs: + return default_types_pb2.SerializedAttrs( + named_attributes=self.named_attributes.experimental_as_proto()) + + def placeholder_value(self, placeholder_context) -> Any: + if self._placeholder_type is None: + # We don't need to trace after serialization so it is not needed but we + # can generate a placeholder type using the description if ever needed. + raise ValueError("Can not generate placeholder value for Attrs with" + " unspecified placeholder_type. Note: placeholder_type " + "is lost during serialization.") + attribute_placeholders = [ + attribute.placeholder_value(placeholder_context) + for attribute in self.named_attributes.attributes.components + ] + return self._placeholder_type(*attribute_placeholders) + + def to_tensors(self, value: Any): + assert util.is_attrs(value) + flattened_values = [] + for attribute_name, attribute_type in zip( + self.named_attributes.attribute_names, + self.named_attributes.attributes.components): + attribute_value = getattr(value, attribute_name) + flattened_values.extend(attribute_type.to_tensors(attribute_value)) + return flattened_values + + def from_tensors(self, tensors): + if self._placeholder_type is None: + raise ValueError("Packing serialized NamedTuples is not supported.") + + return self._placeholder_type( + *[ + c.from_tensors(tensors) + for c in self.named_attributes.attributes.components + ] + ) + + def flatten(self) -> PythonList[trace.TraceType]: + flattened_types = [] + + for component in self.named_attributes.attributes.components: + flattened_types.extend(component.flatten()) + + return flattened_types + + def cast(self, value: Any, casting_context) -> Any: + assert util.is_attrs(value) + + attr_names = self.named_attributes.attribute_names + casted_values, was_casted = util.cast_and_return_whether_casted( + self.named_attributes.attributes.components, + [getattr(value, name) for name in attr_names], + casting_context, + ) + + if was_casted: + return self._placeholder_type(*casted_values) + else: + return value + + def __hash__(self) -> int: + return hash(self.named_attributes) + + def __eq__(self, other: Any) -> bool: + if not isinstance(other, trace.TraceType): + return NotImplemented + + if not isinstance(other, Attrs): + return False + + return self.named_attributes == other.named_attributes + + def __repr__(self) -> str: + name_component_zip = zip( + self.named_attributes.attribute_names, + self.named_attributes.attributes.components, + ) + paired = [f"[{n!r}, {c!r}]" for n, c in name_component_zip] + return f"{self.named_attributes.type_name}[{', '.join(paired)}]" + + +class Dict(trace.TraceType, serialization.Serializable): + """Represents a dictionary of TraceType objects. + + Attributes: + mapping: A mapping from keys to corresponding TraceTypes of the dict values. + """ + + def __init__(self, + mapping: PythonDict[Hashable, trace.TraceType], + placeholder_type: Optional[Type[Any]] = None): + self.mapping = mapping + self._placeholder_type = placeholder_type + + def _has_same_structure(self, other): + if not isinstance(other, Dict): + return False + + return self.mapping.keys() == other.mapping.keys() + + def is_subtype_of(self, other: trace.TraceType) -> bool: + """See base class.""" + if not self._has_same_structure(other): + return False + + # We need all keys to be present because there can be logic relying on + # their existence or lack thereof and hence can not guarantee subtype based + # on a subset or superset of keys. + # Only the tracing code can explicitly check for key dependencies and inform + # that decision. + return all(self.mapping[key].is_subtype_of(other.mapping[key]) + for key in self.mapping) + + def most_specific_common_supertype( + self, types: Sequence[trace.TraceType]) -> Optional["Dict"]: + """See base class.""" + if not all(self._has_same_structure(other) for other in types): + return None + + new_mapping = {} + for key in self.mapping.keys(): + common = self.mapping[key].most_specific_common_supertype( + [other.mapping[key] for other in types]) + if common is None: + return None + else: + new_mapping[key] = common + + return Dict(new_mapping, self._placeholder_type) + + @classmethod + def experimental_type_proto(cls) -> Type[default_types_pb2.SerializedDict]: + return default_types_pb2.SerializedDict + + @classmethod + def experimental_from_proto( + cls, proto: default_types_pb2.SerializedDict) -> "Dict": + return Dict({ + Literal.experimental_from_proto(k).value: serialization.deserialize(v) + for k, v in zip(proto.keys, proto.values) + }) + + def experimental_as_proto(self) -> default_types_pb2.SerializedDict: + return default_types_pb2.SerializedDict( + keys=[Literal(k).experimental_as_proto() for k in self.mapping.keys()], + values=[serialization.serialize(v) for v in self.mapping.values()]) + + def placeholder_value(self, placeholder_context) -> Any: + if self._placeholder_type is None: + raise ValueError("Can not generate placeholder value for Dict with" + " unspecified placeholder_type. Note: placeholder_type " + "is lost during serialization.") + attribute_placeholders = [ + (key, value.placeholder_value(placeholder_context)) + for key, value in self.mapping.items() + ] + if self._placeholder_type is collections.defaultdict: + return dict(attribute_placeholders) + return self._placeholder_type(attribute_placeholders) + + def to_tensors(self, value: Any): + assert isinstance(value, collections.abc.Mapping) + flattened_values = [] + for key in sorted(self.mapping.keys()): + comp_value, comp_type = value[key], self.mapping[key] + flattened_values.extend(comp_type.to_tensors(comp_value)) + return flattened_values + + def from_tensors(self, tensors): + if self._placeholder_type is None: + raise ValueError("Packing serialized Dict is not supported.") + + sorted_traversal = { + key: self.mapping[key].from_tensors(tensors) + for key in sorted(self.mapping) + } + + if self._placeholder_type is collections.defaultdict: + return {key: sorted_traversal[key] for key in self.mapping} + + return self._placeholder_type( + (key, sorted_traversal[key]) for key in self.mapping + ) + + def flatten(self) -> PythonList[trace.TraceType]: + flattened_types = [] + + for key in sorted(self.mapping.keys()): + flattened_types.extend(self.mapping[key].flatten()) + + return flattened_types + + def cast(self, value: Any, casting_context) -> Any: + # Value must have same keys with the TraceType + assert isinstance( + value, collections.abc.Mapping + ), f"Can not cast {value!r} to a Dict type." + assert set(value.keys()) == set( + self.mapping.keys() + ), f"{value!r} has different keys with the TraceType {self!r}." + + casted_values, was_casted = util.cast_and_return_whether_casted( + self.mapping.values(), + [value[k] for k in self.mapping.keys()], + casting_context, + ) + + if was_casted: + return self._placeholder_type( + **{k: v for k, v in zip(self.mapping.keys(), casted_values)} + ) + else: + return value + + def __eq__(self, other) -> bool: + if not isinstance(other, trace.TraceType): + return NotImplemented + + if not isinstance(other, Dict): + return False + + return self.mapping == other.mapping + + def __hash__(self) -> int: + return hash(frozenset(self.mapping.keys())) + + def __repr__(self) -> str: + paired = [f"[{n!r}, {t!r}]" for n, t in self.mapping.items()] + return f"{self.__class__.__name__}[{', '.join(paired)}]" + + +serialization.register_serializable(Literal) +serialization.register_serializable(Tuple) +serialization.register_serializable(List) +serialization.register_serializable(NamedTuple) +serialization.register_serializable(Attrs) +serialization.register_serializable(Dict) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/trace_type/default_types_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/trace_type/default_types_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..316c7ab33442978631fa41ae73bc09db7b2c9856 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/trace_type/default_types_pb2.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/function/trace_type/default_types.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.function.trace_type import serialization_pb2 as tensorflow_dot_core_dot_function_dot_trace__type_dot_serialization__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n7tensorflow/core/function/trace_type/default_types.proto\x12\x31tensorflow.core.function.trace_type.default_types\x1a\x37tensorflow/core/function/trace_type/serialization.proto\"\xe6\x01\n\x11SerializedLiteral\x12\x14\n\nbool_value\x18\x01 \x01(\x08H\x00\x12\x13\n\tint_value\x18\x02 \x01(\x03H\x00\x12\x15\n\x0b\x66loat_value\x18\x03 \x01(\x01H\x00\x12\x13\n\tstr_value\x18\x04 \x01(\tH\x00\x12\x64\n\nnone_value\x18\x05 \x01(\x0b\x32N.tensorflow.core.function.trace_type.default_types.SerializedLiteral.NoneValueH\x00\x1a\x0b\n\tNoneValueB\x07\n\x05value\"m\n\x0fSerializedTuple\x12Z\n\ncomponents\x18\x01 \x03(\x0b\x32\x46.tensorflow.core.function.trace_type.serialization.SerializedTraceType\"n\n\x0eSerializedList\x12\\\n\x10\x63omponents_tuple\x18\x01 \x01(\x0b\x32\x42.tensorflow.core.function.trace_type.default_types.SerializedTuple\"\x9a\x01\n\x14SerializedNamedTuple\x12\x11\n\ttype_name\x18\x01 \x01(\t\x12\x17\n\x0f\x61ttribute_names\x18\x02 \x03(\t\x12V\n\nattributes\x18\x03 \x01(\x0b\x32\x42.tensorflow.core.function.trace_type.default_types.SerializedTuple\"t\n\x0fSerializedAttrs\x12\x61\n\x10named_attributes\x18\x01 \x01(\x0b\x32G.tensorflow.core.function.trace_type.default_types.SerializedNamedTuple\"\xbc\x01\n\x0eSerializedDict\x12R\n\x04keys\x18\x01 \x03(\x0b\x32\x44.tensorflow.core.function.trace_type.default_types.SerializedLiteral\x12V\n\x06values\x18\x02 \x03(\x0b\x32\x46.tensorflow.core.function.trace_type.serialization.SerializedTraceType') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.function.trace_type.default_types_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + _SERIALIZEDLITERAL._serialized_start=168 + _SERIALIZEDLITERAL._serialized_end=398 + _SERIALIZEDLITERAL_NONEVALUE._serialized_start=378 + _SERIALIZEDLITERAL_NONEVALUE._serialized_end=389 + _SERIALIZEDTUPLE._serialized_start=400 + _SERIALIZEDTUPLE._serialized_end=509 + _SERIALIZEDLIST._serialized_start=511 + _SERIALIZEDLIST._serialized_end=621 + _SERIALIZEDNAMEDTUPLE._serialized_start=624 + _SERIALIZEDNAMEDTUPLE._serialized_end=778 + _SERIALIZEDATTRS._serialized_start=780 + _SERIALIZEDATTRS._serialized_end=896 + _SERIALIZEDDICT._serialized_start=899 + _SERIALIZEDDICT._serialized_end=1087 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/trace_type/serialization.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/trace_type/serialization.py new file mode 100644 index 0000000000000000000000000000000000000000..a1943e828a06025b6ee23f5488154cc6cb36715f --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/trace_type/serialization.py @@ -0,0 +1,100 @@ +# Copyright 2022 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. +# ============================================================================== +"""Utils for serializing and deserializing TraceTypes.""" + +import abc +from typing import Type + +from google.protobuf import message +from tensorflow.core.function.trace_type import serialization_pb2 + +SerializedTraceType = serialization_pb2.SerializedTraceType + +PROTO_CLASS_TO_PY_CLASS = {} + + +class Serializable(metaclass=abc.ABCMeta): + """TraceTypes implementing this additional interface are portable.""" + + @classmethod + @abc.abstractmethod + def experimental_type_proto(cls) -> Type[message.Message]: + """Returns the unique type of proto associated with this class.""" + raise NotImplementedError + + @classmethod + @abc.abstractmethod + def experimental_from_proto(cls, proto: message.Message) -> "Serializable": + """Returns an instance based on a proto.""" + raise NotImplementedError + + @abc.abstractmethod + def experimental_as_proto(self) -> message.Message: + """Returns a proto representing this instance.""" + raise NotImplementedError + + +def register_serializable(cls: Type[Serializable]): + """Registers a Python class to support serialization. + + Only register standard TF types. Custom types should NOT be registered. + + Args: + cls: Python class to register. + """ + if cls.experimental_type_proto() in PROTO_CLASS_TO_PY_CLASS: + raise ValueError( + "Existing Python class " + + PROTO_CLASS_TO_PY_CLASS[cls.experimental_type_proto()].__name__ + + " already has " + cls.experimental_type_proto().__name__ + + " as its associated proto representation. Please ensure " + + cls.__name__ + " has a unique proto representation.") + + PROTO_CLASS_TO_PY_CLASS[cls.experimental_type_proto()] = cls + + +def serialize(to_serialize: Serializable) -> SerializedTraceType: + """Converts Serializable to a proto SerializedTraceType.""" + + if not isinstance(to_serialize, Serializable): + raise ValueError("Can not serialize " + type(to_serialize).__name__ + + " since it is not Serializable. For object " + + str(to_serialize)) + actual_proto = to_serialize.experimental_as_proto() + + if not isinstance(actual_proto, to_serialize.experimental_type_proto()): + raise ValueError( + type(to_serialize).__name__ + + " returned different type of proto than specified by " + + "experimental_type_proto()") + + serialized = SerializedTraceType() + serialized.representation.Pack(actual_proto) + return serialized + + +def deserialize(proto: SerializedTraceType) -> Serializable: + """Converts a proto SerializedTraceType to instance of Serializable.""" + for proto_class in PROTO_CLASS_TO_PY_CLASS: + if proto.representation.Is(proto_class.DESCRIPTOR): + actual_proto = proto_class() + proto.representation.Unpack(actual_proto) + return PROTO_CLASS_TO_PY_CLASS[proto_class].experimental_from_proto( + actual_proto) + + raise ValueError( + "Can not deserialize proto of url: ", proto.representation.type_url, + " since no matching Python class could be found. For value ", + proto.representation.value) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/trace_type/serialization_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/trace_type/serialization_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..404a00e4114a676e114ad17e8e21b7e663140685 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/trace_type/serialization_pb2.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/function/trace_type/serialization.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n7tensorflow/core/function/trace_type/serialization.proto\x12\x31tensorflow.core.function.trace_type.serialization\x1a\x19google/protobuf/any.proto\"C\n\x13SerializedTraceType\x12,\n\x0erepresentation\x18\x01 \x01(\x0b\x32\x14.google.protobuf.Any') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.function.trace_type.serialization_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + _SERIALIZEDTRACETYPE._serialized_start=137 + _SERIALIZEDTRACETYPE._serialized_end=204 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/trace_type/serialization_test_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/trace_type/serialization_test_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..5488f681fafc129a1956ae2f0f9bd1177c4db5f3 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/trace_type/serialization_test_pb2.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/function/trace_type/serialization_test.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.function.trace_type import serialization_pb2 as tensorflow_dot_core_dot_function_dot_trace__type_dot_serialization__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n Hashable: + if global_id not in self._global_to_local_id: + self._global_to_local_id[global_id] = len(self._global_to_local_id) + + return self._global_to_local_id[global_id] + + def add_placeholder(self, alias_id: Hashable, variable) -> None: + self._alias_id_to_placeholder[alias_id] = variable + + def get_placeholder_mapping(self) -> Dict[Hashable, Any]: + return self._alias_id_to_placeholder + + @property + def is_legacy_signature(self) -> bool: + """If the value is from a legacy signature representation. + + Legacy signature representations include tf.function.input_signature and + ConcreteFunction.structured_input_signature. + """ + return self._is_legacy_signature + + +class InternalPlaceholderContext(trace.PlaceholderContext): + """Container with mappings shared across TraceTypes for placeholder values.""" + + def __init__(self, + context_graph=None, + placeholder_mapping=None, + unnest_only=False, + with_none_control_dependencies=False, + composite_device_name=None): + self._alias_id_to_placeholder = placeholder_mapping or {} + self._naming_scope = None + self._context_graph = context_graph + self._unnest_only = unnest_only + self._with_none_control_dependencies = with_none_control_dependencies + self._composite_device_name = composite_device_name + + def has_placeholder(self, alias_id: Hashable) -> bool: + return alias_id in self._alias_id_to_placeholder + + def get_placeholder(self, alias_id: Hashable) -> Hashable: + if not self.has_placeholder(alias_id): + raise KeyError(f"alias_id: {alias_id} not found in this instance of " + "placeholder context.") + return self._alias_id_to_placeholder[alias_id] + + def add_placeholder(self, alias_id: Hashable, placeholder: Hashable) -> None: + if alias_id in self._alias_id_to_placeholder: + raise KeyError(f"alias id: {alias_id} is already stored in this " + "instance of placeholder context.") + self._alias_id_to_placeholder[alias_id] = placeholder + + def update_naming_scope(self, naming_scope: Optional[str]) -> None: + self._naming_scope = naming_scope + + @property + def naming_scope(self) -> Optional[str]: + return self._naming_scope + + @property + def context_graph(self): + return self._context_graph + + @property + def unnest_only(self) -> bool: + return self._unnest_only + + @property + def with_none_control_dependencies(self) -> bool: + return self._with_none_control_dependencies + + @property + def composite_device_name(self) -> Any: + return self._composite_device_name + + +class InternalCastContext(trace.CastContext): + """Default casting behaviors.""" + + def __init__(self, allow_specs=False): + self._allow_specs = allow_specs + + @property + def allow_specs(self) -> bool: + """Allow TypeSpecs to be casted (instead of the actual CompositeTensors).""" + # Public APIs like get_concrete_function allow users to pass in specs + # instead which need to pass through input binding etc. + return self._allow_specs + + +def from_value(value: Any, + context: trace.TracingContext = None) -> trace.TraceType: + """Returns a TraceType corresponding to the value based on the context. + + Args: + value: The value to generate a TraceType for. + context: The TracingContext to be shared during protocol calls. + + Returns: + A TraceType object representing the given value. + """ + + if context is None: + context = InternalTracingContext() + + if context.is_legacy_signature and isinstance(value, trace.TraceType): + return value + elif isinstance(value, trace.SupportsTracingProtocol): + generated_type = value.__tf_tracing_type__(context) + if not isinstance(generated_type, trace.TraceType): + raise TypeError( + "Expected an instance of TraceType for Tracing Protocol call to " + + str(value) + " but got " + str(generated_type)) + return generated_type + + # TODO(b/183107079): Allow these once they're handled properly. + if isinstance(value, weakref.ref): + raise TypeError( + f"weakref input {value} not supported for tf.function." + ) + + if hasattr(value, "__wrapped__"): + return from_value(value.__wrapped__, context) + + if isinstance(value, list): + return default_types.List(*(from_value(c, context) for c in value)) + + if isinstance(value, tuple): + if util.is_namedtuple(value): + named_tuple_type = type(value) + return default_types.NamedTuple.from_type_and_attributes( + named_tuple_type, tuple(from_value(c, context) for c in value)) + else: + return default_types.Tuple(*(from_value(c, context) for c in value)) + + if isinstance(value, collections.abc.Mapping): + mapping_type = type(value) + return default_types.Dict( + {k: from_value(value[k], context) for k in value}, mapping_type) + + if util.is_attrs(value): + return default_types.Attrs.from_type_and_attributes( + type(value), + tuple( + from_value(getattr(value, a.name), context) + for a in value.__attrs_attrs__)) + + if util.is_np_ndarray(value): + ndarray = value.__array__() + return default_types.TENSOR(ndarray.shape, ndarray.dtype) + + if isinstance(value, custom_nest_protocol.CustomNestProtocol): + metadata, components = value.__tf_flatten__() + return custom_nest_trace_type.CustomNestTraceType( + type(value), metadata, tuple(from_value(c, context) for c in components) + ) + + try: + ref = weakref.ref(value) + if ref is None: + raise TypeError( + f"Deleted objects are not valid tf.function arguments, Got {value!r}") + else: + return default_types.Weakref(ref) + except TypeError: + try: + return default_types.Literal(value) + except: + raise TypeError( # pylint: disable=raise-missing-from + f"Could not generate a generic TraceType for {value!r}." + f"Please verify that it is immutable/hashable. Otheriwse, consider " + f"implementing the Tracing Protocol for it.") diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/trace_type/util.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/trace_type/util.py new file mode 100644 index 0000000000000000000000000000000000000000..899936b3d66a3b0d16acaa3e456d10ed9a0278e3 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/function/trace_type/util.py @@ -0,0 +1,52 @@ +# Copyright 2022 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. +# ============================================================================== +"""Utilities for the trace_type module.""" + +from typing import Any, List, Tuple + +import numpy as np + + +# TODO(b/225045380): Depend on the abstracted `leaf` lib from 'nest'. +def is_namedtuple(obj): + return hasattr(obj, "_fields") and all( + isinstance(field, str) for field in obj._fields) + + +# TODO(b/225045380): Depend on the abstracted `leaf` lib from 'nest'. +def is_attrs(obj): + return hasattr(type(obj), "__attrs_attrs__") + + +# TODO(b/225045380): Depend on the abstracted `leaf` lib from 'nest'. +def is_np_ndarray(value): + return hasattr(value, "__array__") and not ( + # For legacy reasons we do not automatically promote Numpy strings. + isinstance(value, np.str_) + # NumPy dtypes have __array__ as unbound methods. + or isinstance(value, type)) + + +def cast_and_return_whether_casted( + trace_types, values, context +) -> Tuple[List[Any], bool]: + did_cast = False + casted_values = [] + for t, v in zip(trace_types, values): + casted_v = t.cast(v, context) + casted_values.append(casted_v) + if casted_v is not v: + did_cast = True + return casted_values, did_cast diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/grappler/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/grappler/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/grappler/costs/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/grappler/costs/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/grappler/costs/op_performance_data_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/grappler/costs/op_performance_data_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..6f443400a652e94c0c3e70b243dd6cefd8986a73 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/grappler/costs/op_performance_data_pb2.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/grappler/costs/op_performance_data.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2 +from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2 +from tensorflow.core.framework import types_pb2 as tensorflow_dot_core_dot_framework_dot_types__pb2 +from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2 +from tensorflow.core.protobuf import device_properties_pb2 as tensorflow_dot_core_dot_protobuf_dot_device__properties__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n8tensorflow/core/grappler/costs/op_performance_data.proto\x12\ntensorflow\x1a&tensorflow/core/framework/tensor.proto\x1a,tensorflow/core/framework/tensor_shape.proto\x1a%tensorflow/core/framework/types.proto\x1a*tensorflow/core/framework/attr_value.proto\x1a\x30tensorflow/core/protobuf/device_properties.proto\"+\n\x0bSessionInfo\x12\x1c\n\x14intra_op_parallelism\x18\x01 \x01(\x03\"\xdb\x03\n\x06OpInfo\x12\n\n\x02op\x18\x01 \x01(\t\x12*\n\x04\x61ttr\x18\x02 \x03(\x0b\x32\x1c.tensorflow.OpInfo.AttrEntry\x12\x33\n\x06inputs\x18\x03 \x03(\x0b\x32#.tensorflow.OpInfo.TensorProperties\x12\x34\n\x07outputs\x18\x05 \x03(\x0b\x32#.tensorflow.OpInfo.TensorProperties\x12,\n\x06\x64\x65vice\x18\x04 \x01(\x0b\x32\x1c.tensorflow.DeviceProperties\x12-\n\x0csession_info\x18\x06 \x01(\x0b\x32\x17.tensorflow.SessionInfo\x1a\x42\n\tAttrEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12$\n\x05value\x18\x02 \x01(\x0b\x32\x15.tensorflow.AttrValue:\x02\x38\x01\x1a\x8c\x01\n\x10TensorProperties\x12#\n\x05\x64type\x18\x01 \x01(\x0e\x32\x14.tensorflow.DataType\x12+\n\x05shape\x18\x02 \x01(\x0b\x32\x1c.tensorflow.TensorShapeProto\x12&\n\x05value\x18\x03 \x01(\x0b\x32\x17.tensorflow.TensorProto\"/\n\x12NormalDistribution\x12\n\n\x02mu\x18\x01 \x01(\x01\x12\r\n\x05sigma\x18\x02 \x01(\x01\"2\n\x15LogNormalDistribution\x12\n\n\x02mu\x18\x01 \x01(\x01\x12\r\n\x05sigma\x18\x02 \x01(\x01\"\xf3\x04\n\rOpPerformance\x12\x1e\n\x02op\x18\x01 \x01(\x0b\x32\x12.tensorflow.OpInfo\x12\x31\n\x0csession_info\x18\x0c \x01(\x0b\x32\x17.tensorflow.SessionInfoB\x02\x18\x01\x12\x0c\n\x04node\x18\x05 \x01(\t\x12\x1d\n\x15temporary_memory_size\x18\x02 \x01(\x03\x12\x14\n\x0c\x63ompute_cost\x18\x03 \x01(\x03\x12\x14\n\x0c\x63ompute_time\x18\x06 \x01(\x03\x12\x13\n\x0bmemory_time\x18\x07 \x01(\x03\x12\x1a\n\x12\x63ompute_efficiency\x18\x04 \x01(\x01\x12\x19\n\x11memory_efficiency\x18\x08 \x01(\x01\x12?\n\x15\x65xecution_time_normal\x18\n \x01(\x0b\x32\x1e.tensorflow.NormalDistributionH\x00\x12\x46\n\x19\x65xecution_time_log_normal\x18\x0b \x01(\x0b\x32!.tensorflow.LogNormalDistributionH\x00\x12\x35\n\top_memory\x18\t \x01(\x0b\x32\".tensorflow.OpPerformance.OpMemory\x1a\x97\x01\n\x08OpMemory\x12\x15\n\routput_memory\x18\x01 \x03(\x03\x12\x13\n\x0btemp_memory\x18\x02 \x01(\x03\x12\x19\n\x11persistent_memory\x18\x04 \x01(\x03\x12\x1e\n\x12\x64\x65vice_temp_memory\x18\x03 \x01(\x03\x42\x02\x18\x01\x12$\n\x18\x64\x65vice_persistent_memory\x18\x05 \x01(\x03\x42\x02\x18\x01\x42\x10\n\x0e\x65xecution_time\"F\n\x11OpPerformanceList\x12\x31\n\x0eop_performance\x18\x01 \x03(\x0b\x32\x19.tensorflow.OpPerformanceB\x03\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.grappler.costs.op_performance_data_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\370\001\001' + _OPINFO_ATTRENTRY._options = None + _OPINFO_ATTRENTRY._serialized_options = b'8\001' + _OPPERFORMANCE_OPMEMORY.fields_by_name['device_temp_memory']._options = None + _OPPERFORMANCE_OPMEMORY.fields_by_name['device_temp_memory']._serialized_options = b'\030\001' + _OPPERFORMANCE_OPMEMORY.fields_by_name['device_persistent_memory']._options = None + _OPPERFORMANCE_OPMEMORY.fields_by_name['device_persistent_memory']._serialized_options = b'\030\001' + _OPPERFORMANCE.fields_by_name['session_info']._options = None + _OPPERFORMANCE.fields_by_name['session_info']._serialized_options = b'\030\001' + _SESSIONINFO._serialized_start=291 + _SESSIONINFO._serialized_end=334 + _OPINFO._serialized_start=337 + _OPINFO._serialized_end=812 + _OPINFO_ATTRENTRY._serialized_start=603 + _OPINFO_ATTRENTRY._serialized_end=669 + _OPINFO_TENSORPROPERTIES._serialized_start=672 + _OPINFO_TENSORPROPERTIES._serialized_end=812 + _NORMALDISTRIBUTION._serialized_start=814 + _NORMALDISTRIBUTION._serialized_end=861 + _LOGNORMALDISTRIBUTION._serialized_start=863 + _LOGNORMALDISTRIBUTION._serialized_end=913 + _OPPERFORMANCE._serialized_start=916 + _OPPERFORMANCE._serialized_end=1543 + _OPPERFORMANCE_OPMEMORY._serialized_start=1374 + _OPPERFORMANCE_OPMEMORY._serialized_end=1525 + _OPPERFORMANCELIST._serialized_start=1545 + _OPPERFORMANCELIST._serialized_end=1615 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/kernels/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/kernels/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/lib/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/lib/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/lib/core/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/lib/core/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/lib/core/error_codes_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/lib/core/error_codes_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..bf0546310a375e6eff757f90b3b77563a1382efc --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/lib/core/error_codes_pb2.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/lib/core/error_codes.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.tsl.protobuf import error_codes_pb2 as tsl_dot_protobuf_dot_error__codes__pb2 + +from tensorflow.tsl.protobuf.error_codes_pb2 import * + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*tensorflow/core/lib/core/error_codes.proto\x1a\x1etsl/protobuf/error_codes.protoP\x00\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.lib.core.error_codes_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/profiler/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/profiler/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/profiler/profile_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/profiler/profile_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..73d27da8c8b60762ef3c035114553e9122c60e30 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/profiler/profile_pb2.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/profiler/profile.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.tsl.profiler.protobuf import profile_pb2 as tsl_dot_profiler_dot_protobuf_dot_profile__pb2 + +from tensorflow.tsl.profiler.protobuf.profile_pb2 import * + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n&tensorflow/core/profiler/profile.proto\x12\x1dtensorflow.tfprof.pprof.dummy\x1a#tsl/profiler/protobuf/profile.protoP\x00\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.profiler.profile_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/profiler/profiler_options_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/profiler/profiler_options_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..f10a0688610aea5554c2c1e92763eeb8ad2e244d --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/profiler/profiler_options_pb2.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/profiler/profiler_options.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.tsl.profiler.protobuf import profiler_options_pb2 as tsl_dot_profiler_dot_protobuf_dot_profiler__options__pb2 + +from tensorflow.tsl.profiler.protobuf.profiler_options_pb2 import * + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n/tensorflow/core/profiler/profiler_options.proto\x12\x10tensorflow.dummy\x1a,tsl/profiler/protobuf/profiler_options.protoP\x00\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.profiler.profiler_options_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/profiler/protobuf/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/profiler/protobuf/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/profiler/protobuf/xplane_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/profiler/protobuf/xplane_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..f45dad0b1bbb181bcf4062e273bf63ae975ad11a --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/profiler/protobuf/xplane_pb2.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/profiler/protobuf/xplane.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.tsl.profiler.protobuf import xplane_pb2 as tsl_dot_profiler_dot_protobuf_dot_xplane__pb2 + +from tensorflow.tsl.profiler.protobuf.xplane_pb2 import * + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n.tensorflow/core/profiler/protobuf/xplane.proto\x12\x19tensorflow.profiler.empty\x1a\"tsl/profiler/protobuf/xplane.protoP\x00\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.profiler.protobuf.xplane_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/profiler/tfprof_log_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/profiler/tfprof_log_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..9f494dd038b415a610f90919d2729d10738d654f --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/profiler/tfprof_log_pb2.py @@ -0,0 +1,106 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/profiler/tfprof_log.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2 +from tensorflow.core.framework import step_stats_pb2 as tensorflow_dot_core_dot_framework_dot_step__stats__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n)tensorflow/core/profiler/tfprof_log.proto\x12\x11tensorflow.tfprof\x1a*tensorflow/core/framework/attr_value.proto\x1a*tensorflow/core/framework/step_stats.proto\"\xdf\x01\n\x07\x43odeDef\x12\x30\n\x06traces\x18\x01 \x03(\x0b\x32 .tensorflow.tfprof.CodeDef.Trace\x1a\xa1\x01\n\x05Trace\x12\x10\n\x04\x66ile\x18\x01 \x01(\tB\x02\x18\x01\x12\x0f\n\x07\x66ile_id\x18\x06 \x01(\x03\x12\x0e\n\x06lineno\x18\x02 \x01(\x05\x12\x14\n\x08\x66unction\x18\x03 \x01(\tB\x02\x18\x01\x12\x13\n\x0b\x66unction_id\x18\x07 \x01(\x03\x12\x10\n\x04line\x18\x04 \x01(\tB\x02\x18\x01\x12\x0f\n\x07line_id\x18\x08 \x01(\x03\x12\x17\n\x0f\x66unc_start_line\x18\x05 \x01(\x05\"j\n\nOpLogEntry\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tfloat_ops\x18\x02 \x01(\x03\x12\r\n\x05types\x18\x03 \x03(\t\x12,\n\x08\x63ode_def\x18\x04 \x01(\x0b\x32\x1a.tensorflow.tfprof.CodeDef\"\xb8\x01\n\nOpLogProto\x12\x32\n\x0blog_entries\x18\x01 \x03(\x0b\x32\x1d.tensorflow.tfprof.OpLogEntry\x12\x43\n\x0cid_to_string\x18\x02 \x03(\x0b\x32-.tensorflow.tfprof.OpLogProto.IdToStringEntry\x1a\x31\n\x0fIdToStringEntry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xd4\x02\n\x0cProfileProto\x12\x39\n\x05nodes\x18\x01 \x03(\x0b\x32*.tensorflow.tfprof.ProfileProto.NodesEntry\x12\x11\n\thas_trace\x18\x02 \x01(\x08\x12\x1f\n\x17miss_accelerator_stream\x18\x05 \x01(\x08\x12\r\n\x05steps\x18\x03 \x03(\x03\x12\x45\n\x0cid_to_string\x18\x04 \x03(\x0b\x32/.tensorflow.tfprof.ProfileProto.IdToStringEntry\x1aL\n\nNodesEntry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12-\n\x05value\x18\x02 \x01(\x0b\x32\x1e.tensorflow.tfprof.ProfileNode:\x02\x38\x01\x1a\x31\n\x0fIdToStringEntry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xd3\x08\n\x0bProfileNode\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\n\n\x02op\x18\t \x01(\t\x12\n\n\x02id\x18\r \x01(\x03\x12:\n\x06inputs\x18\x02 \x03(\x0b\x32*.tensorflow.tfprof.ProfileNode.InputsEntry\x12\x45\n\x0cinput_shapes\x18\x10 \x03(\x0b\x32/.tensorflow.tfprof.ProfileNode.InputShapesEntry\x12<\n\x07outputs\x18\x03 \x03(\x0b\x32+.tensorflow.tfprof.ProfileNode.OutputsEntry\x12G\n\routput_shapes\x18\x0f \x03(\x0b\x32\x30.tensorflow.tfprof.ProfileNode.OutputShapesEntry\x12L\n\x10src_output_index\x18\x0e \x03(\x0b\x32\x32.tensorflow.tfprof.ProfileNode.SrcOutputIndexEntry\x12\r\n\x05shape\x18\x04 \x03(\x03\x12\x10\n\x08op_types\x18\x05 \x03(\t\x12\x18\n\x10\x63\x61nonical_device\x18\x06 \x01(\t\x12\x13\n\x0bhost_device\x18\x07 \x01(\t\x12\x11\n\tfloat_ops\x18\x08 \x01(\x03\x12)\n\x05trace\x18\n \x01(\x0b\x32\x1a.tensorflow.tfprof.CodeDef\x12\x38\n\x05\x61ttrs\x18\x0b \x03(\x0b\x32).tensorflow.tfprof.ProfileNode.AttrsEntry\x12\x38\n\x05\x65xecs\x18\x0c \x03(\x0b\x32).tensorflow.tfprof.ProfileNode.ExecsEntry\x1a-\n\x0bInputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x1aL\n\x10InputShapesEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\'\n\x05value\x18\x02 \x01(\x0b\x32\x18.tensorflow.tfprof.Tuple:\x02\x38\x01\x1a.\n\x0cOutputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x1aM\n\x11OutputShapesEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\'\n\x05value\x18\x02 \x01(\x0b\x32\x18.tensorflow.tfprof.Tuple:\x02\x38\x01\x1a\x35\n\x13SrcOutputIndexEntry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\x1a\x43\n\nAttrsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12$\n\x05value\x18\x02 \x01(\x0b\x32\x15.tensorflow.AttrValue:\x02\x38\x01\x1aL\n\nExecsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12-\n\x05value\x18\x02 \x01(\x0b\x32\x1e.tensorflow.tfprof.ExecProfile:\x02\x38\x01\"\x84\x04\n\x0b\x45xecProfile\x12\x11\n\trun_count\x18\x01 \x01(\x03\x12\x18\n\x10\x61ll_start_micros\x18\x02 \x01(\x03\x12\x19\n\x11latest_end_micros\x18\x03 \x01(\x03\x12O\n\x11\x61\x63\x63\x65lerator_execs\x18\x04 \x03(\x0b\x32\x34.tensorflow.tfprof.ExecProfile.AcceleratorExecsEntry\x12?\n\tcpu_execs\x18\x05 \x03(\x0b\x32,.tensorflow.tfprof.ExecProfile.CpuExecsEntry\x12\x33\n\x0cmemory_execs\x18\x07 \x03(\x0b\x32\x1d.tensorflow.tfprof.ExecMemory\x12\x31\n\x0b\x61llocations\x18\x0b \x03(\x0b\x32\x1c.tensorflow.AllocationRecord\x12\x0f\n\x07\x64\x65vices\x18\x06 \x03(\t\x1aT\n\x15\x41\x63\x63\x65leratorExecsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12*\n\x05value\x18\x02 \x01(\x0b\x32\x1b.tensorflow.tfprof.ExecTime:\x02\x38\x01\x1aL\n\rCpuExecsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12*\n\x05value\x18\x02 \x01(\x0b\x32\x1b.tensorflow.tfprof.ExecTime:\x02\x38\x01\"3\n\x08\x45xecTime\x12\'\n\x05times\x18\x01 \x03(\x0b\x32\x18.tensorflow.tfprof.Tuple\"\xb4\x03\n\nExecMemory\x12\x15\n\rmemory_micros\x18\x01 \x01(\x03\x12\x17\n\x0fhost_temp_bytes\x18\x02 \x01(\x03\x12\x1d\n\x15host_persistent_bytes\x18\x03 \x01(\x03\x12\x1e\n\x16\x61\x63\x63\x65lerator_temp_bytes\x18\x04 \x01(\x03\x12$\n\x1c\x61\x63\x63\x65lerator_persistent_bytes\x18\x05 \x01(\x03\x12\x17\n\x0frequested_bytes\x18\x06 \x01(\x03\x12\x12\n\npeak_bytes\x18\x07 \x01(\x03\x12\x16\n\x0eresidual_bytes\x18\x08 \x01(\x03\x12\x14\n\x0coutput_bytes\x18\t \x01(\x03\x12\x1e\n\x16\x61llocator_bytes_in_use\x18\n \x01(\x03\x12\x46\n\routput_memory\x18\x0b \x03(\x0b\x32/.tensorflow.tfprof.ExecMemory.OutputMemoryEntry\x1aN\n\x11OutputMemoryEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12(\n\x05value\x18\x02 \x01(\x0b\x32\x19.tensorflow.tfprof.Memory:\x02\x38\x01\"\x1d\n\x05Tuple\x12\x14\n\x0cint64_values\x18\x01 \x03(\x03\"$\n\x06Memory\x12\r\n\x05\x62ytes\x18\x01 \x01(\x03\x12\x0b\n\x03ptr\x18\x02 \x01(\x04\x42RZPgithub.com/tensorflow/tensorflow/tensorflow/go/core/profiler/protos_all_go_protob\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.profiler.tfprof_log_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'ZPgithub.com/tensorflow/tensorflow/tensorflow/go/core/profiler/protos_all_go_proto' + _CODEDEF_TRACE.fields_by_name['file']._options = None + _CODEDEF_TRACE.fields_by_name['file']._serialized_options = b'\030\001' + _CODEDEF_TRACE.fields_by_name['function']._options = None + _CODEDEF_TRACE.fields_by_name['function']._serialized_options = b'\030\001' + _CODEDEF_TRACE.fields_by_name['line']._options = None + _CODEDEF_TRACE.fields_by_name['line']._serialized_options = b'\030\001' + _OPLOGPROTO_IDTOSTRINGENTRY._options = None + _OPLOGPROTO_IDTOSTRINGENTRY._serialized_options = b'8\001' + _PROFILEPROTO_NODESENTRY._options = None + _PROFILEPROTO_NODESENTRY._serialized_options = b'8\001' + _PROFILEPROTO_IDTOSTRINGENTRY._options = None + _PROFILEPROTO_IDTOSTRINGENTRY._serialized_options = b'8\001' + _PROFILENODE_INPUTSENTRY._options = None + _PROFILENODE_INPUTSENTRY._serialized_options = b'8\001' + _PROFILENODE_INPUTSHAPESENTRY._options = None + _PROFILENODE_INPUTSHAPESENTRY._serialized_options = b'8\001' + _PROFILENODE_OUTPUTSENTRY._options = None + _PROFILENODE_OUTPUTSENTRY._serialized_options = b'8\001' + _PROFILENODE_OUTPUTSHAPESENTRY._options = None + _PROFILENODE_OUTPUTSHAPESENTRY._serialized_options = b'8\001' + _PROFILENODE_SRCOUTPUTINDEXENTRY._options = None + _PROFILENODE_SRCOUTPUTINDEXENTRY._serialized_options = b'8\001' + _PROFILENODE_ATTRSENTRY._options = None + _PROFILENODE_ATTRSENTRY._serialized_options = b'8\001' + _PROFILENODE_EXECSENTRY._options = None + _PROFILENODE_EXECSENTRY._serialized_options = b'8\001' + _EXECPROFILE_ACCELERATOREXECSENTRY._options = None + _EXECPROFILE_ACCELERATOREXECSENTRY._serialized_options = b'8\001' + _EXECPROFILE_CPUEXECSENTRY._options = None + _EXECPROFILE_CPUEXECSENTRY._serialized_options = b'8\001' + _EXECMEMORY_OUTPUTMEMORYENTRY._options = None + _EXECMEMORY_OUTPUTMEMORYENTRY._serialized_options = b'8\001' + _CODEDEF._serialized_start=153 + _CODEDEF._serialized_end=376 + _CODEDEF_TRACE._serialized_start=215 + _CODEDEF_TRACE._serialized_end=376 + _OPLOGENTRY._serialized_start=378 + _OPLOGENTRY._serialized_end=484 + _OPLOGPROTO._serialized_start=487 + _OPLOGPROTO._serialized_end=671 + _OPLOGPROTO_IDTOSTRINGENTRY._serialized_start=622 + _OPLOGPROTO_IDTOSTRINGENTRY._serialized_end=671 + _PROFILEPROTO._serialized_start=674 + _PROFILEPROTO._serialized_end=1014 + _PROFILEPROTO_NODESENTRY._serialized_start=887 + _PROFILEPROTO_NODESENTRY._serialized_end=963 + _PROFILEPROTO_IDTOSTRINGENTRY._serialized_start=622 + _PROFILEPROTO_IDTOSTRINGENTRY._serialized_end=671 + _PROFILENODE._serialized_start=1017 + _PROFILENODE._serialized_end=2124 + _PROFILENODE_INPUTSENTRY._serialized_start=1672 + _PROFILENODE_INPUTSENTRY._serialized_end=1717 + _PROFILENODE_INPUTSHAPESENTRY._serialized_start=1719 + _PROFILENODE_INPUTSHAPESENTRY._serialized_end=1795 + _PROFILENODE_OUTPUTSENTRY._serialized_start=1797 + _PROFILENODE_OUTPUTSENTRY._serialized_end=1843 + _PROFILENODE_OUTPUTSHAPESENTRY._serialized_start=1845 + _PROFILENODE_OUTPUTSHAPESENTRY._serialized_end=1922 + _PROFILENODE_SRCOUTPUTINDEXENTRY._serialized_start=1924 + _PROFILENODE_SRCOUTPUTINDEXENTRY._serialized_end=1977 + _PROFILENODE_ATTRSENTRY._serialized_start=1979 + _PROFILENODE_ATTRSENTRY._serialized_end=2046 + _PROFILENODE_EXECSENTRY._serialized_start=2048 + _PROFILENODE_EXECSENTRY._serialized_end=2124 + _EXECPROFILE._serialized_start=2127 + _EXECPROFILE._serialized_end=2643 + _EXECPROFILE_ACCELERATOREXECSENTRY._serialized_start=2481 + _EXECPROFILE_ACCELERATOREXECSENTRY._serialized_end=2565 + _EXECPROFILE_CPUEXECSENTRY._serialized_start=2567 + _EXECPROFILE_CPUEXECSENTRY._serialized_end=2643 + _EXECTIME._serialized_start=2645 + _EXECTIME._serialized_end=2696 + _EXECMEMORY._serialized_start=2699 + _EXECMEMORY._serialized_end=3135 + _EXECMEMORY_OUTPUTMEMORYENTRY._serialized_start=3057 + _EXECMEMORY_OUTPUTMEMORYENTRY._serialized_end=3135 + _TUPLE._serialized_start=3137 + _TUPLE._serialized_end=3166 + _MEMORY._serialized_start=3168 + _MEMORY._serialized_end=3204 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/profiler/tfprof_options_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/profiler/tfprof_options_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..a19fc363a517d5751f5731fa9e25a476e587806a --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/profiler/tfprof_options_pb2.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/profiler/tfprof_options.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n-tensorflow/core/profiler/tfprof_options.proto\x12\x11tensorflow.tfprof\"\x95\x04\n\x0cOptionsProto\x12\x11\n\tmax_depth\x18\x01 \x01(\x03\x12\x11\n\tmin_bytes\x18\x02 \x01(\x03\x12\x16\n\x0emin_peak_bytes\x18\x13 \x01(\x03\x12\x1a\n\x12min_residual_bytes\x18\x14 \x01(\x03\x12\x18\n\x10min_output_bytes\x18\x15 \x01(\x03\x12\x12\n\nmin_micros\x18\x03 \x01(\x03\x12\x1e\n\x16min_accelerator_micros\x18\x16 \x01(\x03\x12\x16\n\x0emin_cpu_micros\x18\x17 \x01(\x03\x12\x12\n\nmin_params\x18\x04 \x01(\x03\x12\x15\n\rmin_float_ops\x18\x05 \x01(\x03\x12\x16\n\x0emin_occurrence\x18\x11 \x01(\x03\x12\x0c\n\x04step\x18\x12 \x01(\x03\x12\x10\n\x08order_by\x18\x07 \x01(\t\x12\x1c\n\x14\x61\x63\x63ount_type_regexes\x18\x08 \x03(\t\x12\x1a\n\x12start_name_regexes\x18\t \x03(\t\x12\x19\n\x11trim_name_regexes\x18\n \x03(\t\x12\x19\n\x11show_name_regexes\x18\x0b \x03(\t\x12\x19\n\x11hide_name_regexes\x18\x0c \x03(\t\x12!\n\x19\x61\x63\x63ount_displayed_op_only\x18\r \x01(\x08\x12\x0e\n\x06select\x18\x0e \x03(\t\x12\x0e\n\x06output\x18\x0f \x01(\t\x12\x14\n\x0c\x64ump_to_file\x18\x10 \x01(\t\"\xda\x02\n\x13\x41\x64visorOptionsProto\x12\x46\n\x08\x63heckers\x18\x01 \x03(\x0b\x32\x34.tensorflow.tfprof.AdvisorOptionsProto.CheckersEntry\x1a\x65\n\rCheckersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x43\n\x05value\x18\x02 \x01(\x0b\x32\x34.tensorflow.tfprof.AdvisorOptionsProto.CheckerOption:\x02\x38\x01\x1a\x93\x01\n\rCheckerOption\x12R\n\x07options\x18\x01 \x03(\x0b\x32\x41.tensorflow.tfprof.AdvisorOptionsProto.CheckerOption.OptionsEntry\x1a.\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.profiler.tfprof_options_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + _ADVISOROPTIONSPROTO_CHECKERSENTRY._options = None + _ADVISOROPTIONSPROTO_CHECKERSENTRY._serialized_options = b'8\001' + _ADVISOROPTIONSPROTO_CHECKEROPTION_OPTIONSENTRY._options = None + _ADVISOROPTIONSPROTO_CHECKEROPTION_OPTIONSENTRY._serialized_options = b'8\001' + _OPTIONSPROTO._serialized_start=69 + _OPTIONSPROTO._serialized_end=602 + _ADVISOROPTIONSPROTO._serialized_start=605 + _ADVISOROPTIONSPROTO._serialized_end=951 + _ADVISOROPTIONSPROTO_CHECKERSENTRY._serialized_start=700 + _ADVISOROPTIONSPROTO_CHECKERSENTRY._serialized_end=801 + _ADVISOROPTIONSPROTO_CHECKEROPTION._serialized_start=804 + _ADVISOROPTIONSPROTO_CHECKEROPTION._serialized_end=951 + _ADVISOROPTIONSPROTO_CHECKEROPTION_OPTIONSENTRY._serialized_start=905 + _ADVISOROPTIONSPROTO_CHECKEROPTION_OPTIONSENTRY._serialized_end=951 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/profiler/tfprof_output_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/profiler/tfprof_output_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..09c654f61271c9c7ba85574ad662b5001e140d12 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/profiler/tfprof_output_pb2.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/profiler/tfprof_output.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2 +from tensorflow.core.framework import types_pb2 as tensorflow_dot_core_dot_framework_dot_types__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,tensorflow/core/profiler/tfprof_output.proto\x12\x11tensorflow.tfprof\x1a,tensorflow/core/framework/tensor_shape.proto\x1a%tensorflow/core/framework/types.proto\"v\n\x11TFProfTensorProto\x12#\n\x05\x64type\x18\x01 \x01(\x0e\x32\x14.tensorflow.DataType\x12\x14\n\x0cvalue_double\x18\x02 \x03(\x01\x12\x13\n\x0bvalue_int64\x18\x03 \x03(\x03\x12\x11\n\tvalue_str\x18\x04 \x03(\t\"\x8e\x07\n\x0eGraphNodeProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12:\n\x0ctensor_value\x18\x0f \x01(\x0b\x32$.tensorflow.tfprof.TFProfTensorProto\x12\x11\n\trun_count\x18\x15 \x01(\x03\x12\x13\n\x0b\x65xec_micros\x18\x02 \x01(\x03\x12\x1f\n\x17\x61\x63\x63\x65lerator_exec_micros\x18\x11 \x01(\x03\x12\x17\n\x0f\x63pu_exec_micros\x18\x12 \x01(\x03\x12\x17\n\x0frequested_bytes\x18\x03 \x01(\x03\x12\x12\n\npeak_bytes\x18\x18 \x01(\x03\x12\x16\n\x0eresidual_bytes\x18\x19 \x01(\x03\x12\x14\n\x0coutput_bytes\x18\x1a \x01(\x03\x12\x12\n\nparameters\x18\x04 \x01(\x03\x12\x11\n\tfloat_ops\x18\r \x01(\x03\x12\x0f\n\x07\x64\x65vices\x18\n \x03(\t\x12\x1e\n\x16total_definition_count\x18\x17 \x01(\x03\x12\x17\n\x0ftotal_run_count\x18\x16 \x01(\x03\x12\x19\n\x11total_exec_micros\x18\x06 \x01(\x03\x12%\n\x1dtotal_accelerator_exec_micros\x18\x13 \x01(\x03\x12\x1d\n\x15total_cpu_exec_micros\x18\x14 \x01(\x03\x12\x1d\n\x15total_requested_bytes\x18\x07 \x01(\x03\x12\x18\n\x10total_peak_bytes\x18\x1b \x01(\x03\x12\x1c\n\x14total_residual_bytes\x18\x1c \x01(\x03\x12\x1a\n\x12total_output_bytes\x18\x1d \x01(\x03\x12\x18\n\x10total_parameters\x18\x08 \x01(\x03\x12\x17\n\x0ftotal_float_ops\x18\x0e \x01(\x03\x12,\n\x06shapes\x18\x0b \x03(\x0b\x32\x1c.tensorflow.TensorShapeProto\x12H\n\x0cinput_shapes\x18\x10 \x03(\x0b\x32\x32.tensorflow.tfprof.GraphNodeProto.InputShapesEntry\x12\x33\n\x08\x63hildren\x18\x0c \x03(\x0b\x32!.tensorflow.tfprof.GraphNodeProto\x1aP\n\x10InputShapesEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12+\n\x05value\x18\x02 \x01(\x0b\x32\x1c.tensorflow.TensorShapeProto:\x02\x38\x01\"\xed\x04\n\x13MultiGraphNodeProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x65xec_micros\x18\x02 \x01(\x03\x12\x1f\n\x17\x61\x63\x63\x65lerator_exec_micros\x18\x0c \x01(\x03\x12\x17\n\x0f\x63pu_exec_micros\x18\r \x01(\x03\x12\x17\n\x0frequested_bytes\x18\x03 \x01(\x03\x12\x12\n\npeak_bytes\x18\x10 \x01(\x03\x12\x16\n\x0eresidual_bytes\x18\x11 \x01(\x03\x12\x14\n\x0coutput_bytes\x18\x12 \x01(\x03\x12\x12\n\nparameters\x18\x04 \x01(\x03\x12\x11\n\tfloat_ops\x18\x05 \x01(\x03\x12\x19\n\x11total_exec_micros\x18\x06 \x01(\x03\x12%\n\x1dtotal_accelerator_exec_micros\x18\x0e \x01(\x03\x12\x1d\n\x15total_cpu_exec_micros\x18\x0f \x01(\x03\x12\x1d\n\x15total_requested_bytes\x18\x07 \x01(\x03\x12\x18\n\x10total_peak_bytes\x18\x13 \x01(\x03\x12\x1c\n\x14total_residual_bytes\x18\x14 \x01(\x03\x12\x1a\n\x12total_output_bytes\x18\x15 \x01(\x03\x12\x18\n\x10total_parameters\x18\x08 \x01(\x03\x12\x17\n\x0ftotal_float_ops\x18\t \x01(\x03\x12\x36\n\x0bgraph_nodes\x18\n \x03(\x0b\x32!.tensorflow.tfprof.GraphNodeProto\x12\x38\n\x08\x63hildren\x18\x0b \x03(\x0b\x32&.tensorflow.tfprof.MultiGraphNodeProto\"\xc2\x01\n\x0b\x41\x64viceProto\x12>\n\x08\x63heckers\x18\x01 \x03(\x0b\x32,.tensorflow.tfprof.AdviceProto.CheckersEntry\x1aW\n\rCheckersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x35\n\x05value\x18\x02 \x01(\x0b\x32&.tensorflow.tfprof.AdviceProto.Checker:\x02\x38\x01\x1a\x1a\n\x07\x43hecker\x12\x0f\n\x07reports\x18\x02 \x03(\tb\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.profiler.tfprof_output_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + _GRAPHNODEPROTO_INPUTSHAPESENTRY._options = None + _GRAPHNODEPROTO_INPUTSHAPESENTRY._serialized_options = b'8\001' + _ADVICEPROTO_CHECKERSENTRY._options = None + _ADVICEPROTO_CHECKERSENTRY._serialized_options = b'8\001' + _TFPROFTENSORPROTO._serialized_start=152 + _TFPROFTENSORPROTO._serialized_end=270 + _GRAPHNODEPROTO._serialized_start=273 + _GRAPHNODEPROTO._serialized_end=1183 + _GRAPHNODEPROTO_INPUTSHAPESENTRY._serialized_start=1103 + _GRAPHNODEPROTO_INPUTSHAPESENTRY._serialized_end=1183 + _MULTIGRAPHNODEPROTO._serialized_start=1186 + _MULTIGRAPHNODEPROTO._serialized_end=1807 + _ADVICEPROTO._serialized_start=1810 + _ADVICEPROTO._serialized_end=2004 + _ADVICEPROTO_CHECKERSENTRY._serialized_start=1889 + _ADVICEPROTO_CHECKERSENTRY._serialized_end=1976 + _ADVICEPROTO_CHECKER._serialized_start=1978 + _ADVICEPROTO_CHECKER._serialized_end=2004 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/bfc_memory_map_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/bfc_memory_map_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..228e9d87ab1af59ca05c5eaaa212ac62ca540de2 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/bfc_memory_map_pb2.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/bfc_memory_map.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.tsl.protobuf import bfc_memory_map_pb2 as tsl_dot_protobuf_dot_bfc__memory__map__pb2 + +from tensorflow.tsl.protobuf.bfc_memory_map_pb2 import * + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n-tensorflow/core/protobuf/bfc_memory_map.proto\x12\x10tensorflow.dummy\x1a!tsl/protobuf/bfc_memory_map.protoBWZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_protoP\x00\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.bfc_memory_map_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto' +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/cluster_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/cluster_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..1e63ea73b3f4382cb83dc982d972bf874370b7cd --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/cluster_pb2.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/cluster.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n&tensorflow/core/protobuf/cluster.proto\x12\ntensorflow\"r\n\x06JobDef\x12\x0c\n\x04name\x18\x01 \x01(\t\x12,\n\x05tasks\x18\x02 \x03(\x0b\x32\x1d.tensorflow.JobDef.TasksEntry\x1a,\n\nTasksEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"-\n\nClusterDef\x12\x1f\n\x03job\x18\x01 \x03(\x0b\x32\x12.tensorflow.JobDefB\x87\x01\n\x1aorg.tensorflow.distruntimeB\rClusterProtosP\x01ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.cluster_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\032org.tensorflow.distruntimeB\rClusterProtosP\001ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\370\001\001' + _JOBDEF_TASKSENTRY._options = None + _JOBDEF_TASKSENTRY._serialized_options = b'8\001' + _JOBDEF._serialized_start=54 + _JOBDEF._serialized_end=168 + _JOBDEF_TASKSENTRY._serialized_start=124 + _JOBDEF_TASKSENTRY._serialized_end=168 + _CLUSTERDEF._serialized_start=170 + _CLUSTERDEF._serialized_end=215 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/composite_tensor_variant_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/composite_tensor_variant_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..de1a9b6c5060edeb52bc55b5aaf6d04a1452ccfd --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/composite_tensor_variant_pb2.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/composite_tensor_variant.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.protobuf import struct_pb2 as tensorflow_dot_core_dot_protobuf_dot_struct__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n7tensorflow/core/protobuf/composite_tensor_variant.proto\x12\ntensorflow\x1a%tensorflow/core/protobuf/struct.proto\"T\n\x1e\x43ompositeTensorVariantMetadata\x12\x32\n\x0ftype_spec_proto\x18\x01 \x01(\x0b\x32\x19.tensorflow.TypeSpecProtoBWZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_protob\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.composite_tensor_variant_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto' + _COMPOSITETENSORVARIANTMETADATA._serialized_start=110 + _COMPOSITETENSORVARIANTMETADATA._serialized_end=194 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/config_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/config_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..dd242d57780e374f7793dd60b22922d0eeaeb6c1 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/config_pb2.py @@ -0,0 +1,88 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/config.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import cost_graph_pb2 as tensorflow_dot_core_dot_framework_dot_cost__graph__pb2 +from tensorflow.core.framework import graph_pb2 as tensorflow_dot_core_dot_framework_dot_graph__pb2 +from tensorflow.core.framework import step_stats_pb2 as tensorflow_dot_core_dot_framework_dot_step__stats__pb2 +from tensorflow.core.protobuf import cluster_pb2 as tensorflow_dot_core_dot_protobuf_dot_cluster__pb2 +from tensorflow.core.protobuf import debug_pb2 as tensorflow_dot_core_dot_protobuf_dot_debug__pb2 +from tensorflow.core.protobuf import rewriter_config_pb2 as tensorflow_dot_core_dot_protobuf_dot_rewriter__config__pb2 +from tensorflow.core.protobuf import rpc_options_pb2 as tensorflow_dot_core_dot_protobuf_dot_rpc__options__pb2 +try: + tsl_dot_protobuf_dot_rpc__options__pb2 = tensorflow_dot_core_dot_protobuf_dot_rpc__options__pb2.tsl_dot_protobuf_dot_rpc__options__pb2 +except AttributeError: + tsl_dot_protobuf_dot_rpc__options__pb2 = tensorflow_dot_core_dot_protobuf_dot_rpc__options__pb2.tsl.protobuf.rpc_options_pb2 +from tensorflow.tsl.protobuf import coordination_config_pb2 as tsl_dot_protobuf_dot_coordination__config__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n%tensorflow/core/protobuf/config.proto\x12\ntensorflow\x1a*tensorflow/core/framework/cost_graph.proto\x1a%tensorflow/core/framework/graph.proto\x1a*tensorflow/core/framework/step_stats.proto\x1a&tensorflow/core/protobuf/cluster.proto\x1a$tensorflow/core/protobuf/debug.proto\x1a.tensorflow/core/protobuf/rewriter_config.proto\x1a*tensorflow/core/protobuf/rpc_options.proto\x1a&tsl/protobuf/coordination_config.proto\"\xea\x07\n\nGPUOptions\x12\'\n\x1fper_process_gpu_memory_fraction\x18\x01 \x01(\x01\x12\x14\n\x0c\x61llow_growth\x18\x04 \x01(\x08\x12\x16\n\x0e\x61llocator_type\x18\x02 \x01(\t\x12\x1f\n\x17\x64\x65\x66\x65rred_deletion_bytes\x18\x03 \x01(\x03\x12\x1b\n\x13visible_device_list\x18\x05 \x01(\t\x12\"\n\x1apolling_active_delay_usecs\x18\x06 \x01(\x05\x12$\n\x1cpolling_inactive_delay_msecs\x18\x07 \x01(\x05\x12\x1c\n\x14\x66orce_gpu_compatible\x18\x08 \x01(\x08\x12\x39\n\x0c\x65xperimental\x18\t \x01(\x0b\x32#.tensorflow.GPUOptions.Experimental\x1a\xa3\x05\n\x0c\x45xperimental\x12K\n\x0fvirtual_devices\x18\x01 \x03(\x0b\x32\x32.tensorflow.GPUOptions.Experimental.VirtualDevices\x12#\n\x1bnum_virtual_devices_per_gpu\x18\x0f \x01(\x05\x12\x1a\n\x12use_unified_memory\x18\x02 \x01(\x08\x12#\n\x1bnum_dev_to_dev_copy_streams\x18\x03 \x01(\x05\x12\x1d\n\x15\x63ollective_ring_order\x18\x04 \x01(\t\x12\x1d\n\x15timestamped_allocator\x18\x05 \x01(\x08\x12#\n\x1bkernel_tracker_max_interval\x18\x07 \x01(\x05\x12 \n\x18kernel_tracker_max_bytes\x18\x08 \x01(\x05\x12\"\n\x1akernel_tracker_max_pending\x18\t \x01(\x05\x12\'\n\x1finternal_fragmentation_fraction\x18\n \x01(\x01\x12\x1d\n\x15use_cuda_malloc_async\x18\x0b \x01(\x08\x12,\n$disallow_retry_on_allocation_failure\x18\x0c \x01(\x08\x12 \n\x18gpu_host_mem_limit_in_mb\x18\r \x01(\x02\x12$\n\x1cgpu_host_mem_disallow_growth\x18\x0e \x01(\x08\x12$\n\x1cgpu_system_memory_size_in_mb\x18\x10 \x01(\x05\x1aS\n\x0eVirtualDevices\x12\x17\n\x0fmemory_limit_mb\x18\x01 \x03(\x02\x12\x10\n\x08priority\x18\x02 \x03(\x05\x12\x16\n\x0e\x64\x65vice_ordinal\x18\x03 \x03(\x05\"\x9d\x03\n\x10OptimizerOptions\x12+\n#do_common_subexpression_elimination\x18\x01 \x01(\x08\x12\x1b\n\x13\x64o_constant_folding\x18\x02 \x01(\x08\x12$\n\x1cmax_folded_constant_in_bytes\x18\x06 \x01(\x03\x12\x1c\n\x14\x64o_function_inlining\x18\x04 \x01(\x08\x12\x35\n\topt_level\x18\x03 \x01(\x0e\x32\".tensorflow.OptimizerOptions.Level\x12\x45\n\x10global_jit_level\x18\x05 \x01(\x0e\x32+.tensorflow.OptimizerOptions.GlobalJitLevel\x12\x16\n\x0e\x63pu_global_jit\x18\x07 \x01(\x08\" \n\x05Level\x12\x06\n\x02L1\x10\x00\x12\x0f\n\x02L0\x10\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\"C\n\x0eGlobalJitLevel\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x00\x12\x10\n\x03OFF\x10\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x12\x08\n\x04ON_1\x10\x01\x12\x08\n\x04ON_2\x10\x02\"\xee\x02\n\x0cGraphOptions\x12\x1e\n\x16\x65nable_recv_scheduling\x18\x02 \x01(\x08\x12\x37\n\x11optimizer_options\x18\x03 \x01(\x0b\x32\x1c.tensorflow.OptimizerOptions\x12\x18\n\x10\x62uild_cost_model\x18\x04 \x01(\x03\x12\x1e\n\x16\x62uild_cost_model_after\x18\t \x01(\x03\x12\x14\n\x0cinfer_shapes\x18\x05 \x01(\x08\x12\x1a\n\x12place_pruned_graph\x18\x06 \x01(\x08\x12 \n\x18\x65nable_bfloat16_sendrecv\x18\x07 \x01(\x08\x12\x15\n\rtimeline_step\x18\x08 \x01(\x05\x12\x33\n\x0frewrite_options\x18\n \x01(\x0b\x32\x1a.tensorflow.RewriterConfigJ\x04\x08\x01\x10\x02R%skip_common_subexpression_elimination\"A\n\x15ThreadPoolOptionProto\x12\x13\n\x0bnum_threads\x18\x01 \x01(\x05\x12\x13\n\x0bglobal_name\x18\x02 \x01(\t\"0\n\x0fSessionMetadata\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\x03\"\x95\x0f\n\x0b\x43onfigProto\x12>\n\x0c\x64\x65vice_count\x18\x01 \x03(\x0b\x32(.tensorflow.ConfigProto.DeviceCountEntry\x12$\n\x1cintra_op_parallelism_threads\x18\x02 \x01(\x05\x12$\n\x1cinter_op_parallelism_threads\x18\x05 \x01(\x05\x12\x1f\n\x17use_per_session_threads\x18\t \x01(\x08\x12G\n\x1csession_inter_op_thread_pool\x18\x0c \x03(\x0b\x32!.tensorflow.ThreadPoolOptionProto\x12\x18\n\x10placement_period\x18\x03 \x01(\x05\x12\x16\n\x0e\x64\x65vice_filters\x18\x04 \x03(\t\x12+\n\x0bgpu_options\x18\x06 \x01(\x0b\x32\x16.tensorflow.GPUOptions\x12\x1c\n\x14\x61llow_soft_placement\x18\x07 \x01(\x08\x12\x1c\n\x14log_device_placement\x18\x08 \x01(\x08\x12/\n\rgraph_options\x18\n \x01(\x0b\x32\x18.tensorflow.GraphOptions\x12\x1f\n\x17operation_timeout_in_ms\x18\x0b \x01(\x03\x12+\n\x0brpc_options\x18\r \x01(\x0b\x32\x16.tensorflow.RPCOptions\x12+\n\x0b\x63luster_def\x18\x0e \x01(\x0b\x32\x16.tensorflow.ClusterDef\x12\x1d\n\x15isolate_session_state\x18\x0f \x01(\x08\x12(\n share_cluster_devices_in_session\x18\x11 \x01(\x08\x12:\n\x0c\x65xperimental\x18\x10 \x01(\x0b\x32$.tensorflow.ConfigProto.Experimental\x1a\x32\n\x10\x44\x65viceCountEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\x1a\x8f\t\n\x0c\x45xperimental\x12\x1f\n\x17\x63ollective_group_leader\x18\x01 \x01(\t\x12\x15\n\rexecutor_type\x18\x03 \x01(\t\x12\x1a\n\x12recv_buf_max_chunk\x18\x04 \x01(\x05\x12\x19\n\x11use_numa_affinity\x18\x05 \x01(\x08\x12\x35\n-collective_deterministic_sequential_execution\x18\x06 \x01(\x08\x12\x17\n\x0f\x63ollective_nccl\x18\x07 \x01(\x08\x12\x36\n.share_session_state_in_clusterspec_propagation\x18\x08 \x01(\x08\x12\x1f\n\x17\x64isable_thread_spinning\x18\t \x01(\x08\x12(\n share_cluster_devices_in_session\x18\n \x01(\x08\x12\x35\n\x10session_metadata\x18\x0b \x01(\x0b\x32\x1b.tensorflow.SessionMetadata\x12!\n\x19optimize_for_static_graph\x18\x0c \x01(\x08\x12\x1a\n\x12\x65nable_mlir_bridge\x18\r \x01(\x08\x12S\n\x13mlir_bridge_rollout\x18\x11 \x01(\x0e\x32\x36.tensorflow.ConfigProto.Experimental.MlirBridgeRollout\x12&\n\x1e\x65nable_mlir_graph_optimization\x18\x10 \x01(\x08\x12\'\n\x1f\x64isable_output_partition_graphs\x18\x0e \x01(\x08\x12#\n\x1bxla_fusion_autotuner_thresh\x18\x0f \x01(\x03\x12\x10\n\x08use_tfrt\x18\x12 \x01(\x08\x12\'\n\x1f\x64isable_functional_ops_lowering\x18\x15 \x01(\x08\x12\'\n\x1fxla_prefer_single_graph_cluster\x18\x16 \x01(\x08\x12\x42\n\x13\x63oordination_config\x18\x17 \x01(\x0b\x32%.tensorflow.CoordinationServiceConfig\x12)\n!disable_optimize_for_static_graph\x18\x18 \x01(\x08\x12\x30\n(disable_eager_executor_streaming_enqueue\x18\x1a \x01(\x08\"\xde\x01\n\x11MlirBridgeRollout\x12#\n\x1fMLIR_BRIDGE_ROLLOUT_UNSPECIFIED\x10\x00\x12\x1f\n\x1bMLIR_BRIDGE_ROLLOUT_ENABLED\x10\x01\x12 \n\x1cMLIR_BRIDGE_ROLLOUT_DISABLED\x10\x02\"\x04\x08\x03\x10\x03\"\x04\x08\x04\x10\x04*%MLIR_BRIDGE_ROLLOUT_SAFE_MODE_ENABLED*.MLIR_BRIDGE_ROLLOUT_SAFE_MODE_FALLBACK_ENABLEDJ\x04\x08\x02\x10\x03J\x04\x08\x13\x10\x14J\x04\x08\x14\x10\x15J\x04\x08\x19\x10\x1a\"\xe1\x04\n\nRunOptions\x12\x36\n\x0btrace_level\x18\x01 \x01(\x0e\x32!.tensorflow.RunOptions.TraceLevel\x12\x15\n\rtimeout_in_ms\x18\x02 \x01(\x03\x12\x1c\n\x14inter_op_thread_pool\x18\x03 \x01(\x05\x12\x1f\n\x17output_partition_graphs\x18\x05 \x01(\x08\x12/\n\rdebug_options\x18\x06 \x01(\x0b\x32\x18.tensorflow.DebugOptions\x12*\n\"report_tensor_allocations_upon_oom\x18\x07 \x01(\x08\x12\x39\n\x0c\x65xperimental\x18\x08 \x01(\x0b\x32#.tensorflow.RunOptions.Experimental\x1a\xd2\x01\n\x0c\x45xperimental\x12\x1c\n\x14\x63ollective_graph_key\x18\x01 \x01(\x03\x12\x1c\n\x14use_run_handler_pool\x18\x02 \x01(\x08\x12[\n\x18run_handler_pool_options\x18\x03 \x01(\x0b\x32\x39.tensorflow.RunOptions.Experimental.RunHandlerPoolOptions\x1a)\n\x15RunHandlerPoolOptions\x12\x10\n\x08priority\x18\x01 \x01(\x03\"R\n\nTraceLevel\x12\x0c\n\x08NO_TRACE\x10\x00\x12\x12\n\x0eSOFTWARE_TRACE\x10\x01\x12\x12\n\x0eHARDWARE_TRACE\x10\x02\x12\x0e\n\nFULL_TRACE\x10\x03J\x04\x08\x04\x10\x05\"\xbe\x03\n\x0bRunMetadata\x12)\n\nstep_stats\x18\x01 \x01(\x0b\x32\x15.tensorflow.StepStats\x12,\n\ncost_graph\x18\x02 \x01(\x0b\x32\x18.tensorflow.CostGraphDef\x12.\n\x10partition_graphs\x18\x03 \x03(\x0b\x32\x14.tensorflow.GraphDef\x12?\n\x0f\x66unction_graphs\x18\x04 \x03(\x0b\x32&.tensorflow.RunMetadata.FunctionGraphs\x12\x35\n\x10session_metadata\x18\x05 \x01(\x0b\x32\x1b.tensorflow.SessionMetadata\x1a\xad\x01\n\x0e\x46unctionGraphs\x12.\n\x10partition_graphs\x18\x01 \x03(\x0b\x32\x14.tensorflow.GraphDef\x12\x34\n\x16pre_optimization_graph\x18\x02 \x01(\x0b\x32\x14.tensorflow.GraphDef\x12\x35\n\x17post_optimization_graph\x18\x03 \x01(\x0b\x32\x14.tensorflow.GraphDef\":\n\x10TensorConnection\x12\x13\n\x0b\x66rom_tensor\x18\x01 \x01(\t\x12\x11\n\tto_tensor\x18\x02 \x01(\t\"\xb0\x03\n\x0f\x43\x61llableOptions\x12\x0c\n\x04\x66\x65\x65\x64\x18\x01 \x03(\t\x12\r\n\x05\x66\x65tch\x18\x02 \x03(\t\x12\x0e\n\x06target\x18\x03 \x03(\t\x12+\n\x0brun_options\x18\x04 \x01(\x0b\x32\x16.tensorflow.RunOptions\x12\x37\n\x11tensor_connection\x18\x05 \x03(\x0b\x32\x1c.tensorflow.TensorConnection\x12\x42\n\x0c\x66\x65\x65\x64_devices\x18\x06 \x03(\x0b\x32,.tensorflow.CallableOptions.FeedDevicesEntry\x12\x44\n\rfetch_devices\x18\x07 \x03(\x0b\x32-.tensorflow.CallableOptions.FetchDevicesEntry\x12\x17\n\x0f\x66\x65tch_skip_sync\x18\x08 \x01(\x08\x1a\x32\n\x10\x46\x65\x65\x64\x44\x65vicesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11\x46\x65tchDevicesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x84\x01\n\x18org.tensorflow.frameworkB\x0c\x43onfigProtosP\x01ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.config_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\014ConfigProtosP\001ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\370\001\001' + _CONFIGPROTO_DEVICECOUNTENTRY._options = None + _CONFIGPROTO_DEVICECOUNTENTRY._serialized_options = b'8\001' + _CALLABLEOPTIONS_FEEDDEVICESENTRY._options = None + _CALLABLEOPTIONS_FEEDDEVICESENTRY._serialized_options = b'8\001' + _CALLABLEOPTIONS_FETCHDEVICESENTRY._options = None + _CALLABLEOPTIONS_FETCHDEVICESENTRY._serialized_options = b'8\001' + _GPUOPTIONS._serialized_start=391 + _GPUOPTIONS._serialized_end=1393 + _GPUOPTIONS_EXPERIMENTAL._serialized_start=718 + _GPUOPTIONS_EXPERIMENTAL._serialized_end=1393 + _GPUOPTIONS_EXPERIMENTAL_VIRTUALDEVICES._serialized_start=1310 + _GPUOPTIONS_EXPERIMENTAL_VIRTUALDEVICES._serialized_end=1393 + _OPTIMIZEROPTIONS._serialized_start=1396 + _OPTIMIZEROPTIONS._serialized_end=1809 + _OPTIMIZEROPTIONS_LEVEL._serialized_start=1708 + _OPTIMIZEROPTIONS_LEVEL._serialized_end=1740 + _OPTIMIZEROPTIONS_GLOBALJITLEVEL._serialized_start=1742 + _OPTIMIZEROPTIONS_GLOBALJITLEVEL._serialized_end=1809 + _GRAPHOPTIONS._serialized_start=1812 + _GRAPHOPTIONS._serialized_end=2178 + _THREADPOOLOPTIONPROTO._serialized_start=2180 + _THREADPOOLOPTIONPROTO._serialized_end=2245 + _SESSIONMETADATA._serialized_start=2247 + _SESSIONMETADATA._serialized_end=2295 + _CONFIGPROTO._serialized_start=2298 + _CONFIGPROTO._serialized_end=4239 + _CONFIGPROTO_DEVICECOUNTENTRY._serialized_start=3019 + _CONFIGPROTO_DEVICECOUNTENTRY._serialized_end=3069 + _CONFIGPROTO_EXPERIMENTAL._serialized_start=3072 + _CONFIGPROTO_EXPERIMENTAL._serialized_end=4239 + _CONFIGPROTO_EXPERIMENTAL_MLIRBRIDGEROLLOUT._serialized_start=3993 + _CONFIGPROTO_EXPERIMENTAL_MLIRBRIDGEROLLOUT._serialized_end=4215 + _RUNOPTIONS._serialized_start=4242 + _RUNOPTIONS._serialized_end=4851 + _RUNOPTIONS_EXPERIMENTAL._serialized_start=4551 + _RUNOPTIONS_EXPERIMENTAL._serialized_end=4761 + _RUNOPTIONS_EXPERIMENTAL_RUNHANDLERPOOLOPTIONS._serialized_start=4720 + _RUNOPTIONS_EXPERIMENTAL_RUNHANDLERPOOLOPTIONS._serialized_end=4761 + _RUNOPTIONS_TRACELEVEL._serialized_start=4763 + _RUNOPTIONS_TRACELEVEL._serialized_end=4845 + _RUNMETADATA._serialized_start=4854 + _RUNMETADATA._serialized_end=5300 + _RUNMETADATA_FUNCTIONGRAPHS._serialized_start=5127 + _RUNMETADATA_FUNCTIONGRAPHS._serialized_end=5300 + _TENSORCONNECTION._serialized_start=5302 + _TENSORCONNECTION._serialized_end=5360 + _CALLABLEOPTIONS._serialized_start=5363 + _CALLABLEOPTIONS._serialized_end=5795 + _CALLABLEOPTIONS_FEEDDEVICESENTRY._serialized_start=5692 + _CALLABLEOPTIONS_FEEDDEVICESENTRY._serialized_end=5742 + _CALLABLEOPTIONS_FETCHDEVICESENTRY._serialized_start=5744 + _CALLABLEOPTIONS_FETCHDEVICESENTRY._serialized_end=5795 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/control_flow_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/control_flow_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..09a96b54833b0e77b395e37ba90758f5c48b6938 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/control_flow_pb2.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/control_flow.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n+tensorflow/core/protobuf/control_flow.proto\x12\ntensorflow\"\x96\x01\n\tValuesDef\x12\x0e\n\x06values\x18\x01 \x03(\t\x12\x42\n\x0f\x65xternal_values\x18\x02 \x03(\x0b\x32).tensorflow.ValuesDef.ExternalValuesEntry\x1a\x35\n\x13\x45xternalValuesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x83\x01\n\x15\x43ontrolFlowContextDef\x12/\n\tcond_ctxt\x18\x01 \x01(\x0b\x32\x1a.tensorflow.CondContextDefH\x00\x12\x31\n\nwhile_ctxt\x18\x02 \x01(\x0b\x32\x1b.tensorflow.WhileContextDefH\x00\x42\x06\n\x04\x63txt\"\xc4\x01\n\x0e\x43ondContextDef\x12\x14\n\x0c\x63ontext_name\x18\x01 \x01(\t\x12\x11\n\tpred_name\x18\x02 \x01(\t\x12\x12\n\npivot_name\x18\x03 \x01(\t\x12\x0e\n\x06\x62ranch\x18\x04 \x01(\x05\x12)\n\nvalues_def\x18\x05 \x01(\x0b\x32\x15.tensorflow.ValuesDef\x12:\n\x0fnested_contexts\x18\x06 \x03(\x0b\x32!.tensorflow.ControlFlowContextDef\"\xf5\x02\n\x0fWhileContextDef\x12\x14\n\x0c\x63ontext_name\x18\x01 \x01(\t\x12\x1b\n\x13parallel_iterations\x18\x02 \x01(\x05\x12\x11\n\tback_prop\x18\x03 \x01(\x08\x12\x13\n\x0bswap_memory\x18\x04 \x01(\x08\x12\x12\n\npivot_name\x18\x05 \x01(\t\x12\x1b\n\x13pivot_for_pred_name\x18\x06 \x01(\t\x12\x1b\n\x13pivot_for_body_name\x18\x07 \x01(\t\x12\x17\n\x0floop_exit_names\x18\x08 \x03(\t\x12\x18\n\x10loop_enter_names\x18\n \x03(\t\x12)\n\nvalues_def\x18\t \x01(\x0b\x32\x15.tensorflow.ValuesDef\x12\x1f\n\x17maximum_iterations_name\x18\x0b \x01(\t\x12:\n\x0fnested_contexts\x18\x0c \x03(\x0b\x32!.tensorflow.ControlFlowContextDefB\x89\x01\n\x18org.tensorflow.frameworkB\x11\x43ontrolFlowProtosP\x01ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.control_flow_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\021ControlFlowProtosP\001ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\370\001\001' + _VALUESDEF_EXTERNALVALUESENTRY._options = None + _VALUESDEF_EXTERNALVALUESENTRY._serialized_options = b'8\001' + _VALUESDEF._serialized_start=60 + _VALUESDEF._serialized_end=210 + _VALUESDEF_EXTERNALVALUESENTRY._serialized_start=157 + _VALUESDEF_EXTERNALVALUESENTRY._serialized_end=210 + _CONTROLFLOWCONTEXTDEF._serialized_start=213 + _CONTROLFLOWCONTEXTDEF._serialized_end=344 + _CONDCONTEXTDEF._serialized_start=347 + _CONDCONTEXTDEF._serialized_end=543 + _WHILECONTEXTDEF._serialized_start=546 + _WHILECONTEXTDEF._serialized_end=919 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/core_platform_payloads_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/core_platform_payloads_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..21f39455ddaaccb7f94e74812a395572f6c55ef4 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/core_platform_payloads_pb2.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/core_platform_payloads.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n5tensorflow/core/protobuf/core_platform_payloads.proto\x12\x18tensorflow.core.platform\"\xec\x01\n\x10\x45rrorSourceProto\x12L\n\x0c\x65rror_source\x18\x01 \x01(\x0e\x32\x36.tensorflow.core.platform.ErrorSourceProto.ErrorSource\"\x89\x01\n\x0b\x45rrorSource\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x12\n\x0eTPU_COMPILE_OP\x10\x01\x12\x11\n\rTF_XLA_BRIDGE\x10\x02\x12\x17\n\x13MLIR_BRIDGE_PHASE_1\x10\x03\x12\x17\n\x13MLIR_BRIDGE_PHASE_2\x10\x04\x12\x14\n\x10\x45\x41GER_REMOTE_MGR\x10\x05\x42ZZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.core_platform_payloads_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\370\001\001' + _ERRORSOURCEPROTO._serialized_start=84 + _ERRORSOURCEPROTO._serialized_end=320 + _ERRORSOURCEPROTO_ERRORSOURCE._serialized_start=183 + _ERRORSOURCEPROTO_ERRORSOURCE._serialized_end=320 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/data_service_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/data_service_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..a332dd20edb792d9012b7b01b767f3f18c09757f --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/data_service_pb2.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/data_service.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n+tensorflow/core/protobuf/data_service.proto\x12\x0ftensorflow.data\"\xb7\x01\n\x11ProcessingModeDef\x12J\n\x0fsharding_policy\x18\x01 \x01(\x0e\x32\x31.tensorflow.data.ProcessingModeDef.ShardingPolicy\"V\n\x0eShardingPolicy\x12\x07\n\x03OFF\x10\x00\x12\x0b\n\x07\x44YNAMIC\x10\x01\x12\x08\n\x04\x46ILE\x10\x02\x12\x08\n\x04\x44\x41TA\x10\x03\x12\x10\n\x0c\x46ILE_OR_DATA\x10\x04\x12\x08\n\x04HINT\x10\x05\"\xfb\x01\n\x13\x44\x61taServiceMetadata\x12\x16\n\x0c\x65lement_spec\x18\x01 \x01(\x0cH\x00\x12\x45\n\x0b\x63ompression\x18\x02 \x01(\x0e\x32\x30.tensorflow.data.DataServiceMetadata.Compression\x12\x13\n\x0b\x63\x61rdinality\x18\x03 \x01(\x03\"W\n\x0b\x43ompression\x12\x1b\n\x17\x43OMPRESSION_UNSPECIFIED\x10\x00\x12\x13\n\x0f\x43OMPRESSION_OFF\x10\x01\x12\x16\n\x12\x43OMPRESSION_SNAPPY\x10\x02\x42\x17\n\x15optional_element_spec\".\n\x18\x43rossTrainerCacheOptions\x12\x12\n\ntrainer_id\x18\x01 \x01(\t\"M\n\x11\x44\x61taServiceConfig\x12\x38\n\x0f\x64\x65ployment_mode\x18\x01 \x01(\x0e\x32\x1f.tensorflow.data.DeploymentMode*\x88\x01\n\x0e\x44\x65ploymentMode\x12\x1f\n\x1b\x44\x45PLOYMENT_MODE_UNSPECIFIED\x10\x00\x12\x1d\n\x19\x44\x45PLOYMENT_MODE_COLOCATED\x10\x01\x12\x1a\n\x16\x44\x45PLOYMENT_MODE_REMOTE\x10\x02\x12\x1a\n\x16\x44\x45PLOYMENT_MODE_HYBRID\x10\x03\x42WZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_protob\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.data_service_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto' + _DEPLOYMENTMODE._serialized_start=632 + _DEPLOYMENTMODE._serialized_end=768 + _PROCESSINGMODEDEF._serialized_start=65 + _PROCESSINGMODEDEF._serialized_end=248 + _PROCESSINGMODEDEF_SHARDINGPOLICY._serialized_start=162 + _PROCESSINGMODEDEF_SHARDINGPOLICY._serialized_end=248 + _DATASERVICEMETADATA._serialized_start=251 + _DATASERVICEMETADATA._serialized_end=502 + _DATASERVICEMETADATA_COMPRESSION._serialized_start=390 + _DATASERVICEMETADATA_COMPRESSION._serialized_end=477 + _CROSSTRAINERCACHEOPTIONS._serialized_start=504 + _CROSSTRAINERCACHEOPTIONS._serialized_end=550 + _DATASERVICECONFIG._serialized_start=552 + _DATASERVICECONFIG._serialized_end=629 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/debug_event_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/debug_event_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..3b456916b657a4adc2ca9ec8501faa835ed52f45 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/debug_event_pb2.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/debug_event.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import graph_debug_info_pb2 as tensorflow_dot_core_dot_framework_dot_graph__debug__info__pb2 +from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*tensorflow/core/protobuf/debug_event.proto\x12\ntensorflow\x1a\x30tensorflow/core/framework/graph_debug_info.proto\x1a&tensorflow/core/framework/tensor.proto\"\xfe\x03\n\nDebugEvent\x12\x11\n\twall_time\x18\x01 \x01(\x01\x12\x0c\n\x04step\x18\x02 \x01(\x03\x12\x33\n\x0e\x64\x65\x62ug_metadata\x18\x03 \x01(\x0b\x32\x19.tensorflow.DebugMetadataH\x00\x12-\n\x0bsource_file\x18\x04 \x01(\x0b\x32\x16.tensorflow.SourceFileH\x00\x12;\n\x13stack_frame_with_id\x18\x06 \x01(\x0b\x32\x1c.tensorflow.StackFrameWithIdH\x00\x12\x38\n\x11graph_op_creation\x18\x07 \x01(\x0b\x32\x1b.tensorflow.GraphOpCreationH\x00\x12\x33\n\x0e\x64\x65\x62ugged_graph\x18\x08 \x01(\x0b\x32\x19.tensorflow.DebuggedGraphH\x00\x12*\n\texecution\x18\t \x01(\x0b\x32\x15.tensorflow.ExecutionH\x00\x12@\n\x15graph_execution_trace\x18\n \x01(\x0b\x32\x1f.tensorflow.GraphExecutionTraceH\x00\x12\x12\n\x08graph_id\x18\x0b \x01(\tH\x00\x12\x35\n\x0f\x64\x65\x62ugged_device\x18\x0c \x01(\x0b\x32\x1a.tensorflow.DebuggedDeviceH\x00\x42\x06\n\x04what\"W\n\rDebugMetadata\x12\x1a\n\x12tensorflow_version\x18\x01 \x01(\t\x12\x14\n\x0c\x66ile_version\x18\x02 \x01(\t\x12\x14\n\x0ctfdbg_run_id\x18\x03 \x01(\t\"A\n\nSourceFile\x12\x11\n\tfile_path\x18\x01 \x01(\t\x12\x11\n\thost_name\x18\x02 \x01(\t\x12\r\n\x05lines\x18\x03 \x03(\t\"]\n\x10StackFrameWithId\x12\n\n\x02id\x18\x01 \x01(\t\x12=\n\rfile_line_col\x18\x02 \x01(\x0b\x32&.tensorflow.GraphDebugInfo.FileLineCol\":\n\x0c\x43odeLocation\x12\x11\n\thost_name\x18\x01 \x01(\t\x12\x17\n\x0fstack_frame_ids\x18\x02 \x03(\t\"\xe4\x01\n\x0fGraphOpCreation\x12\x0f\n\x07op_type\x18\x01 \x01(\t\x12\x0f\n\x07op_name\x18\x02 \x01(\t\x12\x12\n\ngraph_name\x18\x03 \x01(\t\x12\x10\n\x08graph_id\x18\x04 \x01(\t\x12\x13\n\x0b\x64\x65vice_name\x18\x05 \x01(\t\x12\x13\n\x0binput_names\x18\x06 \x03(\t\x12\x13\n\x0bnum_outputs\x18\x07 \x01(\x05\x12/\n\rcode_location\x18\x08 \x01(\x0b\x32\x18.tensorflow.CodeLocation\x12\x19\n\x11output_tensor_ids\x18\t \x03(\x05\"\xa5\x01\n\rDebuggedGraph\x12\x10\n\x08graph_id\x18\x01 \x01(\t\x12\x12\n\ngraph_name\x18\x02 \x01(\t\x12\x18\n\x10instrumented_ops\x18\x03 \x03(\t\x12\x1a\n\x12original_graph_def\x18\x04 \x01(\x0c\x12\x1e\n\x16instrumented_graph_def\x18\x05 \x01(\x0c\x12\x18\n\x10outer_context_id\x18\x06 \x01(\t\"8\n\x0e\x44\x65\x62uggedDevice\x12\x13\n\x0b\x64\x65vice_name\x18\x01 \x01(\t\x12\x11\n\tdevice_id\x18\x02 \x01(\x05\"\xb3\x02\n\tExecution\x12\x0f\n\x07op_type\x18\x01 \x01(\t\x12\x13\n\x0bnum_outputs\x18\x02 \x01(\x05\x12\x10\n\x08graph_id\x18\x03 \x01(\t\x12\x18\n\x10input_tensor_ids\x18\x04 \x03(\x03\x12\x19\n\x11output_tensor_ids\x18\x05 \x03(\x03\x12\x36\n\x11tensor_debug_mode\x18\x06 \x01(\x0e\x32\x1b.tensorflow.TensorDebugMode\x12.\n\rtensor_protos\x18\x07 \x03(\x0b\x32\x17.tensorflow.TensorProto\x12/\n\rcode_location\x18\x08 \x01(\x0b\x32\x18.tensorflow.CodeLocation\x12 \n\x18output_tensor_device_ids\x18\t \x03(\x05\"\xd1\x01\n\x13GraphExecutionTrace\x12\x18\n\x10tfdbg_context_id\x18\x01 \x01(\t\x12\x0f\n\x07op_name\x18\x02 \x01(\t\x12\x13\n\x0boutput_slot\x18\x03 \x01(\x05\x12\x36\n\x11tensor_debug_mode\x18\x04 \x01(\x0e\x32\x1b.tensorflow.TensorDebugMode\x12-\n\x0ctensor_proto\x18\x05 \x01(\x0b\x32\x17.tensorflow.TensorProto\x12\x13\n\x0b\x64\x65vice_name\x18\x06 \x01(\t*\xb6\x01\n\x0fTensorDebugMode\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\r\n\tNO_TENSOR\x10\x01\x12\x0f\n\x0b\x43URT_HEALTH\x10\x02\x12\x12\n\x0e\x43ONCISE_HEALTH\x10\x03\x12\x0f\n\x0b\x46ULL_HEALTH\x10\x04\x12\t\n\x05SHAPE\x10\x05\x12\x11\n\rFULL_NUMERICS\x10\x06\x12\x0f\n\x0b\x46ULL_TENSOR\x10\x07\x12\x1e\n\x1aREDUCE_INF_NAN_THREE_SLOTS\x10\x08\x42\x83\x01\n\x13org.tensorflow.utilB\x10\x44\x65\x62ugEventProtosP\x01ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.debug_event_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\023org.tensorflow.utilB\020DebugEventProtosP\001ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\370\001\001' + _TENSORDEBUGMODE._serialized_start=1952 + _TENSORDEBUGMODE._serialized_end=2134 + _DEBUGEVENT._serialized_start=149 + _DEBUGEVENT._serialized_end=659 + _DEBUGMETADATA._serialized_start=661 + _DEBUGMETADATA._serialized_end=748 + _SOURCEFILE._serialized_start=750 + _SOURCEFILE._serialized_end=815 + _STACKFRAMEWITHID._serialized_start=817 + _STACKFRAMEWITHID._serialized_end=910 + _CODELOCATION._serialized_start=912 + _CODELOCATION._serialized_end=970 + _GRAPHOPCREATION._serialized_start=973 + _GRAPHOPCREATION._serialized_end=1201 + _DEBUGGEDGRAPH._serialized_start=1204 + _DEBUGGEDGRAPH._serialized_end=1369 + _DEBUGGEDDEVICE._serialized_start=1371 + _DEBUGGEDDEVICE._serialized_end=1427 + _EXECUTION._serialized_start=1430 + _EXECUTION._serialized_end=1737 + _GRAPHEXECUTIONTRACE._serialized_start=1740 + _GRAPHEXECUTIONTRACE._serialized_end=1949 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/debug_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/debug_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..dde7cc67cc9b985113c38f05ca85e3c8724d57fd --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/debug_pb2.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/debug.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n$tensorflow/core/protobuf/debug.proto\x12\ntensorflow\"\x8e\x01\n\x10\x44\x65\x62ugTensorWatch\x12\x11\n\tnode_name\x18\x01 \x01(\t\x12\x13\n\x0boutput_slot\x18\x02 \x01(\x05\x12\x11\n\tdebug_ops\x18\x03 \x03(\t\x12\x12\n\ndebug_urls\x18\x04 \x03(\t\x12+\n#tolerate_debug_op_creation_failures\x18\x05 \x01(\x08\"\x81\x01\n\x0c\x44\x65\x62ugOptions\x12=\n\x17\x64\x65\x62ug_tensor_watch_opts\x18\x04 \x03(\x0b\x32\x1c.tensorflow.DebugTensorWatch\x12\x13\n\x0bglobal_step\x18\n \x01(\x03\x12\x1d\n\x15reset_disk_byte_usage\x18\x0b \x01(\x08\"j\n\x12\x44\x65\x62uggedSourceFile\x12\x0c\n\x04host\x18\x01 \x01(\t\x12\x11\n\tfile_path\x18\x02 \x01(\t\x12\x15\n\rlast_modified\x18\x03 \x01(\x03\x12\r\n\x05\x62ytes\x18\x04 \x01(\x03\x12\r\n\x05lines\x18\x05 \x03(\t\"K\n\x13\x44\x65\x62uggedSourceFiles\x12\x34\n\x0csource_files\x18\x01 \x03(\x0b\x32\x1e.tensorflow.DebuggedSourceFileB\x83\x01\n\x18org.tensorflow.frameworkB\x0b\x44\x65\x62ugProtosP\x01ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.debug_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\013DebugProtosP\001ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\370\001\001' + _DEBUGTENSORWATCH._serialized_start=53 + _DEBUGTENSORWATCH._serialized_end=195 + _DEBUGOPTIONS._serialized_start=198 + _DEBUGOPTIONS._serialized_end=327 + _DEBUGGEDSOURCEFILE._serialized_start=329 + _DEBUGGEDSOURCEFILE._serialized_end=435 + _DEBUGGEDSOURCEFILES._serialized_start=437 + _DEBUGGEDSOURCEFILES._serialized_end=512 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/device_filters_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/device_filters_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..ab119a5d4f1f6eab94c40793fd2ff9b3f7325842 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/device_filters_pb2.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/device_filters.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n-tensorflow/core/protobuf/device_filters.proto\x12\ntensorflow\"+\n\x11TaskDeviceFilters\x12\x16\n\x0e\x64\x65vice_filters\x18\x01 \x03(\t\"\xa5\x01\n\x10JobDeviceFilters\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x36\n\x05tasks\x18\x02 \x03(\x0b\x32\'.tensorflow.JobDeviceFilters.TasksEntry\x1aK\n\nTasksEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.tensorflow.TaskDeviceFilters:\x02\x38\x01\"B\n\x14\x43lusterDeviceFilters\x12*\n\x04jobs\x18\x01 \x03(\x0b\x32\x1c.tensorflow.JobDeviceFiltersB\x8d\x01\n\x1aorg.tensorflow.distruntimeB\x13\x44\x65viceFiltersProtosP\x01ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.device_filters_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\032org.tensorflow.distruntimeB\023DeviceFiltersProtosP\001ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\370\001\001' + _JOBDEVICEFILTERS_TASKSENTRY._options = None + _JOBDEVICEFILTERS_TASKSENTRY._serialized_options = b'8\001' + _TASKDEVICEFILTERS._serialized_start=61 + _TASKDEVICEFILTERS._serialized_end=104 + _JOBDEVICEFILTERS._serialized_start=107 + _JOBDEVICEFILTERS._serialized_end=272 + _JOBDEVICEFILTERS_TASKSENTRY._serialized_start=197 + _JOBDEVICEFILTERS_TASKSENTRY._serialized_end=272 + _CLUSTERDEVICEFILTERS._serialized_start=274 + _CLUSTERDEVICEFILTERS._serialized_end=340 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/device_properties_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/device_properties_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..aa1cf25f203c03049567dcb4c5b5c941542b3ac9 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/device_properties_pb2.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/device_properties.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n0tensorflow/core/protobuf/device_properties.proto\x12\ntensorflow\"\x90\x03\n\x10\x44\x65viceProperties\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0e\n\x06vendor\x18\x02 \x01(\t\x12\r\n\x05model\x18\x03 \x01(\t\x12\x11\n\tfrequency\x18\x04 \x01(\x03\x12\x11\n\tnum_cores\x18\x05 \x01(\x03\x12\x42\n\x0b\x65nvironment\x18\x06 \x03(\x0b\x32-.tensorflow.DeviceProperties.EnvironmentEntry\x12\x15\n\rnum_registers\x18\x07 \x01(\x03\x12\x15\n\rl1_cache_size\x18\x08 \x01(\x03\x12\x15\n\rl2_cache_size\x18\t \x01(\x03\x12\x15\n\rl3_cache_size\x18\n \x01(\x03\x12-\n%shared_memory_size_per_multiprocessor\x18\x0b \x01(\x03\x12\x13\n\x0bmemory_size\x18\x0c \x01(\x03\x12\x11\n\tbandwidth\x18\r \x01(\x03\x1a\x32\n\x10\x45nvironmentEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"M\n\x0bNamedDevice\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x30\n\nproperties\x18\x02 \x01(\x0b\x32\x1c.tensorflow.DevicePropertiesBrB\x16\x44\x65vicePropertiesProtosZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.device_properties_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'B\026DevicePropertiesProtosZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\370\001\001' + _DEVICEPROPERTIES_ENVIRONMENTENTRY._options = None + _DEVICEPROPERTIES_ENVIRONMENTENTRY._serialized_options = b'8\001' + _DEVICEPROPERTIES._serialized_start=65 + _DEVICEPROPERTIES._serialized_end=465 + _DEVICEPROPERTIES_ENVIRONMENTENTRY._serialized_start=415 + _DEVICEPROPERTIES_ENVIRONMENTENTRY._serialized_end=465 + _NAMEDDEVICE._serialized_start=467 + _NAMEDDEVICE._serialized_end=544 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/error_codes_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/error_codes_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..3ac7922507cdf3cc7f9f71887d5aa3826e3eadd3 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/error_codes_pb2.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/error_codes.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.tsl.protobuf import error_codes_pb2 as tsl_dot_protobuf_dot_error__codes__pb2 + +from tensorflow.tsl.protobuf.error_codes_pb2 import * + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*tensorflow/core/protobuf/error_codes.proto\x12\x16tensorflow.error.dummy\x1a\x1etsl/protobuf/error_codes.protoBWZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_protoP\x00\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.error_codes_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto' +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/fingerprint_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/fingerprint_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..e8e9c7c2badb00a217ebb1762f9a15abff3b9616 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/fingerprint_pb2.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/fingerprint.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import versions_pb2 as tensorflow_dot_core_dot_framework_dot_versions__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*tensorflow/core/protobuf/fingerprint.proto\x12\ntensorflow\x1a(tensorflow/core/framework/versions.proto\"\xcd\x01\n\x0e\x46ingerprintDef\x12\x1c\n\x14saved_model_checksum\x18\x01 \x01(\x04\x12\x1e\n\x16graph_def_program_hash\x18\x02 \x01(\x04\x12\x1a\n\x12signature_def_hash\x18\x03 \x01(\x04\x12\x1f\n\x17saved_object_graph_hash\x18\x04 \x01(\x04\x12\x17\n\x0f\x63heckpoint_hash\x18\x05 \x01(\x04\x12\'\n\x07version\x18\x06 \x01(\x0b\x32\x16.tensorflow.VersionDefB\x89\x01\n\x18org.tensorflow.frameworkB\x11\x46ingerprintProtosP\x01ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.fingerprint_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\021FingerprintProtosP\001ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\370\001\001' + _FINGERPRINTDEF._serialized_start=101 + _FINGERPRINTDEF._serialized_end=306 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/meta_graph_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/meta_graph_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..d74d5c76d4001dd893b32af660697e77db1006d4 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/meta_graph_pb2.py @@ -0,0 +1,87 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/meta_graph.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 +from tensorflow.core.framework import graph_pb2 as tensorflow_dot_core_dot_framework_dot_graph__pb2 +from tensorflow.core.framework import op_def_pb2 as tensorflow_dot_core_dot_framework_dot_op__def__pb2 +from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2 +from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2 +from tensorflow.core.framework import types_pb2 as tensorflow_dot_core_dot_framework_dot_types__pb2 +from tensorflow.core.protobuf import saved_object_graph_pb2 as tensorflow_dot_core_dot_protobuf_dot_saved__object__graph__pb2 +from tensorflow.core.protobuf import saver_pb2 as tensorflow_dot_core_dot_protobuf_dot_saver__pb2 +from tensorflow.core.protobuf import struct_pb2 as tensorflow_dot_core_dot_protobuf_dot_struct__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n)tensorflow/core/protobuf/meta_graph.proto\x12\ntensorflow\x1a\x19google/protobuf/any.proto\x1a%tensorflow/core/framework/graph.proto\x1a&tensorflow/core/framework/op_def.proto\x1a&tensorflow/core/framework/tensor.proto\x1a,tensorflow/core/framework/tensor_shape.proto\x1a%tensorflow/core/framework/types.proto\x1a\x31tensorflow/core/protobuf/saved_object_graph.proto\x1a$tensorflow/core/protobuf/saver.proto\x1a%tensorflow/core/protobuf/struct.proto\"\xa8\x07\n\x0cMetaGraphDef\x12;\n\rmeta_info_def\x18\x01 \x01(\x0b\x32$.tensorflow.MetaGraphDef.MetaInfoDef\x12\'\n\tgraph_def\x18\x02 \x01(\x0b\x32\x14.tensorflow.GraphDef\x12\'\n\tsaver_def\x18\x03 \x01(\x0b\x32\x14.tensorflow.SaverDef\x12\x43\n\x0e\x63ollection_def\x18\x04 \x03(\x0b\x32+.tensorflow.MetaGraphDef.CollectionDefEntry\x12\x41\n\rsignature_def\x18\x05 \x03(\x0b\x32*.tensorflow.MetaGraphDef.SignatureDefEntry\x12\x30\n\x0e\x61sset_file_def\x18\x06 \x03(\x0b\x32\x18.tensorflow.AssetFileDef\x12\x36\n\x10object_graph_def\x18\x07 \x01(\x0b\x32\x1c.tensorflow.SavedObjectGraph\x1a\xf6\x02\n\x0bMetaInfoDef\x12\x1a\n\x12meta_graph_version\x18\x01 \x01(\t\x12,\n\x10stripped_op_list\x18\x02 \x01(\x0b\x32\x12.tensorflow.OpList\x12&\n\x08\x61ny_info\x18\x03 \x01(\x0b\x32\x14.google.protobuf.Any\x12\x0c\n\x04tags\x18\x04 \x03(\t\x12\x1a\n\x12tensorflow_version\x18\x05 \x01(\t\x12\x1e\n\x16tensorflow_git_version\x18\x06 \x01(\t\x12\x1e\n\x16stripped_default_attrs\x18\x07 \x01(\x08\x12S\n\x10\x66unction_aliases\x18\x08 \x03(\x0b\x32\x39.tensorflow.MetaGraphDef.MetaInfoDef.FunctionAliasesEntry\x1a\x36\n\x14\x46unctionAliasesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1aO\n\x12\x43ollectionDefEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12(\n\x05value\x18\x02 \x01(\x0b\x32\x19.tensorflow.CollectionDef:\x02\x38\x01\x1aM\n\x11SignatureDefEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\'\n\x05value\x18\x02 \x01(\x0b\x32\x18.tensorflow.SignatureDef:\x02\x38\x01\"\xdf\x03\n\rCollectionDef\x12\x37\n\tnode_list\x18\x01 \x01(\x0b\x32\".tensorflow.CollectionDef.NodeListH\x00\x12\x39\n\nbytes_list\x18\x02 \x01(\x0b\x32#.tensorflow.CollectionDef.BytesListH\x00\x12\x39\n\nint64_list\x18\x03 \x01(\x0b\x32#.tensorflow.CollectionDef.Int64ListH\x00\x12\x39\n\nfloat_list\x18\x04 \x01(\x0b\x32#.tensorflow.CollectionDef.FloatListH\x00\x12\x35\n\x08\x61ny_list\x18\x05 \x01(\x0b\x32!.tensorflow.CollectionDef.AnyListH\x00\x1a\x19\n\x08NodeList\x12\r\n\x05value\x18\x01 \x03(\t\x1a\x1a\n\tBytesList\x12\r\n\x05value\x18\x01 \x03(\x0c\x1a\x1e\n\tInt64List\x12\x11\n\x05value\x18\x01 \x03(\x03\x42\x02\x10\x01\x1a\x1e\n\tFloatList\x12\x11\n\x05value\x18\x01 \x03(\x02\x42\x02\x10\x01\x1a.\n\x07\x41nyList\x12#\n\x05value\x18\x01 \x03(\x0b\x32\x14.google.protobuf.AnyB\x06\n\x04kind\"\xd1\x03\n\nTensorInfo\x12\x0e\n\x04name\x18\x01 \x01(\tH\x00\x12\x36\n\ncoo_sparse\x18\x04 \x01(\x0b\x32 .tensorflow.TensorInfo.CooSparseH\x00\x12\x42\n\x10\x63omposite_tensor\x18\x05 \x01(\x0b\x32&.tensorflow.TensorInfo.CompositeTensorH\x00\x12#\n\x05\x64type\x18\x02 \x01(\x0e\x32\x14.tensorflow.DataType\x12\x32\n\x0ctensor_shape\x18\x03 \x01(\x0b\x32\x1c.tensorflow.TensorShapeProto\x1a\x65\n\tCooSparse\x12\x1a\n\x12values_tensor_name\x18\x01 \x01(\t\x12\x1b\n\x13indices_tensor_name\x18\x02 \x01(\t\x12\x1f\n\x17\x64\x65nse_shape_tensor_name\x18\x03 \x01(\t\x1ak\n\x0f\x43ompositeTensor\x12,\n\ttype_spec\x18\x01 \x01(\x0b\x32\x19.tensorflow.TypeSpecProto\x12*\n\ncomponents\x18\x02 \x03(\x0b\x32\x16.tensorflow.TensorInfoB\n\n\x08\x65ncoding\"\xa4\x03\n\x0cSignatureDef\x12\x34\n\x06inputs\x18\x01 \x03(\x0b\x32$.tensorflow.SignatureDef.InputsEntry\x12\x36\n\x07outputs\x18\x02 \x03(\x0b\x32%.tensorflow.SignatureDef.OutputsEntry\x12\x13\n\x0bmethod_name\x18\x03 \x01(\t\x12\x38\n\x08\x64\x65\x66\x61ults\x18\x04 \x03(\x0b\x32&.tensorflow.SignatureDef.DefaultsEntry\x1a\x45\n\x0bInputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.tensorflow.TensorInfo:\x02\x38\x01\x1a\x46\n\x0cOutputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.tensorflow.TensorInfo:\x02\x38\x01\x1aH\n\rDefaultsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.tensorflow.TensorProto:\x02\x38\x01\"M\n\x0c\x41ssetFileDef\x12+\n\x0btensor_info\x18\x01 \x01(\x0b\x32\x16.tensorflow.TensorInfo\x12\x10\n\x08\x66ilename\x18\x02 \x01(\tB\x87\x01\n\x18org.tensorflow.frameworkB\x0fMetaGraphProtosP\x01ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.meta_graph_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\017MetaGraphProtosP\001ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\370\001\001' + _METAGRAPHDEF_METAINFODEF_FUNCTIONALIASESENTRY._options = None + _METAGRAPHDEF_METAINFODEF_FUNCTIONALIASESENTRY._serialized_options = b'8\001' + _METAGRAPHDEF_COLLECTIONDEFENTRY._options = None + _METAGRAPHDEF_COLLECTIONDEFENTRY._serialized_options = b'8\001' + _METAGRAPHDEF_SIGNATUREDEFENTRY._options = None + _METAGRAPHDEF_SIGNATUREDEFENTRY._serialized_options = b'8\001' + _COLLECTIONDEF_INT64LIST.fields_by_name['value']._options = None + _COLLECTIONDEF_INT64LIST.fields_by_name['value']._serialized_options = b'\020\001' + _COLLECTIONDEF_FLOATLIST.fields_by_name['value']._options = None + _COLLECTIONDEF_FLOATLIST.fields_by_name['value']._serialized_options = b'\020\001' + _SIGNATUREDEF_INPUTSENTRY._options = None + _SIGNATUREDEF_INPUTSENTRY._serialized_options = b'8\001' + _SIGNATUREDEF_OUTPUTSENTRY._options = None + _SIGNATUREDEF_OUTPUTSENTRY._serialized_options = b'8\001' + _SIGNATUREDEF_DEFAULTSENTRY._options = None + _SIGNATUREDEF_DEFAULTSENTRY._serialized_options = b'8\001' + _METAGRAPHDEF._serialized_start=417 + _METAGRAPHDEF._serialized_end=1353 + _METAGRAPHDEF_METAINFODEF._serialized_start=819 + _METAGRAPHDEF_METAINFODEF._serialized_end=1193 + _METAGRAPHDEF_METAINFODEF_FUNCTIONALIASESENTRY._serialized_start=1139 + _METAGRAPHDEF_METAINFODEF_FUNCTIONALIASESENTRY._serialized_end=1193 + _METAGRAPHDEF_COLLECTIONDEFENTRY._serialized_start=1195 + _METAGRAPHDEF_COLLECTIONDEFENTRY._serialized_end=1274 + _METAGRAPHDEF_SIGNATUREDEFENTRY._serialized_start=1276 + _METAGRAPHDEF_SIGNATUREDEFENTRY._serialized_end=1353 + _COLLECTIONDEF._serialized_start=1356 + _COLLECTIONDEF._serialized_end=1835 + _COLLECTIONDEF_NODELIST._serialized_start=1662 + _COLLECTIONDEF_NODELIST._serialized_end=1687 + _COLLECTIONDEF_BYTESLIST._serialized_start=1689 + _COLLECTIONDEF_BYTESLIST._serialized_end=1715 + _COLLECTIONDEF_INT64LIST._serialized_start=1717 + _COLLECTIONDEF_INT64LIST._serialized_end=1747 + _COLLECTIONDEF_FLOATLIST._serialized_start=1749 + _COLLECTIONDEF_FLOATLIST._serialized_end=1779 + _COLLECTIONDEF_ANYLIST._serialized_start=1781 + _COLLECTIONDEF_ANYLIST._serialized_end=1827 + _TENSORINFO._serialized_start=1838 + _TENSORINFO._serialized_end=2303 + _TENSORINFO_COOSPARSE._serialized_start=2081 + _TENSORINFO_COOSPARSE._serialized_end=2182 + _TENSORINFO_COMPOSITETENSOR._serialized_start=2184 + _TENSORINFO_COMPOSITETENSOR._serialized_end=2291 + _SIGNATUREDEF._serialized_start=2306 + _SIGNATUREDEF._serialized_end=2726 + _SIGNATUREDEF_INPUTSENTRY._serialized_start=2511 + _SIGNATUREDEF_INPUTSENTRY._serialized_end=2580 + _SIGNATUREDEF_OUTPUTSENTRY._serialized_start=2582 + _SIGNATUREDEF_OUTPUTSENTRY._serialized_end=2652 + _SIGNATUREDEF_DEFAULTSENTRY._serialized_start=2654 + _SIGNATUREDEF_DEFAULTSENTRY._serialized_end=2726 + _ASSETFILEDEF._serialized_start=2728 + _ASSETFILEDEF._serialized_end=2805 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/named_tensor_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/named_tensor_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..03c032ae2ad6d5f12e522f467b41b035359c8084 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/named_tensor_pb2.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/named_tensor.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n+tensorflow/core/protobuf/named_tensor.proto\x12\ntensorflow\x1a&tensorflow/core/framework/tensor.proto\"I\n\x10NamedTensorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\'\n\x06tensor\x18\x02 \x01(\x0b\x32\x17.tensorflow.TensorProtoB\x89\x01\n\x18org.tensorflow.frameworkB\x11NamedTensorProtosP\x01ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.named_tensor_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\021NamedTensorProtosP\001ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\370\001\001' + _NAMEDTENSORPROTO._serialized_start=99 + _NAMEDTENSORPROTO._serialized_end=172 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/queue_runner_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/queue_runner_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..fb0d24ab3c272bf8d3c48993a80c1fe666bc8407 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/queue_runner_pb2.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/queue_runner.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.protobuf import error_codes_pb2 as tensorflow_dot_core_dot_protobuf_dot_error__codes__pb2 +try: + tsl_dot_protobuf_dot_error__codes__pb2 = tensorflow_dot_core_dot_protobuf_dot_error__codes__pb2.tsl_dot_protobuf_dot_error__codes__pb2 +except AttributeError: + tsl_dot_protobuf_dot_error__codes__pb2 = tensorflow_dot_core_dot_protobuf_dot_error__codes__pb2.tsl.protobuf.error_codes_pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n+tensorflow/core/protobuf/queue_runner.proto\x12\ntensorflow\x1a*tensorflow/core/protobuf/error_codes.proto\"\xaa\x01\n\x0eQueueRunnerDef\x12\x12\n\nqueue_name\x18\x01 \x01(\t\x12\x17\n\x0f\x65nqueue_op_name\x18\x02 \x03(\t\x12\x15\n\rclose_op_name\x18\x03 \x01(\t\x12\x16\n\x0e\x63\x61ncel_op_name\x18\x04 \x01(\t\x12<\n\x1cqueue_closed_exception_types\x18\x05 \x03(\x0e\x32\x16.tensorflow.error.CodeB\x89\x01\n\x18org.tensorflow.frameworkB\x11QueueRunnerProtosP\x01ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.queue_runner_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\021QueueRunnerProtosP\001ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\370\001\001' + _QUEUERUNNERDEF._serialized_start=104 + _QUEUERUNNERDEF._serialized_end=274 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/remote_tensor_handle_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/remote_tensor_handle_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..69020292bcbb7add6c74ec911ff0a3010b4c6b8f --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/remote_tensor_handle_pb2.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/remote_tensor_handle.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2 +from tensorflow.core.framework import types_pb2 as tensorflow_dot_core_dot_framework_dot_types__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n3tensorflow/core/protobuf/remote_tensor_handle.proto\x12\x10tensorflow.eager\x1a,tensorflow/core/framework/tensor_shape.proto\x1a%tensorflow/core/framework/types.proto\"i\n\x15ResourceDtypeAndShape\x12#\n\x05\x64type\x18\x01 \x01(\x0e\x32\x14.tensorflow.DataType\x12+\n\x05shape\x18\x02 \x01(\x0b\x32\x1c.tensorflow.TensorShapeProto\"\xcc\x01\n\x12RemoteTensorHandle\x12\r\n\x05op_id\x18\x01 \x01(\x03\x12\x12\n\noutput_num\x18\x02 \x01(\x05\x12\x0e\n\x06\x64\x65vice\x18\x03 \x01(\t\x12\x11\n\top_device\x18\x04 \x01(\t\x12#\n\x05\x64type\x18\x05 \x01(\x0e\x32\x14.tensorflow.DataType\x12K\n\x1aresource_dtypes_and_shapes\x18\x06 \x03(\x0b\x32\'.tensorflow.eager.ResourceDtypeAndShapeB\x90\x01\n\x18org.tensorflow.frameworkB\x18RemoteTensorHandleProtosP\x01ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.remote_tensor_handle_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\030RemoteTensorHandleProtosP\001ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\370\001\001' + _RESOURCEDTYPEANDSHAPE._serialized_start=158 + _RESOURCEDTYPEANDSHAPE._serialized_end=263 + _REMOTETENSORHANDLE._serialized_start=266 + _REMOTETENSORHANDLE._serialized_end=470 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/rewriter_config_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/rewriter_config_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..5a569087c91b583a62666b0d17660c90f9ccee5c --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/rewriter_config_pb2.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/rewriter_config.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2 +from tensorflow.core.protobuf import verifier_config_pb2 as tensorflow_dot_core_dot_protobuf_dot_verifier__config__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n.tensorflow/core/protobuf/rewriter_config.proto\x12\ntensorflow\x1a*tensorflow/core/framework/attr_value.proto\x1a.tensorflow/core/protobuf/verifier_config.proto\";\n\x13\x41utoParallelOptions\x12\x0e\n\x06\x65nable\x18\x01 \x01(\x08\x12\x14\n\x0cnum_replicas\x18\x02 \x01(\x05\"+\n\x16ScopedAllocatorOptions\x12\x11\n\tenable_op\x18\x01 \x03(\t\"\x95\x16\n\x0eRewriterConfig\x12\x43\n\x15\x63pu_layout_conversion\x18\x32 \x01(\x0e\x32$.tensorflow.RewriterConfig.CpuLayout\x12;\n\x10layout_optimizer\x18\x01 \x01(\x0e\x32!.tensorflow.RewriterConfig.Toggle\x12;\n\x10\x63onstant_folding\x18\x03 \x01(\x0e\x32!.tensorflow.RewriterConfig.Toggle\x12=\n\x12shape_optimization\x18\r \x01(\x0e\x32!.tensorflow.RewriterConfig.Toggle\x12\x34\n\tremapping\x18\x0e \x01(\x0e\x32!.tensorflow.RewriterConfig.Toggle\x12\x46\n\x1b\x63ommon_subgraph_elimination\x18\x18 \x01(\x0e\x32!.tensorflow.RewriterConfig.Toggle\x12\x42\n\x17\x61rithmetic_optimization\x18\x07 \x01(\x0e\x32!.tensorflow.RewriterConfig.Toggle\x12\x42\n\x17\x64\x65pendency_optimization\x18\x08 \x01(\x0e\x32!.tensorflow.RewriterConfig.Toggle\x12<\n\x11loop_optimization\x18\t \x01(\x0e\x32!.tensorflow.RewriterConfig.Toggle\x12@\n\x15\x66unction_optimization\x18\n \x01(\x0e\x32!.tensorflow.RewriterConfig.Toggle\x12\x39\n\x0e\x64\x65\x62ug_stripper\x18\x0b \x01(\x0e\x32!.tensorflow.RewriterConfig.Toggle\x12\x1d\n\x15\x64isable_model_pruning\x18\x02 \x01(\x08\x12H\n\x1dscoped_allocator_optimization\x18\x0f \x01(\x0e\x32!.tensorflow.RewriterConfig.Toggle\x12\x43\n\x18pin_to_host_optimization\x18\x12 \x01(\x0e\x32!.tensorflow.RewriterConfig.Toggle\x12\x42\n\x17implementation_selector\x18\x16 \x01(\x0e\x32!.tensorflow.RewriterConfig.Toggle\x12?\n\x14\x61uto_mixed_precision\x18\x17 \x01(\x0e\x32!.tensorflow.RewriterConfig.Toggle\x12\x43\n\x18\x61uto_mixed_precision_mkl\x18\x19 \x01(\x0e\x32!.tensorflow.RewriterConfig.Toggle\x12O\n$auto_mixed_precision_onednn_bfloat16\x18\x1f \x01(\x0e\x32!.tensorflow.RewriterConfig.Toggle\x12\x43\n\x18\x61uto_mixed_precision_cpu\x18\x1d \x01(\x0e\x32!.tensorflow.RewriterConfig.Toggle\x12\x1e\n\x16\x64isable_meta_optimizer\x18\x13 \x01(\x08\x12\x1d\n\x15\x64isable_tfg_optimizer\x18 \x01(\x08\x12@\n\x15use_plugin_optimizers\x18\x1c \x01(\x0e\x32!.tensorflow.RewriterConfig.Toggle\x12O\n$experimental_conditional_code_motion\x18\x1e \x01(\x0e\x32!.tensorflow.RewriterConfig.Toggle\x12O\n\x19meta_optimizer_iterations\x18\x0c \x01(\x0e\x32,.tensorflow.RewriterConfig.NumIterationsType\x12\x17\n\x0fmin_graph_nodes\x18\x11 \x01(\x05\x12;\n3experimental_disable_compressed_tensor_optimization\x18\x1a \x01(\x08\x12;\n3experimental_disable_folding_quantization_emulation\x18\x1b \x01(\x08\x12\x42\n\x13memory_optimization\x18\x04 \x01(\x0e\x32%.tensorflow.RewriterConfig.MemOptType\x12/\n\'memory_optimizer_target_node_name_scope\x18\x06 \x01(\t\x12!\n\x19meta_optimizer_timeout_ms\x18\x14 \x01(\x03\x12\x36\n\rauto_parallel\x18\x05 \x01(\x0b\x32\x1f.tensorflow.AutoParallelOptions\x12 \n\x18\x66\x61il_on_optimizer_errors\x18\x15 \x01(\x08\x12\x41\n\x15scoped_allocator_opts\x18\x10 \x01(\x0b\x32\".tensorflow.ScopedAllocatorOptions\x12\x12\n\noptimizers\x18\x64 \x03(\t\x12K\n\x11\x63ustom_optimizers\x18\xc8\x01 \x03(\x0b\x32/.tensorflow.RewriterConfig.CustomGraphOptimizer\x12\x44\n\x1finter_optimizer_verifier_config\x18\xac\x02 \x01(\x0b\x32\x1a.tensorflow.VerifierConfig\x12\x46\n!post_optimization_verifier_config\x18\xad\x02 \x01(\x0b\x32\x1a.tensorflow.VerifierConfig\x1a\xca\x01\n\x14\x43ustomGraphOptimizer\x12\x0c\n\x04name\x18\x01 \x01(\t\x12X\n\rparameter_map\x18\x02 \x03(\x0b\x32\x41.tensorflow.RewriterConfig.CustomGraphOptimizer.ParameterMapEntry\x1aJ\n\x11ParameterMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12$\n\x05value\x18\x02 \x01(\x0b\x32\x15.tensorflow.AttrValue:\x02\x38\x01\"d\n\x06Toggle\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x00\x12\x06\n\x02ON\x10\x01\x12\x07\n\x03OFF\x10\x02\x12\x0e\n\nAGGRESSIVE\x10\x03\x12\x15\n\x11\x45XPERIMENTAL_MLIR\x10\x04\x12\x15\n\x11\x45XPERIMENTAL_BOTH\x10\x05\"I\n\tCpuLayout\x12\x18\n\x14NO_CONVERSION_ON_CPU\x10\x00\x12\x10\n\x0cNCHW_TO_NHWC\x10\x01\x12\x10\n\x0cNHWC_TO_NCHW\x10\x02\"<\n\x11NumIterationsType\x12\x15\n\x11\x44\x45\x46\x41ULT_NUM_ITERS\x10\x00\x12\x07\n\x03ONE\x10\x01\x12\x07\n\x03TWO\x10\x02\"\x9f\x01\n\nMemOptType\x12\x13\n\x0f\x44\x45\x46\x41ULT_MEM_OPT\x10\x00\x12\x0e\n\nNO_MEM_OPT\x10\x01\x12\n\n\x06MANUAL\x10\x02\x12\x17\n\x13SWAPPING_HEURISTICS\x10\x04\x12\x1c\n\x18RECOMPUTATION_HEURISTICS\x10\x05\x12\x19\n\x15SCHEDULING_HEURISTICS\x10\x06\x12\x0e\n\nHEURISTICS\x10\x03\x42\x8c\x01\n\x18org.tensorflow.frameworkB\x14RewriterConfigProtosP\x01ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.rewriter_config_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\024RewriterConfigProtosP\001ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\370\001\001' + _REWRITERCONFIG_CUSTOMGRAPHOPTIMIZER_PARAMETERMAPENTRY._options = None + _REWRITERCONFIG_CUSTOMGRAPHOPTIMIZER_PARAMETERMAPENTRY._serialized_options = b'8\001' + _AUTOPARALLELOPTIONS._serialized_start=154 + _AUTOPARALLELOPTIONS._serialized_end=213 + _SCOPEDALLOCATOROPTIONS._serialized_start=215 + _SCOPEDALLOCATOROPTIONS._serialized_end=258 + _REWRITERCONFIG._serialized_start=261 + _REWRITERCONFIG._serialized_end=3098 + _REWRITERCONFIG_CUSTOMGRAPHOPTIMIZER._serialized_start=2495 + _REWRITERCONFIG_CUSTOMGRAPHOPTIMIZER._serialized_end=2697 + _REWRITERCONFIG_CUSTOMGRAPHOPTIMIZER_PARAMETERMAPENTRY._serialized_start=2623 + _REWRITERCONFIG_CUSTOMGRAPHOPTIMIZER_PARAMETERMAPENTRY._serialized_end=2697 + _REWRITERCONFIG_TOGGLE._serialized_start=2699 + _REWRITERCONFIG_TOGGLE._serialized_end=2799 + _REWRITERCONFIG_CPULAYOUT._serialized_start=2801 + _REWRITERCONFIG_CPULAYOUT._serialized_end=2874 + _REWRITERCONFIG_NUMITERATIONSTYPE._serialized_start=2876 + _REWRITERCONFIG_NUMITERATIONSTYPE._serialized_end=2936 + _REWRITERCONFIG_MEMOPTTYPE._serialized_start=2939 + _REWRITERCONFIG_MEMOPTTYPE._serialized_end=3098 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/rpc_options_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/rpc_options_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..6cce249ecd86c1389835eecdff4852bcd54eb65a --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/rpc_options_pb2.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/rpc_options.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.tsl.protobuf import rpc_options_pb2 as tsl_dot_protobuf_dot_rpc__options__pb2 + +from tensorflow.tsl.protobuf.rpc_options_pb2 import * + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*tensorflow/core/protobuf/rpc_options.proto\x12\x10tensorflow.dummy\x1a\x1etsl/protobuf/rpc_options.protoBWZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_protoP\x00\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.rpc_options_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto' +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/saved_model_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/saved_model_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..2eca9a7948850c01d91e5db174a86321941416ab --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/saved_model_pb2.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/saved_model.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.protobuf import meta_graph_pb2 as tensorflow_dot_core_dot_protobuf_dot_meta__graph__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*tensorflow/core/protobuf/saved_model.proto\x12\ntensorflow\x1a)tensorflow/core/protobuf/meta_graph.proto\"_\n\nSavedModel\x12\"\n\x1asaved_model_schema_version\x18\x01 \x01(\x03\x12-\n\x0bmeta_graphs\x18\x02 \x03(\x0b\x32\x18.tensorflow.MetaGraphDefB\x88\x01\n\x18org.tensorflow.frameworkB\x10SavedModelProtosP\x01ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.saved_model_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\020SavedModelProtosP\001ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\370\001\001' + _SAVEDMODEL._serialized_start=101 + _SAVEDMODEL._serialized_end=196 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/saved_object_graph_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/saved_object_graph_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..d846e399a40b0d4e726d42e1b7b3ecb40b99e1e7 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/saved_object_graph_pb2.py @@ -0,0 +1,69 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/saved_object_graph.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 +from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2 +from tensorflow.core.framework import types_pb2 as tensorflow_dot_core_dot_framework_dot_types__pb2 +from tensorflow.core.framework import variable_pb2 as tensorflow_dot_core_dot_framework_dot_variable__pb2 +from tensorflow.core.framework import versions_pb2 as tensorflow_dot_core_dot_framework_dot_versions__pb2 +from tensorflow.core.protobuf import struct_pb2 as tensorflow_dot_core_dot_protobuf_dot_struct__pb2 +from tensorflow.core.protobuf import trackable_object_graph_pb2 as tensorflow_dot_core_dot_protobuf_dot_trackable__object__graph__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n1tensorflow/core/protobuf/saved_object_graph.proto\x12\ntensorflow\x1a\x19google/protobuf/any.proto\x1a,tensorflow/core/framework/tensor_shape.proto\x1a%tensorflow/core/framework/types.proto\x1a(tensorflow/core/framework/variable.proto\x1a(tensorflow/core/framework/versions.proto\x1a%tensorflow/core/protobuf/struct.proto\x1a\x35tensorflow/core/protobuf/trackable_object_graph.proto\"\xe8\x01\n\x10SavedObjectGraph\x12&\n\x05nodes\x18\x01 \x03(\x0b\x32\x17.tensorflow.SavedObject\x12O\n\x12\x63oncrete_functions\x18\x02 \x03(\x0b\x32\x33.tensorflow.SavedObjectGraph.ConcreteFunctionsEntry\x1a[\n\x16\x43oncreteFunctionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x30\n\x05value\x18\x02 \x01(\x0b\x32!.tensorflow.SavedConcreteFunction:\x02\x38\x01\"\xd0\x07\n\x0bSavedObject\x12R\n\x08\x63hildren\x18\x01 \x03(\x0b\x32@.tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference\x12V\n\x0c\x64\x65pendencies\x18\x0f \x03(\x0b\x32@.tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference\x12^\n\x0eslot_variables\x18\x03 \x03(\x0b\x32\x46.tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference\x12\x32\n\x0buser_object\x18\x04 \x01(\x0b\x32\x1b.tensorflow.SavedUserObjectH\x00\x12\'\n\x05\x61sset\x18\x05 \x01(\x0b\x32\x16.tensorflow.SavedAssetH\x00\x12-\n\x08\x66unction\x18\x06 \x01(\x0b\x32\x19.tensorflow.SavedFunctionH\x00\x12-\n\x08variable\x18\x07 \x01(\x0b\x32\x19.tensorflow.SavedVariableH\x00\x12G\n\x16\x62\x61re_concrete_function\x18\x08 \x01(\x0b\x32%.tensorflow.SavedBareConcreteFunctionH\x00\x12-\n\x08\x63onstant\x18\t \x01(\x0b\x32\x19.tensorflow.SavedConstantH\x00\x12-\n\x08resource\x18\n \x01(\x0b\x32\x19.tensorflow.SavedResourceH\x00\x12\x35\n\x0f\x63\x61ptured_tensor\x18\x0c \x01(\x0b\x32\x1a.tensorflow.CapturedTensorH\x00\x12\x46\n\x10saveable_objects\x18\x0b \x03(\x0b\x32,.tensorflow.SavedObject.SaveableObjectsEntry\x12\x17\n\x0fregistered_name\x18\r \x01(\t\x12\x33\n\x15serialized_user_proto\x18\x0e \x01(\x0b\x32\x14.google.protobuf.Any\x12\x18\n\x10registered_saver\x18\x10 \x01(\t\x1aR\n\x14SaveableObjectsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.tensorflow.SaveableObject:\x02\x38\x01\x42\x06\n\x04kindJ\x04\x08\x02\x10\x03R\nattributes\"d\n\x0fSavedUserObject\x12\x12\n\nidentifier\x18\x01 \x01(\t\x12\'\n\x07version\x18\x02 \x01(\x0b\x32\x16.tensorflow.VersionDef\x12\x14\n\x08metadata\x18\x03 \x01(\tB\x02\x18\x01\"*\n\nSavedAsset\x12\x1c\n\x14\x61sset_file_def_index\x18\x01 \x01(\x05\"\\\n\rSavedFunction\x12\x1a\n\x12\x63oncrete_functions\x18\x01 \x03(\t\x12/\n\rfunction_spec\x18\x02 \x01(\x0b\x32\x18.tensorflow.FunctionSpec\"9\n\x0e\x43\x61pturedTensor\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x11\x63oncrete_function\x18\x02 \x01(\t\"\xa8\x01\n\x15SavedConcreteFunction\x12\x14\n\x0c\x62ound_inputs\x18\x02 \x03(\x05\x12\x42\n\x1d\x63\x61nonicalized_input_signature\x18\x03 \x01(\x0b\x32\x1b.tensorflow.StructuredValue\x12\x35\n\x10output_signature\x18\x04 \x01(\x0b\x32\x1b.tensorflow.StructuredValue\"\xad\x01\n\x19SavedBareConcreteFunction\x12\x1e\n\x16\x63oncrete_function_name\x18\x01 \x01(\t\x12\x19\n\x11\x61rgument_keywords\x18\x02 \x03(\t\x12$\n\x1c\x61llowed_positional_arguments\x18\x03 \x01(\x03\x12/\n\rfunction_spec\x18\x04 \x01(\x0b\x32\x18.tensorflow.FunctionSpec\"\"\n\rSavedConstant\x12\x11\n\toperation\x18\x01 \x01(\t\"\xd7\x02\n\rSavedVariable\x12#\n\x05\x64type\x18\x01 \x01(\x0e\x32\x14.tensorflow.DataType\x12+\n\x05shape\x18\x02 \x01(\x0b\x32\x1c.tensorflow.TensorShapeProto\x12\x11\n\ttrainable\x18\x03 \x01(\x08\x12<\n\x0fsynchronization\x18\x04 \x01(\x0e\x32#.tensorflow.VariableSynchronization\x12\x34\n\x0b\x61ggregation\x18\x05 \x01(\x0e\x32\x1f.tensorflow.VariableAggregation\x12\x0c\n\x04name\x18\x06 \x01(\t\x12\x0e\n\x06\x64\x65vice\x18\x07 \x01(\t\x12O\n,experimental_distributed_variable_components\x18\x08 \x03(\x0b\x32\x19.tensorflow.SavedVariable\"\xfb\x01\n\x0c\x46unctionSpec\x12\x30\n\x0b\x66ullargspec\x18\x01 \x01(\x0b\x32\x1b.tensorflow.StructuredValue\x12\x11\n\tis_method\x18\x02 \x01(\x08\x12\x34\n\x0finput_signature\x18\x05 \x01(\x0b\x32\x1b.tensorflow.StructuredValue\x12\x38\n\x0bjit_compile\x18\x06 \x01(\x0e\x32#.tensorflow.FunctionSpec.JitCompile\"*\n\nJitCompile\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x00\x12\x06\n\x02ON\x10\x01\x12\x07\n\x03OFF\x10\x02J\x04\x08\x03\x10\x04J\x04\x08\x04\x10\x05\"\x1f\n\rSavedResource\x12\x0e\n\x06\x64\x65vice\x18\x01 \x01(\t\"A\n\x0eSaveableObject\x12\x15\n\rsave_function\x18\x02 \x01(\x05\x12\x18\n\x10restore_function\x18\x03 \x01(\x05\x42ZZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.saved_object_graph_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\370\001\001' + _SAVEDOBJECTGRAPH_CONCRETEFUNCTIONSENTRY._options = None + _SAVEDOBJECTGRAPH_CONCRETEFUNCTIONSENTRY._serialized_options = b'8\001' + _SAVEDOBJECT_SAVEABLEOBJECTSENTRY._options = None + _SAVEDOBJECT_SAVEABLEOBJECTSENTRY._serialized_options = b'8\001' + _SAVEDUSEROBJECT.fields_by_name['metadata']._options = None + _SAVEDUSEROBJECT.fields_by_name['metadata']._serialized_options = b'\030\001' + _SAVEDOBJECTGRAPH._serialized_start=356 + _SAVEDOBJECTGRAPH._serialized_end=588 + _SAVEDOBJECTGRAPH_CONCRETEFUNCTIONSENTRY._serialized_start=497 + _SAVEDOBJECTGRAPH_CONCRETEFUNCTIONSENTRY._serialized_end=588 + _SAVEDOBJECT._serialized_start=591 + _SAVEDOBJECT._serialized_end=1567 + _SAVEDOBJECT_SAVEABLEOBJECTSENTRY._serialized_start=1459 + _SAVEDOBJECT_SAVEABLEOBJECTSENTRY._serialized_end=1541 + _SAVEDUSEROBJECT._serialized_start=1569 + _SAVEDUSEROBJECT._serialized_end=1669 + _SAVEDASSET._serialized_start=1671 + _SAVEDASSET._serialized_end=1713 + _SAVEDFUNCTION._serialized_start=1715 + _SAVEDFUNCTION._serialized_end=1807 + _CAPTUREDTENSOR._serialized_start=1809 + _CAPTUREDTENSOR._serialized_end=1866 + _SAVEDCONCRETEFUNCTION._serialized_start=1869 + _SAVEDCONCRETEFUNCTION._serialized_end=2037 + _SAVEDBARECONCRETEFUNCTION._serialized_start=2040 + _SAVEDBARECONCRETEFUNCTION._serialized_end=2213 + _SAVEDCONSTANT._serialized_start=2215 + _SAVEDCONSTANT._serialized_end=2249 + _SAVEDVARIABLE._serialized_start=2252 + _SAVEDVARIABLE._serialized_end=2595 + _FUNCTIONSPEC._serialized_start=2598 + _FUNCTIONSPEC._serialized_end=2849 + _FUNCTIONSPEC_JITCOMPILE._serialized_start=2795 + _FUNCTIONSPEC_JITCOMPILE._serialized_end=2837 + _SAVEDRESOURCE._serialized_start=2851 + _SAVEDRESOURCE._serialized_end=2882 + _SAVEABLEOBJECT._serialized_start=2884 + _SAVEABLEOBJECT._serialized_end=2949 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/saver_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/saver_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..c30770110f44b6464bca1a153a7ab0dddc74df9d --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/saver_pb2.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/saver.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n$tensorflow/core/protobuf/saver.proto\x12\ntensorflow\"\x9e\x02\n\x08SaverDef\x12\x1c\n\x14\x66ilename_tensor_name\x18\x01 \x01(\t\x12\x18\n\x10save_tensor_name\x18\x02 \x01(\t\x12\x17\n\x0frestore_op_name\x18\x03 \x01(\t\x12\x13\n\x0bmax_to_keep\x18\x04 \x01(\x05\x12\x0f\n\x07sharded\x18\x05 \x01(\x08\x12%\n\x1dkeep_checkpoint_every_n_hours\x18\x06 \x01(\x02\x12=\n\x07version\x18\x07 \x01(\x0e\x32,.tensorflow.SaverDef.CheckpointFormatVersion\"5\n\x17\x43heckpointFormatVersion\x12\n\n\x06LEGACY\x10\x00\x12\x06\n\x02V1\x10\x01\x12\x06\n\x02V2\x10\x02\x42~\n\x13org.tensorflow.utilB\x0bSaverProtosP\x01ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.saver_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\023org.tensorflow.utilB\013SaverProtosP\001ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\370\001\001' + _SAVERDEF._serialized_start=53 + _SAVERDEF._serialized_end=339 + _SAVERDEF_CHECKPOINTFORMATVERSION._serialized_start=286 + _SAVERDEF_CHECKPOINTFORMATVERSION._serialized_end=339 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/service_config_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/service_config_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..6f0a6f8381811b3cb92cf46f833f3830dea59bb5 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/service_config_pb2.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/service_config.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.protobuf import data_service_pb2 as tensorflow_dot_core_dot_protobuf_dot_data__service__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n-tensorflow/core/protobuf/service_config.proto\x12\x1ctensorflow.data.experimental\x1a+tensorflow/core/protobuf/data_service.proto\"\xf3\x02\n\x10\x44ispatcherConfig\x12\x0c\n\x04port\x18\x01 \x01(\x03\x12\x10\n\x08protocol\x18\x02 \x01(\t\x12\x10\n\x08work_dir\x18\x03 \x01(\t\x12\x1b\n\x13\x66\x61ult_tolerant_mode\x18\x04 \x01(\x08\x12\x18\n\x10worker_addresses\x18\x07 \x03(\t\x12\x38\n\x0f\x64\x65ployment_mode\x18\t \x01(\x0e\x32\x1f.tensorflow.data.DeploymentMode\x12 \n\x18job_gc_check_interval_ms\x18\x05 \x01(\x03\x12\x19\n\x11job_gc_timeout_ms\x18\x06 \x01(\x03\x12 \n\x18gc_dynamic_sharding_jobs\x18\x0b \x01(\x08\x12\x19\n\x11\x63lient_timeout_ms\x18\x08 \x01(\x03\x12\x19\n\x11worker_timeout_ms\x18\n \x01(\x03\x12\'\n\x1fworker_max_concurrent_snapshots\x18\x0c \x01(\x03\"\xe5\x02\n\x0cWorkerConfig\x12\x0c\n\x04port\x18\x01 \x01(\x03\x12\x10\n\x08protocol\x18\x02 \x01(\t\x12\x1a\n\x12\x64ispatcher_address\x18\x03 \x01(\t\x12\x16\n\x0eworker_address\x18\x04 \x01(\t\x12\x13\n\x0bworker_tags\x18\n \x03(\t\x12\x1d\n\x15heartbeat_interval_ms\x18\x05 \x01(\x03\x12\x1d\n\x15\x64ispatcher_timeout_ms\x18\x06 \x01(\x03\x12\x1e\n\x16\x64\x61ta_transfer_protocol\x18\x07 \x01(\t\x12\x1d\n\x15\x64\x61ta_transfer_address\x18\x08 \x01(\t\x12&\n\x1e\x63ross_trainer_cache_size_bytes\x18\x0b \x01(\x03\x12%\n\x1dsnapshot_max_chunk_size_bytes\x18\x0c \x01(\x03\x12 \n\x18shutdown_quiet_period_ms\x18\t \x01(\x03\x42WZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_protob\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.service_config_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto' + _DISPATCHERCONFIG._serialized_start=125 + _DISPATCHERCONFIG._serialized_end=496 + _WORKERCONFIG._serialized_start=499 + _WORKERCONFIG._serialized_end=856 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/snapshot_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/snapshot_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..c8cd236cbce28fbfb8ec7b9292ff4a35185188ad --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/snapshot_pb2.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/snapshot.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2 +from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2 +from tensorflow.core.framework import types_pb2 as tensorflow_dot_core_dot_framework_dot_types__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\'tensorflow/core/protobuf/snapshot.proto\x12\x1ctensorflow.data.experimental\x1a&tensorflow/core/framework/tensor.proto\x1a,tensorflow/core/framework/tensor_shape.proto\x1a%tensorflow/core/framework/types.proto\"9\n\x0eSnapshotRecord\x12\'\n\x06tensor\x18\x01 \x03(\x0b\x32\x17.tensorflow.TensorProto\"\xb8\x01\n\x16SnapshotMetadataRecord\x12\x12\n\ngraph_hash\x18\x01 \x01(\t\x12\x0e\n\x06run_id\x18\x02 \x01(\t\x12\x1a\n\x12\x63reation_timestamp\x18\x03 \x01(\x03\x12\x0f\n\x07version\x18\x04 \x01(\x03\x12#\n\x05\x64type\x18\x05 \x03(\x0e\x32\x14.tensorflow.DataType\x12\x14\n\x0cnum_elements\x18\x06 \x01(\x03\x12\x12\n\tfinalized\x18\xe8\x07 \x01(\x08\"_\n\x0eTensorMetadata\x12\x32\n\x0ctensor_shape\x18\x02 \x01(\x0b\x32\x1c.tensorflow.TensorShapeProto\x12\x19\n\x11tensor_size_bytes\x18\x03 \x01(\x03\"_\n\x16SnapshotTensorMetadata\x12\x45\n\x0ftensor_metadata\x18\x01 \x03(\x0b\x32,.tensorflow.data.experimental.TensorMetadata\"H\n\x1b\x44istributedSnapshotMetadata\x12\x14\n\x0c\x65lement_spec\x18\x01 \x01(\x0c\x12\x13\n\x0b\x63ompression\x18\x02 \x01(\tBWZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_protob\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.snapshot_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto' + _SNAPSHOTRECORD._serialized_start=198 + _SNAPSHOTRECORD._serialized_end=255 + _SNAPSHOTMETADATARECORD._serialized_start=258 + _SNAPSHOTMETADATARECORD._serialized_end=442 + _TENSORMETADATA._serialized_start=444 + _TENSORMETADATA._serialized_end=539 + _SNAPSHOTTENSORMETADATA._serialized_start=541 + _SNAPSHOTTENSORMETADATA._serialized_end=636 + _DISTRIBUTEDSNAPSHOTMETADATA._serialized_start=638 + _DISTRIBUTEDSNAPSHOTMETADATA._serialized_end=710 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/status_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/status_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..fc50e1864a6c5a588410334bb748d873437e55d7 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/status_pb2.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/status.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.tsl.protobuf import status_pb2 as tsl_dot_protobuf_dot_status__pb2 + +from tensorflow.tsl.protobuf.status_pb2 import * + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n%tensorflow/core/protobuf/status.proto\x12\x10tensorflow.dummy\x1a\x19tsl/protobuf/status.protoBWZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_protoP\x00\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.status_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto' +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/struct_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/struct_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..0e9389b41c0a752b48bc502e85f9a1fddc32a26c --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/struct_pb2.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/struct.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2 +from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2 +from tensorflow.core.framework import types_pb2 as tensorflow_dot_core_dot_framework_dot_types__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n%tensorflow/core/protobuf/struct.proto\x12\ntensorflow\x1a&tensorflow/core/framework/tensor.proto\x1a,tensorflow/core/framework/tensor_shape.proto\x1a%tensorflow/core/framework/types.proto\"\xf1\x05\n\x0fStructuredValue\x12+\n\nnone_value\x18\x01 \x01(\x0b\x32\x15.tensorflow.NoneValueH\x00\x12\x17\n\rfloat64_value\x18\x0b \x01(\x01H\x00\x12\x15\n\x0bint64_value\x18\x0c \x01(\x12H\x00\x12\x16\n\x0cstring_value\x18\r \x01(\tH\x00\x12\x14\n\nbool_value\x18\x0e \x01(\x08H\x00\x12:\n\x12tensor_shape_value\x18\x1f \x01(\x0b\x32\x1c.tensorflow.TensorShapeProtoH\x00\x12\x32\n\x12tensor_dtype_value\x18 \x01(\x0e\x32\x14.tensorflow.DataTypeH\x00\x12\x38\n\x11tensor_spec_value\x18! \x01(\x0b\x32\x1b.tensorflow.TensorSpecProtoH\x00\x12\x34\n\x0ftype_spec_value\x18\" \x01(\x0b\x32\x19.tensorflow.TypeSpecProtoH\x00\x12G\n\x19\x62ounded_tensor_spec_value\x18# \x01(\x0b\x32\".tensorflow.BoundedTensorSpecProtoH\x00\x12+\n\nlist_value\x18\x33 \x01(\x0b\x32\x15.tensorflow.ListValueH\x00\x12-\n\x0btuple_value\x18\x34 \x01(\x0b\x32\x16.tensorflow.TupleValueH\x00\x12+\n\ndict_value\x18\x35 \x01(\x0b\x32\x15.tensorflow.DictValueH\x00\x12\x38\n\x11named_tuple_value\x18\x36 \x01(\x0b\x32\x1b.tensorflow.NamedTupleValueH\x00\x12/\n\x0ctensor_value\x18\x37 \x01(\x0b\x32\x17.tensorflow.TensorProtoH\x00\x12.\n\x0bnumpy_value\x18\x38 \x01(\x0b\x32\x17.tensorflow.TensorProtoH\x00\x42\x06\n\x04kind\"\x0b\n\tNoneValue\"8\n\tListValue\x12+\n\x06values\x18\x01 \x03(\x0b\x32\x1b.tensorflow.StructuredValue\"9\n\nTupleValue\x12+\n\x06values\x18\x01 \x03(\x0b\x32\x1b.tensorflow.StructuredValue\"\x8a\x01\n\tDictValue\x12\x31\n\x06\x66ields\x18\x01 \x03(\x0b\x32!.tensorflow.DictValue.FieldsEntry\x1aJ\n\x0b\x46ieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12*\n\x05value\x18\x02 \x01(\x0b\x32\x1b.tensorflow.StructuredValue:\x02\x38\x01\"D\n\tPairValue\x12\x0b\n\x03key\x18\x01 \x01(\t\x12*\n\x05value\x18\x02 \x01(\x0b\x32\x1b.tensorflow.StructuredValue\"F\n\x0fNamedTupleValue\x12\x0c\n\x04name\x18\x01 \x01(\t\x12%\n\x06values\x18\x02 \x03(\x0b\x32\x15.tensorflow.PairValue\"q\n\x0fTensorSpecProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12+\n\x05shape\x18\x02 \x01(\x0b\x32\x1c.tensorflow.TensorShapeProto\x12#\n\x05\x64type\x18\x03 \x01(\x0e\x32\x14.tensorflow.DataType\"\xcc\x01\n\x16\x42oundedTensorSpecProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12+\n\x05shape\x18\x02 \x01(\x0b\x32\x1c.tensorflow.TensorShapeProto\x12#\n\x05\x64type\x18\x03 \x01(\x0e\x32\x14.tensorflow.DataType\x12(\n\x07minimum\x18\x04 \x01(\x0b\x32\x17.tensorflow.TensorProto\x12(\n\x07maximum\x18\x05 \x01(\x0b\x32\x17.tensorflow.TensorProto\"\xf8\x03\n\rTypeSpecProto\x12@\n\x0ftype_spec_class\x18\x01 \x01(\x0e\x32\'.tensorflow.TypeSpecProto.TypeSpecClass\x12/\n\ntype_state\x18\x02 \x01(\x0b\x32\x1b.tensorflow.StructuredValue\x12\x1c\n\x14type_spec_class_name\x18\x03 \x01(\t\x12\x1b\n\x13num_flat_components\x18\x04 \x01(\x05\"\xb8\x02\n\rTypeSpecClass\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x16\n\x12SPARSE_TENSOR_SPEC\x10\x01\x12\x17\n\x13INDEXED_SLICES_SPEC\x10\x02\x12\x16\n\x12RAGGED_TENSOR_SPEC\x10\x03\x12\x15\n\x11TENSOR_ARRAY_SPEC\x10\x04\x12\x15\n\x11\x44\x41TA_DATASET_SPEC\x10\x05\x12\x16\n\x12\x44\x41TA_ITERATOR_SPEC\x10\x06\x12\x11\n\rOPTIONAL_SPEC\x10\x07\x12\x14\n\x10PER_REPLICA_SPEC\x10\x08\x12\x11\n\rVARIABLE_SPEC\x10\t\x12\x16\n\x12ROW_PARTITION_SPEC\x10\n\x12\x18\n\x14REGISTERED_TYPE_SPEC\x10\x0c\x12\x17\n\x13\x45XTENSION_TYPE_SPEC\x10\r\"\x04\x08\x0b\x10\x0b\x42WZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_protob\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.struct_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto' + _DICTVALUE_FIELDSENTRY._options = None + _DICTVALUE_FIELDSENTRY._serialized_options = b'8\001' + _STRUCTUREDVALUE._serialized_start=179 + _STRUCTUREDVALUE._serialized_end=932 + _NONEVALUE._serialized_start=934 + _NONEVALUE._serialized_end=945 + _LISTVALUE._serialized_start=947 + _LISTVALUE._serialized_end=1003 + _TUPLEVALUE._serialized_start=1005 + _TUPLEVALUE._serialized_end=1062 + _DICTVALUE._serialized_start=1065 + _DICTVALUE._serialized_end=1203 + _DICTVALUE_FIELDSENTRY._serialized_start=1129 + _DICTVALUE_FIELDSENTRY._serialized_end=1203 + _PAIRVALUE._serialized_start=1205 + _PAIRVALUE._serialized_end=1273 + _NAMEDTUPLEVALUE._serialized_start=1275 + _NAMEDTUPLEVALUE._serialized_end=1345 + _TENSORSPECPROTO._serialized_start=1347 + _TENSORSPECPROTO._serialized_end=1460 + _BOUNDEDTENSORSPECPROTO._serialized_start=1463 + _BOUNDEDTENSORSPECPROTO._serialized_end=1667 + _TYPESPECPROTO._serialized_start=1670 + _TYPESPECPROTO._serialized_end=2174 + _TYPESPECPROTO_TYPESPECCLASS._serialized_start=1862 + _TYPESPECPROTO_TYPESPECCLASS._serialized_end=2174 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/tensor_bundle_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/tensor_bundle_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..98c443bfa6dd5fe0aab030f60d3954ebed431981 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/tensor_bundle_pb2.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/tensor_bundle.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2 +from tensorflow.core.framework import tensor_slice_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__slice__pb2 +from tensorflow.core.framework import types_pb2 as tensorflow_dot_core_dot_framework_dot_types__pb2 +from tensorflow.core.framework import versions_pb2 as tensorflow_dot_core_dot_framework_dot_versions__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,tensorflow/core/protobuf/tensor_bundle.proto\x12\ntensorflow\x1a,tensorflow/core/framework/tensor_shape.proto\x1a,tensorflow/core/framework/tensor_slice.proto\x1a%tensorflow/core/framework/types.proto\x1a(tensorflow/core/framework/versions.proto\"\xb1\x01\n\x11\x42undleHeaderProto\x12\x12\n\nnum_shards\x18\x01 \x01(\x05\x12<\n\nendianness\x18\x02 \x01(\x0e\x32(.tensorflow.BundleHeaderProto.Endianness\x12\'\n\x07version\x18\x03 \x01(\x0b\x32\x16.tensorflow.VersionDef\"!\n\nEndianness\x12\n\n\x06LITTLE\x10\x00\x12\x07\n\x03\x42IG\x10\x01\"\xd2\x01\n\x10\x42undleEntryProto\x12#\n\x05\x64type\x18\x01 \x01(\x0e\x32\x14.tensorflow.DataType\x12+\n\x05shape\x18\x02 \x01(\x0b\x32\x1c.tensorflow.TensorShapeProto\x12\x10\n\x08shard_id\x18\x03 \x01(\x05\x12\x0e\n\x06offset\x18\x04 \x01(\x03\x12\x0c\n\x04size\x18\x05 \x01(\x03\x12\x0e\n\x06\x63rc32c\x18\x06 \x01(\x07\x12,\n\x06slices\x18\x07 \x03(\x0b\x32\x1c.tensorflow.TensorSliceProtoB\x85\x01\n\x13org.tensorflow.utilB\x12TensorBundleProtosP\x01ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.tensor_bundle_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\023org.tensorflow.utilB\022TensorBundleProtosP\001ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\370\001\001' + _BUNDLEHEADERPROTO._serialized_start=234 + _BUNDLEHEADERPROTO._serialized_end=411 + _BUNDLEHEADERPROTO_ENDIANNESS._serialized_start=378 + _BUNDLEHEADERPROTO_ENDIANNESS._serialized_end=411 + _BUNDLEENTRYPROTO._serialized_start=414 + _BUNDLEENTRYPROTO._serialized_end=624 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/tensorflow_server_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/tensorflow_server_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..d2d68ddcfc6bb9b0d33af05f4d57e1d1a32ce771 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/tensorflow_server_pb2.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/tensorflow_server.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.protobuf import cluster_pb2 as tensorflow_dot_core_dot_protobuf_dot_cluster__pb2 +from tensorflow.core.protobuf import config_pb2 as tensorflow_dot_core_dot_protobuf_dot_config__pb2 +from tensorflow.core.protobuf import device_filters_pb2 as tensorflow_dot_core_dot_protobuf_dot_device__filters__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n0tensorflow/core/protobuf/tensorflow_server.proto\x12\ntensorflow\x1a&tensorflow/core/protobuf/cluster.proto\x1a%tensorflow/core/protobuf/config.proto\x1a-tensorflow/core/protobuf/device_filters.proto\"\x86\x02\n\tServerDef\x12\'\n\x07\x63luster\x18\x01 \x01(\x0b\x32\x16.tensorflow.ClusterDef\x12\x10\n\x08job_name\x18\x02 \x01(\t\x12\x0f\n\x07replica\x18\x08 \x01(\x05\x12\x12\n\ntask_index\x18\x03 \x01(\x05\x12\x37\n\x16\x64\x65\x66\x61ult_session_config\x18\x04 \x01(\x0b\x32\x17.tensorflow.ConfigProto\x12\x10\n\x08protocol\x18\x05 \x01(\t\x12\x0c\n\x04port\x18\x06 \x01(\x05\x12@\n\x16\x63luster_device_filters\x18\x07 \x01(\x0b\x32 .tensorflow.ClusterDeviceFiltersB\x86\x01\n\x1aorg.tensorflow.distruntimeB\x0cServerProtosP\x01ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.tensorflow_server_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\032org.tensorflow.distruntimeB\014ServerProtosP\001ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\370\001\001' + _SERVERDEF._serialized_start=191 + _SERVERDEF._serialized_end=453 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/tpu/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/tpu/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/tpu/compilation_result_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/tpu/compilation_result_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..3dead3879bae629eb7b30b2113da53b550efd2aa --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/tpu/compilation_result_pb2.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/tpu/compilation_result.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.compiler.xla.service import hlo_pb2 as xla_dot_service_dot_hlo__pb2 +from tensorflow.core.protobuf import error_codes_pb2 as tensorflow_dot_core_dot_protobuf_dot_error__codes__pb2 +try: + tsl_dot_protobuf_dot_error__codes__pb2 = tensorflow_dot_core_dot_protobuf_dot_error__codes__pb2.tsl_dot_protobuf_dot_error__codes__pb2 +except AttributeError: + tsl_dot_protobuf_dot_error__codes__pb2 = tensorflow_dot_core_dot_protobuf_dot_error__codes__pb2.tsl.protobuf.error_codes_pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n5tensorflow/core/protobuf/tpu/compilation_result.proto\x12\x0etensorflow.tpu\x1a\x15xla/service/hlo.proto\x1a*tensorflow/core/protobuf/error_codes.proto\"\xf9\x01\n\x16\x43ompilationResultProto\x12+\n\x0bstatus_code\x18\x01 \x01(\x0e\x32\x16.tensorflow.error.Code\x12\x1c\n\x14status_error_message\x18\x02 \x01(\t\x12!\n\nhlo_protos\x18\x03 \x03(\x0b\x32\r.xla.HloProto\x12\x44\n\nerror_code\x18\x04 \x01(\x0e\x32\x30.tensorflow.tpu.CompilationResultProto.ErrorCode\"+\n\tErrorCode\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x11\n\rOUT_OF_MEMORY\x10\x01\x42\x03\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.tpu.compilation_result_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\370\001\001' + _COMPILATIONRESULTPROTO._serialized_start=141 + _COMPILATIONRESULTPROTO._serialized_end=390 + _COMPILATIONRESULTPROTO_ERRORCODE._serialized_start=347 + _COMPILATIONRESULTPROTO_ERRORCODE._serialized_end=390 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/tpu/dynamic_padding_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/tpu/dynamic_padding_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..b69d197f2eafc551c09696bb6240f178cead9641 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/tpu/dynamic_padding_pb2.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/tpu/dynamic_padding.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n2tensorflow/core/protobuf/tpu/dynamic_padding.proto\x12\x0etensorflow.tpu\"O\n\nPaddingMap\x12\x11\n\targ_index\x18\x01 \x01(\x05\x12\x13\n\x0bshape_index\x18\x02 \x01(\x05\x12\x19\n\x11padding_arg_index\x18\x03 \x01(\x05\x42\x03\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.tpu.dynamic_padding_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\370\001\001' + _PADDINGMAP._serialized_start=70 + _PADDINGMAP._serialized_end=149 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/tpu/optimization_parameters_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/tpu/optimization_parameters_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..caa4d7485c74a49ffe7c3d2b7b698a855abf188a --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/tpu/optimization_parameters_pb2.py @@ -0,0 +1,91 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/tpu/optimization_parameters.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import wrappers_pb2 as google_dot_protobuf_dot_wrappers__pb2 +from tensorflow.compiler.xla.service import hlo_pb2 as xla_dot_service_dot_hlo__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n:tensorflow/core/protobuf/tpu/optimization_parameters.proto\x12\x0etensorflow.tpu\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x15xla/service/hlo.proto\"h\n\x0e\x43lippingLimits\x12*\n\x05lower\x18\x01 \x01(\x0b\x32\x1b.google.protobuf.FloatValue\x12*\n\x05upper\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.FloatValue\"v\n\x15SimulatedQuantization\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12\x37\n\x0f\x63lipping_limits\x18\x02 \x01(\x0b\x32\x1e.tensorflow.tpu.ClippingLimits\x12\x13\n\x0bnum_buckets\x18\x03 \x01(\x05\"\"\n\x13\x44ynamicLearningRate\x12\x0b\n\x03tag\x18\x01 \x01(\x05\"k\n\x0cLearningRate\x12\x12\n\x08\x63onstant\x18\x01 \x01(\x02H\x00\x12\x36\n\x07\x64ynamic\x18\x02 \x01(\x0b\x32#.tensorflow.tpu.DynamicLearningRateH\x00\x42\x0f\n\rlearning_rate\".\n\x11\x41\x64\x61gradParametersJ\x04\x08\x01\x10\x02R\x13initial_accumulator\"u\n\x19\x41\x64\x61gradMomentumParameters\x12\x10\n\x08momentum\x18\x01 \x01(\x02\x12\x14\n\x0cuse_nesterov\x18\x02 \x01(\x08\x12\x10\n\x08\x65xponent\x18\x03 \x01(\x02\x12\r\n\x05\x62\x65ta2\x18\x04 \x01(\x02\x12\x0f\n\x07\x65psilon\x18\x05 \x01(\x02\"m\n\x18\x42oundedAdagradParameters\x12 \n\x18update_accumulator_first\x18\x01 \x01(\x08\x12\x16\n\x0emax_var_update\x18\x02 \x01(\x02\x12\x17\n\x0fmax_accumulator\x18\x03 \x01(\x02\"%\n#StochasticGradientDescentParameters\"\xb6\x01\n\x0e\x46trlParameters\x12\n\n\x02l1\x18\x01 \x01(\x02\x12\n\n\x02l2\x18\x02 \x01(\x02\x12\x10\n\x08lr_power\x18\x03 \x01(\x02\x12\x0c\n\x04\x62\x65ta\x18\x07 \x01(\x02\x12\x1d\n\x15multiply_linear_by_lr\x18\x06 \x01(\x08\x12\"\n\x16\x61llow_zero_accumulator\x18\x08 \x01(\x08\x42\x02\x18\x01J\x04\x08\x04\x10\x05J\x04\x08\x05\x10\x06R\rinitial_accumR\x0einitial_linear\"\x99\x01\n\x0e\x41\x64\x61mParameters\x12\r\n\x05\x62\x65ta1\x18\x03 \x01(\x02\x12\r\n\x05\x62\x65ta2\x18\x04 \x01(\x02\x12\x0f\n\x07\x65psilon\x18\x05 \x01(\x02\x12\x19\n\x11use_non_lazy_adam\x18\x08 \x01(\x08\x12\x1b\n\x13use_sum_inside_sqrt\x18\n \x01(\x08J\x04\x08\x06\x10\x07J\x04\x08\x07\x10\x08R\tinitial_mR\tinitial_v\"Q\n\x12MomentumParameters\x12\x10\n\x08momentum\x18\x01 \x01(\x02\x12\x14\n\x0cuse_nesterov\x18\x02 \x01(\x08J\x04\x08\x03\x10\x04R\rinitial_accum\"I\n\x0eLionParameters\x12\r\n\x05\x62\x65ta1\x18\x01 \x01(\x02\x12\r\n\x05\x62\x65ta2\x18\x02 \x01(\x02\x12\x19\n\x11use_non_lazy_lion\x18\x03 \x01(\x08\"h\n\x11RmsPropParameters\x12\x0b\n\x03rho\x18\x01 \x01(\x02\x12\x10\n\x08momentum\x18\x02 \x01(\x02\x12\x0f\n\x07\x65psilon\x18\x03 \x01(\x02J\x04\x08\x04\x10\x05J\x04\x08\x05\x10\x06R\ninitial_msR\x0binitial_mom\"\x82\x01\n\x19\x43\x65nteredRmsPropParameters\x12\x0b\n\x03rho\x18\x01 \x01(\x02\x12\x10\n\x08momentum\x18\x02 \x01(\x02\x12\x0f\n\x07\x65psilon\x18\x03 \x01(\x02J\x04\x08\x04\x10\x05J\x04\x08\x05\x10\x06J\x04\x08\x06\x10\x07R\ninitial_msR\x0binitial_momR\ninitial_mg\"\x9d\x03\n\x19MdlAdagradLightParameters\x12\n\n\x02l2\x18\x01 \x01(\x02\x12\x10\n\x08lr_power\x18\x02 \x01(\x02\x12 \n\x18min_servable_mdl_benefit\x18\x03 \x01(\x02\x12\x19\n\x11mdl_mix_in_margin\x18\x04 \x01(\x02\x12 \n\x18mdl_benefit_rampup_coeff\x18\x05 \x01(\x02\x12\x16\n\x0emdl_min_weight\x18\x06 \x01(\x02\x12\x1d\n\x15\x62\x65nefit_revisit_scale\x18\x07 \x01(\x02\x12\x19\n\x11max_event_benefit\x18\x08 \x01(\x02\x12\x19\n\x11max_total_benefit\x18\t \x01(\x02\x12\x16\n\x0emdl_hard_limit\x18\n \x01(\x02\x12\x1e\n\x16hard_limit_min_benefit\x18\x0b \x01(\x08\x12\x16\n\x0emdl_regularize\x18\x0c \x01(\x08J\x04\x08\r\x10\x0eJ\x04\x08\x0e\x10\x0fJ\x04\x08\x0f\x10\x10R\x13initial_accumulatorR\x0einitial_weightR\x0finitial_benefit\"c\n\x12\x41\x64\x61\x64\x65ltaParameters\x12\x0b\n\x03rho\x18\x01 \x01(\x02\x12\x0f\n\x07\x65psilon\x18\x02 \x01(\x02J\x04\x08\x03\x10\x04J\x04\x08\x04\x10\x05R\x13initial_accumulatorR\x0einitial_update\"N\n\x19ProximalAdagradParameters\x12\n\n\x02l1\x18\x01 \x01(\x02\x12\n\n\x02l2\x18\x02 \x01(\x02J\x04\x08\x03\x10\x04R\x13initial_accumulator\"I\n\x14OnlineYogiParameters\x12\n\n\x02l1\x18\x01 \x01(\x02\x12\n\n\x02l2\x18\x02 \x01(\x02\x12\r\n\x05\x62\x65ta2\x18\x03 \x01(\x02J\x04\x08\x06\x10\x07J\x04\x08\x07\x10\x08\"k\n\x16ProximalYogiParameters\x12\n\n\x02l1\x18\x01 \x01(\x02\x12\n\n\x02l2\x18\x02 \x01(\x02\x12\r\n\x05\x62\x65ta1\x18\x03 \x01(\x02\x12\r\n\x05\x62\x65ta2\x18\x04 \x01(\x02\x12\x0f\n\x07\x65psilon\x18\x05 \x01(\x02J\x04\x08\x08\x10\tJ\x04\x08\t\x10\n\"r\n\x1c\x46requencyEstimatorParameters\x12\x0b\n\x03tau\x18\x01 \x01(\x02\x12\x11\n\tmax_delta\x18\x02 \x01(\x02\x12\x19\n\x11outlier_threshold\x18\x03 \x01(\x02\x12\x17\n\x0fweight_exponent\x18\x04 \x01(\x02\"J\n\x1cUserDefinedProgramParameters\x12$\n\x07program\x18\x01 \x01(\x0b\x32\x13.xla.HloModuleProtoJ\x04\x08\x02\x10\x03\"\x12\n\x10\x41ssignParameters\"R\n\x1aGradientAccumulationStatus\"4\n\x06Status\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\"S\n\x1bLowDimensionalPackingStatus\"4\n\x06Status\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\"\xaf\x01\n\x1dHotIdReplicationConfiguration\x12\x44\n\x06status\x18\x01 \x01(\x0e\x32\x34.tensorflow.tpu.HotIdReplicationConfiguration.Status\"H\n\x06Status\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\x12\n\x0eMIGRATION_ONLY\x10\x03\"\x84\x0e\n\x16OptimizationParameters\x12\x33\n\rlearning_rate\x18\r \x01(\x0b\x32\x1c.tensorflow.tpu.LearningRate\x12\x37\n\x0f\x63lipping_limits\x18\x02 \x01(\x0b\x32\x1e.tensorflow.tpu.ClippingLimits\x12@\n\x18gradient_clipping_limits\x18\x07 \x01(\x0b\x32\x1e.tensorflow.tpu.ClippingLimits\x12\x1b\n\x13weight_decay_factor\x18\x10 \x01(\x02\x12\x35\n-multiply_weight_decay_factor_by_learning_rate\x18\x16 \x01(\x08\x12\x45\n\x16simulated_quantization\x18\x1b \x01(\x0b\x32%.tensorflow.tpu.SimulatedQuantization\x12W\n\x1cgradient_accumulation_status\x18\x11 \x01(\x0e\x32\x31.tensorflow.tpu.GradientAccumulationStatus.Status\x12Z\n\x1elow_dimensional_packing_status\x18\x1c \x01(\x0e\x32\x32.tensorflow.tpu.LowDimensionalPackingStatus.Status\x12W\n hot_id_replication_configuration\x18\x12 \x01(\x0b\x32-.tensorflow.tpu.HotIdReplicationConfiguration\x12\x34\n\x07\x61\x64\x61grad\x18\x03 \x01(\x0b\x32!.tensorflow.tpu.AdagradParametersH\x00\x12\x45\n\x10\x61\x64\x61grad_momentum\x18\x1a \x01(\x0b\x32).tensorflow.tpu.AdagradMomentumParametersH\x00\x12\x43\n\x0f\x62ounded_adagrad\x18\x13 \x01(\x0b\x32(.tensorflow.tpu.BoundedAdagradParametersH\x00\x12Z\n\x1bstochastic_gradient_descent\x18\x04 \x01(\x0b\x32\x33.tensorflow.tpu.StochasticGradientDescentParametersH\x00\x12.\n\x04\x66trl\x18\x05 \x01(\x0b\x32\x1e.tensorflow.tpu.FtrlParametersH\x00\x12.\n\x04\x61\x64\x61m\x18\x06 \x01(\x0b\x32\x1e.tensorflow.tpu.AdamParametersH\x00\x12\x36\n\x08momentum\x18\x08 \x01(\x0b\x32\".tensorflow.tpu.MomentumParametersH\x00\x12.\n\x04lion\x18\x1d \x01(\x0b\x32\x1e.tensorflow.tpu.LionParametersH\x00\x12\x35\n\x08rms_prop\x18\t \x01(\x0b\x32!.tensorflow.tpu.RmsPropParametersH\x00\x12\x46\n\x11\x63\x65ntered_rms_prop\x18\n \x01(\x0b\x32).tensorflow.tpu.CenteredRmsPropParametersH\x00\x12\x46\n\x11mdl_adagrad_light\x18\x0b \x01(\x0b\x32).tensorflow.tpu.MdlAdagradLightParametersH\x00\x12\x36\n\x08\x61\x64\x61\x64\x65lta\x18\x0c \x01(\x0b\x32\".tensorflow.tpu.AdadeltaParametersH\x00\x12\x45\n\x10proximal_adagrad\x18\x0e \x01(\x0b\x32).tensorflow.tpu.ProximalAdagradParametersH\x00\x12;\n\x0bonline_yogi\x18\x14 \x01(\x0b\x32$.tensorflow.tpu.OnlineYogiParametersH\x00\x12?\n\rproximal_yogi\x18\x15 \x01(\x0b\x32&.tensorflow.tpu.ProximalYogiParametersH\x00\x12K\n\x13\x66requency_estimator\x18\x17 \x01(\x0b\x32,.tensorflow.tpu.FrequencyEstimatorParametersH\x00\x12L\n\x14user_defined_program\x18\x18 \x01(\x0b\x32,.tensorflow.tpu.UserDefinedProgramParametersH\x00\x12\x32\n\x06\x61ssign\x18\x19 \x01(\x0b\x32 .tensorflow.tpu.AssignParametersH\x00\x42\x0c\n\nparametersJ\x04\x08\x01\x10\x02J\x04\x08\x0f\x10\x10\"\x9e\x02\n\x1aStateVariableSpecification\x12\x0c\n\x04name\x18\x01 \x01(\t\x12N\n\x0cuser_defined\x18\x02 \x01(\x0b\x32\x36.tensorflow.tpu.StateVariableSpecification.UserDefinedH\x00\x12Y\n\x12\x66ill_with_constant\x18\x03 \x01(\x0b\x32;.tensorflow.tpu.StateVariableSpecification.FillWithConstantH\x00\x1a\x13\n\x0bUserDefinedJ\x04\x08\x01\x10\x02\x1a)\n\x10\x46illWithConstant\x12\x15\n\rinitial_value\x18\x01 \x01(\x01\x42\x07\n\x05usageb\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.tpu.optimization_parameters_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + _FTRLPARAMETERS.fields_by_name['allow_zero_accumulator']._options = None + _FTRLPARAMETERS.fields_by_name['allow_zero_accumulator']._serialized_options = b'\030\001' + _CLIPPINGLIMITS._serialized_start=133 + _CLIPPINGLIMITS._serialized_end=237 + _SIMULATEDQUANTIZATION._serialized_start=239 + _SIMULATEDQUANTIZATION._serialized_end=357 + _DYNAMICLEARNINGRATE._serialized_start=359 + _DYNAMICLEARNINGRATE._serialized_end=393 + _LEARNINGRATE._serialized_start=395 + _LEARNINGRATE._serialized_end=502 + _ADAGRADPARAMETERS._serialized_start=504 + _ADAGRADPARAMETERS._serialized_end=550 + _ADAGRADMOMENTUMPARAMETERS._serialized_start=552 + _ADAGRADMOMENTUMPARAMETERS._serialized_end=669 + _BOUNDEDADAGRADPARAMETERS._serialized_start=671 + _BOUNDEDADAGRADPARAMETERS._serialized_end=780 + _STOCHASTICGRADIENTDESCENTPARAMETERS._serialized_start=782 + _STOCHASTICGRADIENTDESCENTPARAMETERS._serialized_end=819 + _FTRLPARAMETERS._serialized_start=822 + _FTRLPARAMETERS._serialized_end=1004 + _ADAMPARAMETERS._serialized_start=1007 + _ADAMPARAMETERS._serialized_end=1160 + _MOMENTUMPARAMETERS._serialized_start=1162 + _MOMENTUMPARAMETERS._serialized_end=1243 + _LIONPARAMETERS._serialized_start=1245 + _LIONPARAMETERS._serialized_end=1318 + _RMSPROPPARAMETERS._serialized_start=1320 + _RMSPROPPARAMETERS._serialized_end=1424 + _CENTEREDRMSPROPPARAMETERS._serialized_start=1427 + _CENTEREDRMSPROPPARAMETERS._serialized_end=1557 + _MDLADAGRADLIGHTPARAMETERS._serialized_start=1560 + _MDLADAGRADLIGHTPARAMETERS._serialized_end=1973 + _ADADELTAPARAMETERS._serialized_start=1975 + _ADADELTAPARAMETERS._serialized_end=2074 + _PROXIMALADAGRADPARAMETERS._serialized_start=2076 + _PROXIMALADAGRADPARAMETERS._serialized_end=2154 + _ONLINEYOGIPARAMETERS._serialized_start=2156 + _ONLINEYOGIPARAMETERS._serialized_end=2229 + _PROXIMALYOGIPARAMETERS._serialized_start=2231 + _PROXIMALYOGIPARAMETERS._serialized_end=2338 + _FREQUENCYESTIMATORPARAMETERS._serialized_start=2340 + _FREQUENCYESTIMATORPARAMETERS._serialized_end=2454 + _USERDEFINEDPROGRAMPARAMETERS._serialized_start=2456 + _USERDEFINEDPROGRAMPARAMETERS._serialized_end=2530 + _ASSIGNPARAMETERS._serialized_start=2532 + _ASSIGNPARAMETERS._serialized_end=2550 + _GRADIENTACCUMULATIONSTATUS._serialized_start=2552 + _GRADIENTACCUMULATIONSTATUS._serialized_end=2634 + _GRADIENTACCUMULATIONSTATUS_STATUS._serialized_start=2582 + _GRADIENTACCUMULATIONSTATUS_STATUS._serialized_end=2634 + _LOWDIMENSIONALPACKINGSTATUS._serialized_start=2636 + _LOWDIMENSIONALPACKINGSTATUS._serialized_end=2719 + _LOWDIMENSIONALPACKINGSTATUS_STATUS._serialized_start=2582 + _LOWDIMENSIONALPACKINGSTATUS_STATUS._serialized_end=2634 + _HOTIDREPLICATIONCONFIGURATION._serialized_start=2722 + _HOTIDREPLICATIONCONFIGURATION._serialized_end=2897 + _HOTIDREPLICATIONCONFIGURATION_STATUS._serialized_start=2825 + _HOTIDREPLICATIONCONFIGURATION_STATUS._serialized_end=2897 + _OPTIMIZATIONPARAMETERS._serialized_start=2900 + _OPTIMIZATIONPARAMETERS._serialized_end=4696 + _STATEVARIABLESPECIFICATION._serialized_start=4699 + _STATEVARIABLESPECIFICATION._serialized_end=4985 + _STATEVARIABLESPECIFICATION_USERDEFINED._serialized_start=4914 + _STATEVARIABLESPECIFICATION_USERDEFINED._serialized_end=4933 + _STATEVARIABLESPECIFICATION_FILLWITHCONSTANT._serialized_start=4935 + _STATEVARIABLESPECIFICATION_FILLWITHCONSTANT._serialized_end=4976 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/tpu/topology_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/tpu/topology_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..e2af36e168f730a790aef0b9c9427847199605e7 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/tpu/topology_pb2.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/tpu/topology.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n+tensorflow/core/protobuf/tpu/topology.proto\x12\x0etensorflow.tpu\"\xc1\x01\n\x12TPUHardwareFeature\x12N\n\x11\x65mbedding_feature\x18\x01 \x01(\x0e\x32\x33.tensorflow.tpu.TPUHardwareFeature.EmbeddingFeature\x12&\n\x1enum_embedding_devices_per_chip\x18\x02 \x01(\x05\"3\n\x10\x45mbeddingFeature\x12\x0f\n\x0bUNSUPPORTED\x10\x00\x12\x06\n\x02V1\x10\x01\x12\x06\n\x02V2\x10\x02\"\xb6\x01\n\rTopologyProto\x12\x12\n\nmesh_shape\x18\x01 \x03(\x05\x12\x11\n\tnum_tasks\x18\x02 \x01(\x05\x12 \n\x18num_tpu_devices_per_task\x18\x03 \x01(\x05\x12\x1a\n\x12\x64\x65vice_coordinates\x18\x04 \x03(\x05\x12@\n\x14tpu_hardware_feature\x18\x05 \x01(\x0b\x32\".tensorflow.tpu.TPUHardwareFeatureB\x03\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.tpu.topology_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\370\001\001' + _TPUHARDWAREFEATURE._serialized_start=64 + _TPUHARDWAREFEATURE._serialized_end=257 + _TPUHARDWAREFEATURE_EMBEDDINGFEATURE._serialized_start=206 + _TPUHARDWAREFEATURE_EMBEDDINGFEATURE._serialized_end=257 + _TOPOLOGYPROTO._serialized_start=260 + _TOPOLOGYPROTO._serialized_end=442 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/tpu/tpu_embedding_configuration_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/tpu/tpu_embedding_configuration_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..13fbe1b7670aa97fa3c48152f88b37a3656e6246 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/tpu/tpu_embedding_configuration_pb2.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/tpu/tpu_embedding_configuration.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.protobuf.tpu import optimization_parameters_pb2 as tensorflow_dot_core_dot_protobuf_dot_tpu_dot_optimization__parameters__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n>tensorflow/core/protobuf/tpu/tpu_embedding_configuration.proto\x12\x0etensorflow.tpu\x1a:tensorflow/core/protobuf/tpu/optimization_parameters.proto\"\x93\x08\n\x19TPUEmbeddingConfiguration\x12S\n\x10table_descriptor\x18\x01 \x03(\x0b\x32\x39.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor\x12<\n\x04mode\x18\x02 \x01(\x0e\x32..tensorflow.tpu.TPUEmbeddingConfiguration.Mode\x12\"\n\x1a\x62\x61tch_size_per_tensor_core\x18\x03 \x01(\x05\x12\x11\n\tnum_hosts\x18\x04 \x01(\x05\x12\x18\n\x10num_tensor_cores\x18\x05 \x01(\x05\x12U\n\x11sharding_strategy\x18\x06 \x01(\x0e\x32:.tensorflow.tpu.TPUEmbeddingConfiguration.ShardingStrategy\x12+\n#pipeline_execution_with_tensor_core\x18\x07 \x01(\x08\x12\x1e\n\x16profile_data_directory\x18\t \x01(\t\x12W\n\x12\x66\x65\x61ture_descriptor\x18\n \x03(\x0b\x32;.tensorflow.tpu.TPUEmbeddingConfiguration.FeatureDescriptor\x12M\n\rspmd_sharding\x18\x0b \x01(\x0b\x32\x36.tensorflow.tpu.TPUEmbeddingConfiguration.SpmdSharding\x1a\xaa\x01\n\x0fTableDescriptor\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x17\n\x0fvocabulary_size\x18\x02 \x01(\x03\x12\x11\n\tdimension\x18\x03 \x01(\x05\x12\x14\n\x0cnum_features\x18\x04 \x01(\x05\x12G\n\x17optimization_parameters\x18\x05 \x01(\x0b\x32&.tensorflow.tpu.OptimizationParameters\x1aH\n\x11\x46\x65\x61tureDescriptor\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x08table_id\x18\x02 \x01(\x05\x12\x13\n\x0binput_shape\x18\x03 \x03(\x05\x1a>\n\x0cSpmdSharding\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12\x1d\n\x15num_cores_per_replica\x18\x02 \x01(\x05\"L\n\x04Mode\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\r\n\tINFERENCE\x10\x01\x12\x0c\n\x08TRAINING\x10\x02\x12\x16\n\x12\x42\x41\x43KWARD_PASS_ONLY\x10\x03\",\n\x10ShardingStrategy\x12\x0f\n\x0b\x44IV_DEFAULT\x10\x00\x12\x07\n\x03MOD\x10\x01J\x04\x08\x08\x10\tR\routput_layout\"\x13\n\x11TPUEmbeddingErrorb\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.tpu.tpu_embedding_configuration_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + _TPUEMBEDDINGCONFIGURATION._serialized_start=143 + _TPUEMBEDDINGCONFIGURATION._serialized_end=1186 + _TPUEMBEDDINGCONFIGURATION_TABLEDESCRIPTOR._serialized_start=733 + _TPUEMBEDDINGCONFIGURATION_TABLEDESCRIPTOR._serialized_end=903 + _TPUEMBEDDINGCONFIGURATION_FEATUREDESCRIPTOR._serialized_start=905 + _TPUEMBEDDINGCONFIGURATION_FEATUREDESCRIPTOR._serialized_end=977 + _TPUEMBEDDINGCONFIGURATION_SPMDSHARDING._serialized_start=979 + _TPUEMBEDDINGCONFIGURATION_SPMDSHARDING._serialized_end=1041 + _TPUEMBEDDINGCONFIGURATION_MODE._serialized_start=1043 + _TPUEMBEDDINGCONFIGURATION_MODE._serialized_end=1119 + _TPUEMBEDDINGCONFIGURATION_SHARDINGSTRATEGY._serialized_start=1121 + _TPUEMBEDDINGCONFIGURATION_SHARDINGSTRATEGY._serialized_end=1165 + _TPUEMBEDDINGERROR._serialized_start=1188 + _TPUEMBEDDINGERROR._serialized_end=1207 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/trackable_object_graph_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/trackable_object_graph_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..fe236a69b68c38d78a490bc74066c48b87649282 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/trackable_object_graph_pb2.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/trackable_object_graph.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import wrappers_pb2 as google_dot_protobuf_dot_wrappers__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n5tensorflow/core/protobuf/trackable_object_graph.proto\x12\ntensorflow\x1a\x1egoogle/protobuf/wrappers.proto\"\xf3\x05\n\x14TrackableObjectGraph\x12?\n\x05nodes\x18\x01 \x03(\x0b\x32\x30.tensorflow.TrackableObjectGraph.TrackableObject\x1a\x99\x05\n\x0fTrackableObject\x12R\n\x08\x63hildren\x18\x01 \x03(\x0b\x32@.tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference\x12U\n\nattributes\x18\x02 \x03(\x0b\x32\x41.tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor\x12^\n\x0eslot_variables\x18\x03 \x03(\x0b\x32\x46.tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference\x12\x35\n\x10registered_saver\x18\x04 \x01(\x0b\x32\x1b.tensorflow.RegisteredSaver\x12\x39\n\x15has_checkpoint_values\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x1a\x36\n\x0fObjectReference\x12\x0f\n\x07node_id\x18\x01 \x01(\x05\x12\x12\n\nlocal_name\x18\x02 \x01(\t\x1a\x63\n\x10SerializedTensor\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tfull_name\x18\x02 \x01(\t\x12\x16\n\x0e\x63heckpoint_key\x18\x03 \x01(\tJ\x04\x08\x04\x10\x05R\x10optional_restore\x1al\n\x15SlotVariableReference\x12!\n\x19original_variable_node_id\x18\x01 \x01(\x05\x12\x11\n\tslot_name\x18\x02 \x01(\t\x12\x1d\n\x15slot_variable_node_id\x18\x03 \x01(\x05\"4\n\x0fRegisteredSaver\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0bobject_name\x18\x02 \x01(\tBZZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.trackable_object_graph_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\370\001\001' + _TRACKABLEOBJECTGRAPH._serialized_start=102 + _TRACKABLEOBJECTGRAPH._serialized_end=857 + _TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT._serialized_start=192 + _TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT._serialized_end=857 + _TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT_OBJECTREFERENCE._serialized_start=592 + _TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT_OBJECTREFERENCE._serialized_end=646 + _TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT_SERIALIZEDTENSOR._serialized_start=648 + _TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT_SERIALIZEDTENSOR._serialized_end=747 + _TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT_SLOTVARIABLEREFERENCE._serialized_start=749 + _TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT_SLOTVARIABLEREFERENCE._serialized_end=857 + _REGISTEREDSAVER._serialized_start=859 + _REGISTEREDSAVER._serialized_end=911 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/transport_options_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/transport_options_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..63ef6c9715c53359105df0116eafdf91e32d399c --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/transport_options_pb2.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/transport_options.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n0tensorflow/core/protobuf/transport_options.proto\x12\ntensorflow\"*\n\x10RecvBufRespExtra\x12\x16\n\x0etensor_content\x18\x01 \x03(\x0c\x42WZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_protob\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.transport_options_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto' + _RECVBUFRESPEXTRA._serialized_start=64 + _RECVBUFRESPEXTRA._serialized_end=106 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/verifier_config_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/verifier_config_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..5edc7aa3ff2ae16a675b41b7d9db04ebcd8fba6d --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/protobuf/verifier_config_pb2.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/protobuf/verifier_config.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n.tensorflow/core/protobuf/verifier_config.proto\x12\ntensorflow\"\x9b\x01\n\x0eVerifierConfig\x12\"\n\x1averification_timeout_in_ms\x18\x01 \x01(\x03\x12=\n\x12structure_verifier\x18\x02 \x01(\x0e\x32!.tensorflow.VerifierConfig.Toggle\"&\n\x06Toggle\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x00\x12\x06\n\x02ON\x10\x01\x12\x07\n\x03OFF\x10\x02\x42\x8c\x01\n\x18org.tensorflow.frameworkB\x14VerifierConfigProtosP\x01ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.protobuf.verifier_config_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\030org.tensorflow.frameworkB\024VerifierConfigProtosP\001ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\370\001\001' + _VERIFIERCONFIG._serialized_start=63 + _VERIFIERCONFIG._serialized_end=218 + _VERIFIERCONFIG_TOGGLE._serialized_start=180 + _VERIFIERCONFIG_TOGGLE._serialized_end=218 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/util/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/util/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/util/event_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/util/event_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..7af6b7a46de5c08a195df9c46656e9ac6cd05e7d --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/util/event_pb2.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/util/event.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import summary_pb2 as tensorflow_dot_core_dot_framework_dot_summary__pb2 +try: + tsl_dot_protobuf_dot_histogram__pb2 = tensorflow_dot_core_dot_framework_dot_summary__pb2.tsl_dot_protobuf_dot_histogram__pb2 +except AttributeError: + tsl_dot_protobuf_dot_histogram__pb2 = tensorflow_dot_core_dot_framework_dot_summary__pb2.tsl.protobuf.histogram_pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n tensorflow/core/util/event.proto\x12\ntensorflow\x1a\'tensorflow/core/framework/summary.proto\"\xf4\x02\n\x05\x45vent\x12\x11\n\twall_time\x18\x01 \x01(\x01\x12\x0c\n\x04step\x18\x02 \x01(\x03\x12\x16\n\x0c\x66ile_version\x18\x03 \x01(\tH\x00\x12\x13\n\tgraph_def\x18\x04 \x01(\x0cH\x00\x12&\n\x07summary\x18\x05 \x01(\x0b\x32\x13.tensorflow.SummaryH\x00\x12\x31\n\x0blog_message\x18\x06 \x01(\x0b\x32\x16.tensorflow.LogMessageB\x02\x18\x01H\x00\x12-\n\x0bsession_log\x18\x07 \x01(\x0b\x32\x16.tensorflow.SessionLogH\x00\x12<\n\x13tagged_run_metadata\x18\x08 \x01(\x0b\x32\x1d.tensorflow.TaggedRunMetadataH\x00\x12\x18\n\x0emeta_graph_def\x18\t \x01(\x0cH\x00\x12\x33\n\x0fsource_metadata\x18\n \x01(\x0b\x32\x1a.tensorflow.SourceMetadataB\x06\n\x04what\" \n\x0eSourceMetadata\x12\x0e\n\x06writer\x18\x01 \x01(\t\"\xa1\x01\n\nLogMessage\x12+\n\x05level\x18\x01 \x01(\x0e\x32\x1c.tensorflow.LogMessage.Level\x12\x0f\n\x07message\x18\x02 \x01(\t\"Q\n\x05Level\x12\x0b\n\x07UNKNOWN\x10\x00\x12\r\n\tDEBUGGING\x10\n\x12\x08\n\x04INFO\x10\x14\x12\x08\n\x04WARN\x10\x1e\x12\t\n\x05\x45RROR\x10(\x12\t\n\x05\x46\x41TAL\x10\x32\x1a\x02\x18\x01:\x02\x18\x01\"\xb6\x01\n\nSessionLog\x12\x34\n\x06status\x18\x01 \x01(\x0e\x32$.tensorflow.SessionLog.SessionStatus\x12\x17\n\x0f\x63heckpoint_path\x18\x02 \x01(\t\x12\x0b\n\x03msg\x18\x03 \x01(\t\"L\n\rSessionStatus\x12\x16\n\x12STATUS_UNSPECIFIED\x10\x00\x12\t\n\x05START\x10\x01\x12\x08\n\x04STOP\x10\x02\x12\x0e\n\nCHECKPOINT\x10\x03\"6\n\x11TaggedRunMetadata\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12\x14\n\x0crun_metadata\x18\x02 \x01(\x0c\"$\n\x0eWatchdogConfig\x12\x12\n\ntimeout_ms\x18\x01 \x01(\x03\"&\n\x11RequestedExitCode\x12\x11\n\texit_code\x18\x01 \x01(\x05\"\xb6\x01\n\x16WorkerHeartbeatRequest\x12\x35\n\rshutdown_mode\x18\x01 \x01(\x0e\x32\x1e.tensorflow.WorkerShutdownMode\x12\x33\n\x0fwatchdog_config\x18\x02 \x01(\x0b\x32\x1a.tensorflow.WatchdogConfig\x12\x30\n\texit_code\x18\x03 \x01(\x0b\x32\x1d.tensorflow.RequestedExitCode\"\x83\x01\n\x17WorkerHeartbeatResponse\x12/\n\rhealth_status\x18\x01 \x01(\x0e\x32\x18.tensorflow.WorkerHealth\x12%\n\nworker_log\x18\x02 \x03(\x0b\x32\x11.tensorflow.Event\x12\x10\n\x08hostname\x18\x03 \x01(\t*[\n\x0cWorkerHealth\x12\x06\n\x02OK\x10\x00\x12\x1c\n\x18RECEIVED_SHUTDOWN_SIGNAL\x10\x01\x12\x12\n\x0eINTERNAL_ERROR\x10\x02\x12\x11\n\rSHUTTING_DOWN\x10\x03*k\n\x12WorkerShutdownMode\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x00\x12\x12\n\x0eNOT_CONFIGURED\x10\x01\x12\x18\n\x14WAIT_FOR_COORDINATOR\x10\x02\x12\x1a\n\x16SHUTDOWN_AFTER_TIMEOUT\x10\x03\x42p\n\x13org.tensorflow.utilB\x0b\x45ventProtosP\x01ZGgithub.com/tensorflow/tensorflow/tensorflow/go/core/util/event_go_proto\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.util.event_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\023org.tensorflow.utilB\013EventProtosP\001ZGgithub.com/tensorflow/tensorflow/tensorflow/go/core/util/event_go_proto\370\001\001' + _EVENT.fields_by_name['log_message']._options = None + _EVENT.fields_by_name['log_message']._serialized_options = b'\030\001' + _LOGMESSAGE_LEVEL._options = None + _LOGMESSAGE_LEVEL._serialized_options = b'\030\001' + _LOGMESSAGE._options = None + _LOGMESSAGE._serialized_options = b'\030\001' + _WORKERHEALTH._serialized_start=1300 + _WORKERHEALTH._serialized_end=1391 + _WORKERSHUTDOWNMODE._serialized_start=1393 + _WORKERSHUTDOWNMODE._serialized_end=1500 + _EVENT._serialized_start=90 + _EVENT._serialized_end=462 + _SOURCEMETADATA._serialized_start=464 + _SOURCEMETADATA._serialized_end=496 + _LOGMESSAGE._serialized_start=499 + _LOGMESSAGE._serialized_end=660 + _LOGMESSAGE_LEVEL._serialized_start=575 + _LOGMESSAGE_LEVEL._serialized_end=656 + _SESSIONLOG._serialized_start=663 + _SESSIONLOG._serialized_end=845 + _SESSIONLOG_SESSIONSTATUS._serialized_start=769 + _SESSIONLOG_SESSIONSTATUS._serialized_end=845 + _TAGGEDRUNMETADATA._serialized_start=847 + _TAGGEDRUNMETADATA._serialized_end=901 + _WATCHDOGCONFIG._serialized_start=903 + _WATCHDOGCONFIG._serialized_end=939 + _REQUESTEDEXITCODE._serialized_start=941 + _REQUESTEDEXITCODE._serialized_end=979 + _WORKERHEARTBEATREQUEST._serialized_start=982 + _WORKERHEARTBEATREQUEST._serialized_end=1164 + _WORKERHEARTBEATRESPONSE._serialized_start=1167 + _WORKERHEARTBEATRESPONSE._serialized_end=1298 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/util/memmapped_file_system_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/util/memmapped_file_system_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..c470a1d88e88c091a45b782085f1d0eace3495fb --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/util/memmapped_file_system_pb2.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/util/memmapped_file_system.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n0tensorflow/core/util/memmapped_file_system.proto\x12\ntensorflow\"S\n#MemmappedFileSystemDirectoryElement\x12\x0e\n\x06offset\x18\x01 \x01(\x04\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0e\n\x06length\x18\x03 \x01(\x04\"`\n\x1cMemmappedFileSystemDirectory\x12@\n\x07\x65lement\x18\x01 \x03(\x0b\x32/.tensorflow.MemmappedFileSystemDirectoryElementB\x03\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.util.memmapped_file_system_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\370\001\001' + _MEMMAPPEDFILESYSTEMDIRECTORYELEMENT._serialized_start=64 + _MEMMAPPEDFILESYSTEMDIRECTORYELEMENT._serialized_end=147 + _MEMMAPPEDFILESYSTEMDIRECTORY._serialized_start=149 + _MEMMAPPEDFILESYSTEMDIRECTORY._serialized_end=245 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/util/quantization/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/util/quantization/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/util/quantization/uniform_quant_ops_attr_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/util/quantization/uniform_quant_ops_attr_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..1c3e4b6ea99cc8f856439db45fc2a7a0a52d35a4 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/util/quantization/uniform_quant_ops_attr_pb2.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/util/quantization/uniform_quant_ops_attr.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n>tensorflow/core/util/quantization/uniform_quant_ops_attr.proto\x12\ntensorflow\"\xec\x02\n/UniformQuantizedConvolutionDimensionNumbersAttr\x12\x1d\n\x15input_batch_dimension\x18\x01 \x01(\x03\x12\x1f\n\x17input_feature_dimension\x18\x02 \x01(\x03\x12 \n\x18input_spatial_dimensions\x18\x03 \x03(\x03\x12&\n\x1ekernel_input_feature_dimension\x18\x04 \x01(\x03\x12\'\n\x1fkernel_output_feature_dimension\x18\x05 \x01(\x03\x12!\n\x19kernel_spatial_dimensions\x18\x06 \x03(\x03\x12\x1e\n\x16output_batch_dimension\x18\x07 \x01(\x03\x12 \n\x18output_feature_dimension\x18\x08 \x01(\x03\x12!\n\x19output_spatial_dimensions\x18\t \x03(\x03\x42WZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_protob\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.util.quantization.uniform_quant_ops_attr_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto' + _UNIFORMQUANTIZEDCONVOLUTIONDIMENSIONNUMBERSATTR._serialized_start=79 + _UNIFORMQUANTIZEDCONVOLUTIONDIMENSIONNUMBERSATTR._serialized_end=443 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/util/saved_tensor_slice_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/util/saved_tensor_slice_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..fe2a865b239ac80894a363dc61e249d4eea6f327 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/util/saved_tensor_slice_pb2.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/util/saved_tensor_slice.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2 +from tensorflow.core.framework import tensor_slice_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__slice__pb2 +from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2 +from tensorflow.core.framework import types_pb2 as tensorflow_dot_core_dot_framework_dot_types__pb2 +from tensorflow.core.framework import versions_pb2 as tensorflow_dot_core_dot_framework_dot_versions__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n-tensorflow/core/util/saved_tensor_slice.proto\x12\ntensorflow\x1a,tensorflow/core/framework/tensor_shape.proto\x1a,tensorflow/core/framework/tensor_slice.proto\x1a&tensorflow/core/framework/tensor.proto\x1a%tensorflow/core/framework/types.proto\x1a(tensorflow/core/framework/versions.proto\"\x9c\x01\n\x0eSavedSliceMeta\x12\x0c\n\x04name\x18\x01 \x01(\t\x12+\n\x05shape\x18\x02 \x01(\x0b\x32\x1c.tensorflow.TensorShapeProto\x12\"\n\x04type\x18\x03 \x01(\x0e\x32\x14.tensorflow.DataType\x12+\n\x05slice\x18\x04 \x03(\x0b\x32\x1c.tensorflow.TensorSliceProto\"l\n\x14SavedTensorSliceMeta\x12*\n\x06tensor\x18\x01 \x03(\x0b\x32\x1a.tensorflow.SavedSliceMeta\x12(\n\x08versions\x18\x02 \x01(\x0b\x32\x16.tensorflow.VersionDef\"n\n\nSavedSlice\x12\x0c\n\x04name\x18\x01 \x01(\t\x12+\n\x05slice\x18\x02 \x01(\x0b\x32\x1c.tensorflow.TensorSliceProto\x12%\n\x04\x64\x61ta\x18\x03 \x01(\x0b\x32\x17.tensorflow.TensorProto\"i\n\x11SavedTensorSlices\x12.\n\x04meta\x18\x01 \x01(\x0b\x32 .tensorflow.SavedTensorSliceMeta\x12$\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x16.tensorflow.SavedSliceB2\n\x13org.tensorflow.utilB\x16SavedTensorSliceProtosP\x01\xf8\x01\x01\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.util.saved_tensor_slice_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\023org.tensorflow.utilB\026SavedTensorSliceProtosP\001\370\001\001' + _SAVEDSLICEMETA._serialized_start=275 + _SAVEDSLICEMETA._serialized_end=431 + _SAVEDTENSORSLICEMETA._serialized_start=433 + _SAVEDTENSORSLICEMETA._serialized_end=541 + _SAVEDSLICE._serialized_start=543 + _SAVEDSLICE._serialized_end=653 + _SAVEDTENSORSLICES._serialized_start=655 + _SAVEDTENSORSLICES._serialized_end=760 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/util/test_log_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/util/test_log_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..60e8272015cca61b2f8b56907f296bab2f806a2f --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/core/util/test_log_pb2.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/core/util/test_log.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.tsl.protobuf import test_log_pb2 as tsl_dot_protobuf_dot_test__log__pb2 + +from tensorflow.tsl.protobuf.test_log_pb2 import * + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#tensorflow/core/util/test_log.proto\x12\x10tensorflow.dummy\x1a\x1btsl/protobuf/test_log.protoP\x00\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.core.util.test_log_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/distribute/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/distribute/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/distribute/experimental/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/distribute/experimental/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/distribute/experimental/rpc/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/distribute/experimental/rpc/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/distribute/experimental/rpc/kernels/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/distribute/experimental/rpc/kernels/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/distribute/experimental/rpc/kernels/gen_rpc_ops.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/distribute/experimental/rpc/kernels/gen_rpc_ops.py new file mode 100644 index 0000000000000000000000000000000000000000..beb3f4ce5316f83453d1276033c621931c98b4bd --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/distribute/experimental/rpc/kernels/gen_rpc_ops.py @@ -0,0 +1,763 @@ +"""Python wrappers around TensorFlow ops. + +This file is MACHINE GENERATED! Do not edit. +""" + +import collections + +from tensorflow.python import pywrap_tfe as pywrap_tfe +from tensorflow.python.eager import context as _context +from tensorflow.python.eager import core as _core +from tensorflow.python.eager import execute as _execute +from tensorflow.python.framework import dtypes as _dtypes +from tensorflow.security.fuzzing.py import annotation_types as _atypes + +from tensorflow.python.framework import op_def_registry as _op_def_registry +from tensorflow.python.framework import ops as _ops +from tensorflow.python.framework import op_def_library as _op_def_library +from tensorflow.python.util.deprecation import deprecated_endpoints +from tensorflow.python.util import dispatch as _dispatch +from tensorflow.python.util.tf_export import tf_export + +from typing import TypeVar, List, Any +from typing_extensions import Annotated + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('delete_rpc_future_resource') +def delete_rpc_future_resource(handle: Annotated[Any, _atypes.Resource], deleter: Annotated[Any, _atypes.Variant], name=None): + r"""TODO: add doc. + + Args: + handle: A `Tensor` of type `resource`. + deleter: A `Tensor` of type `variant`. + name: A name for the operation (optional). + + Returns: + The created Operation. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "DeleteRpcFutureResource", name, handle, deleter) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_delete_rpc_future_resource( + (handle, deleter, name,), None) + if _result is not NotImplemented: + return _result + return delete_rpc_future_resource_eager_fallback( + handle, deleter, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + delete_rpc_future_resource, (), dict(handle=handle, + deleter=deleter, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_delete_rpc_future_resource( + (handle, deleter, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "DeleteRpcFutureResource", handle=handle, deleter=deleter, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + delete_rpc_future_resource, (), dict(handle=handle, deleter=deleter, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + return _op +DeleteRpcFutureResource = tf_export("raw_ops.DeleteRpcFutureResource")(_ops.to_raw_op(delete_rpc_future_resource)) +_dispatcher_for_delete_rpc_future_resource = delete_rpc_future_resource._tf_type_based_dispatcher.Dispatch + + +def delete_rpc_future_resource_eager_fallback(handle: Annotated[Any, _atypes.Resource], deleter: Annotated[Any, _atypes.Variant], name, ctx): + handle = _ops.convert_to_tensor(handle, _dtypes.resource) + deleter = _ops.convert_to_tensor(deleter, _dtypes.variant) + _inputs_flat = [handle, deleter] + _attrs = None + _result = _execute.execute(b"DeleteRpcFutureResource", 0, + inputs=_inputs_flat, attrs=_attrs, ctx=ctx, + name=name) + _result = None + return _result + +_RpcCallOutput = collections.namedtuple( + "RpcCall", + ["future", "deleter"]) + + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('rpc_call') +def rpc_call(client: Annotated[Any, _atypes.Resource], method_name: Annotated[Any, _atypes.String], args, timeout_in_ms: Annotated[Any, _atypes.Int64], name=None): + r"""TODO: add doc. + + Args: + client: A `Tensor` of type `resource`. + method_name: A `Tensor` of type `string`. + args: A list of `Tensor` objects. + timeout_in_ms: A `Tensor` of type `int64`. + name: A name for the operation (optional). + + Returns: + A tuple of `Tensor` objects (future, deleter). + + future: A `Tensor` of type `resource`. + deleter: A `Tensor` of type `variant`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "RpcCall", name, client, method_name, args, timeout_in_ms) + _result = _RpcCallOutput._make(_result) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_rpc_call( + (client, method_name, args, timeout_in_ms, name,), None) + if _result is not NotImplemented: + return _result + return rpc_call_eager_fallback( + client, method_name, args, timeout_in_ms, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + rpc_call, (), dict(client=client, method_name=method_name, + args=args, timeout_in_ms=timeout_in_ms, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_rpc_call( + (client, method_name, args, timeout_in_ms, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "RpcCall", client=client, method_name=method_name, args=args, + timeout_in_ms=timeout_in_ms, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + rpc_call, (), dict(client=client, method_name=method_name, + args=args, timeout_in_ms=timeout_in_ms, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("Tin", _op.get_attr("Tin")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "RpcCall", _inputs_flat, _attrs, _result) + _result = _RpcCallOutput._make(_result) + return _result + +RpcCall = tf_export("raw_ops.RpcCall")(_ops.to_raw_op(rpc_call)) +_dispatcher_for_rpc_call = rpc_call._tf_type_based_dispatcher.Dispatch + + +def rpc_call_eager_fallback(client: Annotated[Any, _atypes.Resource], method_name: Annotated[Any, _atypes.String], args, timeout_in_ms: Annotated[Any, _atypes.Int64], name, ctx): + _attr_Tin, args = _execute.convert_to_mixed_eager_tensors(args, ctx) + client = _ops.convert_to_tensor(client, _dtypes.resource) + method_name = _ops.convert_to_tensor(method_name, _dtypes.string) + timeout_in_ms = _ops.convert_to_tensor(timeout_in_ms, _dtypes.int64) + _inputs_flat = [client, method_name] + list(args) + [timeout_in_ms] + _attrs = ("Tin", _attr_Tin) + _result = _execute.execute(b"RpcCall", 2, inputs=_inputs_flat, attrs=_attrs, + ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "RpcCall", _inputs_flat, _attrs, _result) + _result = _RpcCallOutput._make(_result) + return _result + +_RpcCheckStatusOutput = collections.namedtuple( + "RpcCheckStatus", + ["error_code", "error"]) + + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('rpc_check_status') +def rpc_check_status(status_or: Annotated[Any, _atypes.Resource], name=None): + r"""TODO: add doc. + + Args: + status_or: A `Tensor` of type `resource`. + name: A name for the operation (optional). + + Returns: + A tuple of `Tensor` objects (error_code, error). + + error_code: A `Tensor` of type `int64`. + error: A `Tensor` of type `string`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "RpcCheckStatus", name, status_or) + _result = _RpcCheckStatusOutput._make(_result) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_rpc_check_status( + (status_or, name,), None) + if _result is not NotImplemented: + return _result + return rpc_check_status_eager_fallback( + status_or, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + rpc_check_status, (), dict(status_or=status_or, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_rpc_check_status( + (status_or, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "RpcCheckStatus", status_or=status_or, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + rpc_check_status, (), dict(status_or=status_or, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = () + _inputs_flat = _op.inputs + _execute.record_gradient( + "RpcCheckStatus", _inputs_flat, _attrs, _result) + _result = _RpcCheckStatusOutput._make(_result) + return _result + +RpcCheckStatus = tf_export("raw_ops.RpcCheckStatus")(_ops.to_raw_op(rpc_check_status)) +_dispatcher_for_rpc_check_status = rpc_check_status._tf_type_based_dispatcher.Dispatch + + +def rpc_check_status_eager_fallback(status_or: Annotated[Any, _atypes.Resource], name, ctx): + status_or = _ops.convert_to_tensor(status_or, _dtypes.resource) + _inputs_flat = [status_or] + _attrs = None + _result = _execute.execute(b"RpcCheckStatus", 2, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "RpcCheckStatus", _inputs_flat, _attrs, _result) + _result = _RpcCheckStatusOutput._make(_result) + return _result + +_RpcClientOutput = collections.namedtuple( + "RpcClient", + ["client", "method_specs"]) + + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('rpc_client') +def rpc_client(server_address: Annotated[Any, _atypes.String], timeout_in_ms: Annotated[Any, _atypes.Int64], shared_name:str="", list_registered_methods:bool=False, name=None): + r"""TODO: add doc. + + Args: + server_address: A `Tensor` of type `string`. + timeout_in_ms: A `Tensor` of type `int64`. + shared_name: An optional `string`. Defaults to `""`. + list_registered_methods: An optional `bool`. Defaults to `False`. + name: A name for the operation (optional). + + Returns: + A tuple of `Tensor` objects (client, method_specs). + + client: A `Tensor` of type `resource`. + method_specs: A `Tensor` of type `string`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "RpcClient", name, server_address, timeout_in_ms, "shared_name", + shared_name, "list_registered_methods", list_registered_methods) + _result = _RpcClientOutput._make(_result) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_rpc_client( + (server_address, timeout_in_ms, shared_name, + list_registered_methods, name,), None) + if _result is not NotImplemented: + return _result + return rpc_client_eager_fallback( + server_address, timeout_in_ms, shared_name=shared_name, + list_registered_methods=list_registered_methods, name=name, + ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + rpc_client, (), dict(server_address=server_address, + timeout_in_ms=timeout_in_ms, + shared_name=shared_name, + list_registered_methods=list_registered_methods, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_rpc_client( + (server_address, timeout_in_ms, shared_name, list_registered_methods, + name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + if shared_name is None: + shared_name = "" + shared_name = _execute.make_str(shared_name, "shared_name") + if list_registered_methods is None: + list_registered_methods = False + list_registered_methods = _execute.make_bool(list_registered_methods, "list_registered_methods") + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "RpcClient", server_address=server_address, + timeout_in_ms=timeout_in_ms, shared_name=shared_name, + list_registered_methods=list_registered_methods, + name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + rpc_client, (), dict(server_address=server_address, + timeout_in_ms=timeout_in_ms, + shared_name=shared_name, + list_registered_methods=list_registered_methods, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("shared_name", _op.get_attr("shared_name"), + "list_registered_methods", + _op._get_attr_bool("list_registered_methods")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "RpcClient", _inputs_flat, _attrs, _result) + _result = _RpcClientOutput._make(_result) + return _result + +RpcClient = tf_export("raw_ops.RpcClient")(_ops.to_raw_op(rpc_client)) +_dispatcher_for_rpc_client = rpc_client._tf_type_based_dispatcher.Dispatch + + +def rpc_client_eager_fallback(server_address: Annotated[Any, _atypes.String], timeout_in_ms: Annotated[Any, _atypes.Int64], shared_name: str, list_registered_methods: bool, name, ctx): + if shared_name is None: + shared_name = "" + shared_name = _execute.make_str(shared_name, "shared_name") + if list_registered_methods is None: + list_registered_methods = False + list_registered_methods = _execute.make_bool(list_registered_methods, "list_registered_methods") + server_address = _ops.convert_to_tensor(server_address, _dtypes.string) + timeout_in_ms = _ops.convert_to_tensor(timeout_in_ms, _dtypes.int64) + _inputs_flat = [server_address, timeout_in_ms] + _attrs = ("shared_name", shared_name, "list_registered_methods", + list_registered_methods) + _result = _execute.execute(b"RpcClient", 2, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "RpcClient", _inputs_flat, _attrs, _result) + _result = _RpcClientOutput._make(_result) + return _result + + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('rpc_get_value') +def rpc_get_value(status_or: Annotated[Any, _atypes.Resource], Tout, name=None): + r"""TODO: add doc. + + Args: + status_or: A `Tensor` of type `resource`. + Tout: A list of `tf.DTypes`. + name: A name for the operation (optional). + + Returns: + A list of `Tensor` objects of type `Tout`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "RpcGetValue", name, status_or, "Tout", Tout) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_rpc_get_value( + (status_or, Tout, name,), None) + if _result is not NotImplemented: + return _result + return rpc_get_value_eager_fallback( + status_or, Tout=Tout, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + rpc_get_value, (), dict(status_or=status_or, Tout=Tout, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_rpc_get_value( + (status_or, Tout, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + if not isinstance(Tout, (list, tuple)): + raise TypeError( + "Expected list for 'Tout' argument to " + "'rpc_get_value' Op, not %r." % Tout) + Tout = [_execute.make_type(_t, "Tout") for _t in Tout] + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "RpcGetValue", status_or=status_or, Tout=Tout, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + rpc_get_value, (), dict(status_or=status_or, Tout=Tout, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if not _result: + return _op + if _execute.must_record_gradient(): + _attrs = ("Tout", _op.get_attr("Tout")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "RpcGetValue", _inputs_flat, _attrs, _result) + return _result + +RpcGetValue = tf_export("raw_ops.RpcGetValue")(_ops.to_raw_op(rpc_get_value)) +_dispatcher_for_rpc_get_value = rpc_get_value._tf_type_based_dispatcher.Dispatch + + +def rpc_get_value_eager_fallback(status_or: Annotated[Any, _atypes.Resource], Tout, name, ctx): + if not isinstance(Tout, (list, tuple)): + raise TypeError( + "Expected list for 'Tout' argument to " + "'rpc_get_value' Op, not %r." % Tout) + Tout = [_execute.make_type(_t, "Tout") for _t in Tout] + status_or = _ops.convert_to_tensor(status_or, _dtypes.resource) + _inputs_flat = [status_or] + _attrs = ("Tout", Tout) + _result = _execute.execute(b"RpcGetValue", len(Tout), inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "RpcGetValue", _inputs_flat, _attrs, _result) + return _result + + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('rpc_server') +def rpc_server(server_address: Annotated[Any, _atypes.String], name=None) -> Annotated[Any, _atypes.Resource]: + r"""TODO: add doc. + + Args: + server_address: A `Tensor` of type `string`. + name: A name for the operation (optional). + + Returns: + A `Tensor` of type `resource`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "RpcServer", name, server_address) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_rpc_server( + (server_address, name,), None) + if _result is not NotImplemented: + return _result + return rpc_server_eager_fallback( + server_address, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + rpc_server, (), dict(server_address=server_address, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_rpc_server( + (server_address, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "RpcServer", server_address=server_address, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + rpc_server, (), dict(server_address=server_address, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = () + _inputs_flat = _op.inputs + _execute.record_gradient( + "RpcServer", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +RpcServer = tf_export("raw_ops.RpcServer")(_ops.to_raw_op(rpc_server)) +_dispatcher_for_rpc_server = rpc_server._tf_type_based_dispatcher.Dispatch + + +def rpc_server_eager_fallback(server_address: Annotated[Any, _atypes.String], name, ctx) -> Annotated[Any, _atypes.Resource]: + server_address = _ops.convert_to_tensor(server_address, _dtypes.string) + _inputs_flat = [server_address] + _attrs = None + _result = _execute.execute(b"RpcServer", 1, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "RpcServer", _inputs_flat, _attrs, _result) + _result, = _result + return _result + + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('rpc_server_register') +def rpc_server_register(server: Annotated[Any, _atypes.Resource], method_name: Annotated[Any, _atypes.String], captured_inputs, f, output_specs: str, input_specs:str="", name=None): + r"""TODO: add doc. + + Args: + server: A `Tensor` of type `resource`. + method_name: A `Tensor` of type `string`. + captured_inputs: A list of `Tensor` objects. + f: A function decorated with @Defun. + output_specs: A `string`. + input_specs: An optional `string`. Defaults to `""`. + name: A name for the operation (optional). + + Returns: + The created Operation. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "RpcServerRegister", name, server, method_name, captured_inputs, + "f", f, "input_specs", input_specs, "output_specs", output_specs) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_rpc_server_register( + (server, method_name, captured_inputs, f, output_specs, input_specs, + name,), None) + if _result is not NotImplemented: + return _result + return rpc_server_register_eager_fallback( + server, method_name, captured_inputs, f=f, input_specs=input_specs, + output_specs=output_specs, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + rpc_server_register, (), dict(server=server, + method_name=method_name, + captured_inputs=captured_inputs, + f=f, output_specs=output_specs, + input_specs=input_specs, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_rpc_server_register( + (server, method_name, captured_inputs, f, output_specs, input_specs, + name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + output_specs = _execute.make_str(output_specs, "output_specs") + if input_specs is None: + input_specs = "" + input_specs = _execute.make_str(input_specs, "input_specs") + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "RpcServerRegister", server=server, method_name=method_name, + captured_inputs=captured_inputs, f=f, + output_specs=output_specs, + input_specs=input_specs, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + rpc_server_register, (), dict(server=server, + method_name=method_name, + captured_inputs=captured_inputs, f=f, + output_specs=output_specs, + input_specs=input_specs, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + return _op +RpcServerRegister = tf_export("raw_ops.RpcServerRegister")(_ops.to_raw_op(rpc_server_register)) +_dispatcher_for_rpc_server_register = rpc_server_register._tf_type_based_dispatcher.Dispatch + + +def rpc_server_register_eager_fallback(server: Annotated[Any, _atypes.Resource], method_name: Annotated[Any, _atypes.String], captured_inputs, f, output_specs: str, input_specs: str, name, ctx): + output_specs = _execute.make_str(output_specs, "output_specs") + if input_specs is None: + input_specs = "" + input_specs = _execute.make_str(input_specs, "input_specs") + _attr_Tin, captured_inputs = _execute.convert_to_mixed_eager_tensors(captured_inputs, ctx) + server = _ops.convert_to_tensor(server, _dtypes.resource) + method_name = _ops.convert_to_tensor(method_name, _dtypes.string) + _inputs_flat = [server, method_name] + list(captured_inputs) + _attrs = ("Tin", _attr_Tin, "f", f, "input_specs", input_specs, + "output_specs", output_specs) + _result = _execute.execute(b"RpcServerRegister", 0, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + _result = None + return _result + + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('rpc_server_start') +def rpc_server_start(server: Annotated[Any, _atypes.Resource], name=None): + r"""TODO: add doc. + + Args: + server: A `Tensor` of type `resource`. + name: A name for the operation (optional). + + Returns: + The created Operation. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "RpcServerStart", name, server) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_rpc_server_start( + (server, name,), None) + if _result is not NotImplemented: + return _result + return rpc_server_start_eager_fallback( + server, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + rpc_server_start, (), dict(server=server, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_rpc_server_start( + (server, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "RpcServerStart", server=server, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + rpc_server_start, (), dict(server=server, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + return _op +RpcServerStart = tf_export("raw_ops.RpcServerStart")(_ops.to_raw_op(rpc_server_start)) +_dispatcher_for_rpc_server_start = rpc_server_start._tf_type_based_dispatcher.Dispatch + + +def rpc_server_start_eager_fallback(server: Annotated[Any, _atypes.Resource], name, ctx): + server = _ops.convert_to_tensor(server, _dtypes.resource) + _inputs_flat = [server] + _attrs = None + _result = _execute.execute(b"RpcServerStart", 0, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + _result = None + return _result + diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/distribute/experimental/rpc/proto/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/distribute/experimental/rpc/proto/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/distribute/experimental/rpc/proto/tf_rpc_service_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/distribute/experimental/rpc/proto/tf_rpc_service_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..39fa8850a62a590e1f1fd5d521d99462ec88a6ce --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/distribute/experimental/rpc/proto/tf_rpc_service_pb2.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/distribute/experimental/rpc/proto/tf_rpc_service.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2 +from tensorflow.core.protobuf import struct_pb2 as tensorflow_dot_core_dot_protobuf_dot_struct__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\nAtensorflow/distribute/experimental/rpc/proto/tf_rpc_service.proto\x12\x0etensorflow.rpc\x1a&tensorflow/core/framework/tensor.proto\x1a%tensorflow/core/protobuf/struct.proto\"M\n\x0b\x43\x61llRequest\x12\x0e\n\x06method\x18\x01 \x01(\t\x12.\n\rinput_tensors\x18\x02 \x03(\x0b\x32\x17.tensorflow.TensorProto\"?\n\x0c\x43\x61llResponse\x12/\n\x0eoutput_tensors\x18\x01 \x03(\x0b\x32\x17.tensorflow.TensorProto\"\r\n\x0bListRequest\"\x87\x01\n\x10RegisteredMethod\x12\x0e\n\x06method\x18\x01 \x01(\t\x12\x30\n\x0binput_specs\x18\x02 \x01(\x0b\x32\x1b.tensorflow.StructuredValue\x12\x31\n\x0coutput_specs\x18\x03 \x01(\x0b\x32\x1b.tensorflow.StructuredValue\"L\n\x0cListResponse\x12<\n\x12registered_methods\x18\x01 \x03(\x0b\x32 .tensorflow.rpc.RegisteredMethod2\x96\x01\n\nRpcService\x12\x43\n\x04\x43\x61ll\x12\x1b.tensorflow.rpc.CallRequest\x1a\x1c.tensorflow.rpc.CallResponse\"\x00\x12\x43\n\x04List\x12\x1b.tensorflow.rpc.ListRequest\x1a\x1c.tensorflow.rpc.ListResponse\"\x00\x62\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.distribute.experimental.rpc.proto.tf_rpc_service_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + _CALLREQUEST._serialized_start=164 + _CALLREQUEST._serialized_end=241 + _CALLRESPONSE._serialized_start=243 + _CALLRESPONSE._serialized_end=306 + _LISTREQUEST._serialized_start=308 + _LISTREQUEST._serialized_end=321 + _REGISTEREDMETHOD._serialized_start=324 + _REGISTEREDMETHOD._serialized_end=459 + _LISTRESPONSE._serialized_start=461 + _LISTRESPONSE._serialized_end=537 + _RPCSERVICE._serialized_start=540 + _RPCSERVICE._serialized_end=690 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/distribute/experimental/rpc/proto/tf_rpc_service_pb2_grpc.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/distribute/experimental/rpc/proto/tf_rpc_service_pb2_grpc.py new file mode 100644 index 0000000000000000000000000000000000000000..fe854a3a079e616b21c1effaedfbfa409857573d --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/distribute/experimental/rpc/proto/tf_rpc_service_pb2_grpc.py @@ -0,0 +1,63 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc + +from tensorflow.distribute.experimental.rpc.proto import tf_rpc_service_pb2 as tensorflow_dot_distribute_dot_experimental_dot_rpc_dot_proto_dot_tf__rpc__service__pb2 + + +class RpcServiceStub(object): + # missing associated documentation comment in .proto file + pass + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.Call = channel.unary_unary( + '/tensorflow.rpc.RpcService/Call', + request_serializer=tensorflow_dot_distribute_dot_experimental_dot_rpc_dot_proto_dot_tf__rpc__service__pb2.CallRequest.SerializeToString, + response_deserializer=tensorflow_dot_distribute_dot_experimental_dot_rpc_dot_proto_dot_tf__rpc__service__pb2.CallResponse.FromString, + ) + self.List = channel.unary_unary( + '/tensorflow.rpc.RpcService/List', + request_serializer=tensorflow_dot_distribute_dot_experimental_dot_rpc_dot_proto_dot_tf__rpc__service__pb2.ListRequest.SerializeToString, + response_deserializer=tensorflow_dot_distribute_dot_experimental_dot_rpc_dot_proto_dot_tf__rpc__service__pb2.ListResponse.FromString, + ) + + +class RpcServiceServicer(object): + # missing associated documentation comment in .proto file + pass + + def Call(self, request, context): + """RPC for invoking a registered function on remote server. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def List(self, request, context): + """RPC for listing available methods in a server. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_RpcServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'Call': grpc.unary_unary_rpc_method_handler( + servicer.Call, + request_deserializer=tensorflow_dot_distribute_dot_experimental_dot_rpc_dot_proto_dot_tf__rpc__service__pb2.CallRequest.FromString, + response_serializer=tensorflow_dot_distribute_dot_experimental_dot_rpc_dot_proto_dot_tf__rpc__service__pb2.CallResponse.SerializeToString, + ), + 'List': grpc.unary_unary_rpc_method_handler( + servicer.List, + request_deserializer=tensorflow_dot_distribute_dot_experimental_dot_rpc_dot_proto_dot_tf__rpc__service__pb2.ListRequest.FromString, + response_serializer=tensorflow_dot_distribute_dot_experimental_dot_rpc_dot_proto_dot_tf__rpc__service__pb2.ListResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'tensorflow.rpc.RpcService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/proto/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/proto/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/proto/layout_pb2.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/proto/layout_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..02ae56365aed4ab3ce3abfa91bef883b5c2eab59 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/proto/layout_pb2.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: tensorflow/dtensor/proto/layout.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n%tensorflow/dtensor/proto/layout.proto\x12\x12tensorflow.dtensor\"+\n\x0cShardingSpec\x12\x15\n\rsharding_spec\x18\x02 \x01(\tJ\x04\x08\x01\x10\x02\"0\n\x12MeshDimensionProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04size\x18\x02 \x01(\x03\"\xfb\x01\n\x0bLayoutProto\x12\x38\n\x0esharding_specs\x18\x01 \x03(\x0b\x32 .tensorflow.dtensor.ShardingSpec\x12\x32\n\x0bmesh_config\x18\x02 \x01(\x0b\x32\x1d.tensorflow.dtensor.MeshProto\x12\x38\n\x04type\x18\x03 \x01(\x0e\x32*.tensorflow.dtensor.LayoutProto.LayoutType\"D\n\nLayoutType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\n\n\x06STATIC\x10\x01\x12\n\n\x06PARTED\x10\x02\x12\x11\n\rSINGLE_DEVICE\x10\x03\"\xeb\x01\n\tMeshProto\x12?\n\x0fmesh_dimensions\x18\x01 \x03(\x0b\x32&.tensorflow.dtensor.MeshDimensionProto\x12\x19\n\x11global_device_ids\x18\x02 \x03(\x03\x12\x18\n\x10local_device_ids\x18\x04 \x03(\x03\x12\x15\n\rlocal_devices\x18\x05 \x03(\t\x12\x16\n\x0eglobal_devices\x18\x06 \x03(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x14\n\x0cuse_xla_spmd\x18\x07 \x01(\x08\x12\x15\n\rsingle_device\x18\x08 \x01(\tb\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.dtensor.proto.layout_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + _SHARDINGSPEC._serialized_start=61 + _SHARDINGSPEC._serialized_end=104 + _MESHDIMENSIONPROTO._serialized_start=106 + _MESHDIMENSIONPROTO._serialized_end=154 + _LAYOUTPROTO._serialized_start=157 + _LAYOUTPROTO._serialized_end=408 + _LAYOUTPROTO_LAYOUTTYPE._serialized_start=340 + _LAYOUTPROTO_LAYOUTTYPE._serialized_end=408 + _MESHPROTO._serialized_start=411 + _MESHPROTO._serialized_end=646 +# @@protoc_insertion_point(module_scope) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b38604828608850d6d3ae6391bb3390e78599cb1 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/__init__.py @@ -0,0 +1,17 @@ +# Copyright 2022 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. +# ============================================================================== +"""DTensor Python API.""" + +# This file is left empty intentionally. diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/accelerator_util.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/accelerator_util.py new file mode 100644 index 0000000000000000000000000000000000000000..e32d54b36c1834546c72d674949e97f726edbc70 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/accelerator_util.py @@ -0,0 +1,298 @@ +# Copyright 2022 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. +# ============================================================================== +"""Utility for working with accelerator systems.""" + +from typing import List, Optional + +from absl import logging + +from tensorflow.core.protobuf import cluster_pb2 +from tensorflow.core.protobuf import tensorflow_server_pb2 +from tensorflow.dtensor.python import config +from tensorflow.dtensor.python import tpu_util +from tensorflow.python.eager import context +from tensorflow.python.framework import config as tf_config +from tensorflow.python.platform import remote_utils +from tensorflow.python.util.tf_export import tf_export + +_INITIALIZED_ACCELERATOR_SYSTEM_TYPE = None + + +def is_initialized() -> bool: + """Returns whether accelerator system has been initialized.""" + return bool(_INITIALIZED_ACCELERATOR_SYSTEM_TYPE) + + +def set_initialized(value): + """Sets if accelerator system has been initialized.""" + global _INITIALIZED_ACCELERATOR_SYSTEM_TYPE + _INITIALIZED_ACCELERATOR_SYSTEM_TYPE = value + + +def initialize_multi_client_cluster(job_name: str, + dtensor_jobs: List[str], + client_id: int, + collective_leader: str, + port: Optional[int] = None, + gpu_use_nccl_communication: bool = False, + enable_coordination_service: bool = True): + """Initialize GRPC servers and collectives for multi-client DTensor setup. + + This function can be used to initialize a multi-client cluster and enable + collective ops. GRPC servers are necessary in the multi-client mode, even + when the number of clientis is 1. + + NOTE: this function must be called in an eager context. + + Args: + job_name: The job name used by all clients in the DTensor cluster. + dtensor_jobs: A list of the DTensor client jobs participating in the + cluster. Must be strings of the form "hostname:port". + client_id: The ID of the DTensor client this function is being called in. + collective_leader: The job/task that will be used to run collectives. + port: The port this client's GRPC server will run on. If omitted, use the + port from dtensor_jobs for this client. + gpu_use_nccl_communication: if True, configure TensorFlow to use NCCL by + default. + enable_coordination_service: If true, enable distributed coordination + service to make sure that workers know the devices on each other, a + prerequisite for data transfer through cross-worker rendezvous. + + Raises: + RuntimeError: If running inside a tf.function. + """ + assert context.executing_eagerly() + + if not collective_leader.startswith("/job:"): + collective_leader = "/job:" + collective_leader + + context.context().configure_collective_ops( + use_nccl_communication=gpu_use_nccl_communication, + collective_leader=collective_leader) + if enable_coordination_service: + context.context().configure_coordination_service( + service_type="standalone", service_leader=collective_leader) + + config_proto = context.get_config() + + # Construct server def from the host directly instead of relying on + # TF_CONFIG. + cluster_def = cluster_pb2.ClusterDef() + # Note that for bns addresses, we will currently rely on the sorted string + # of job name as the order of assigning task ids. This might be brittle once + # we have jobs across multiple cells. + cluster_def.job.add(name=job_name, tasks=dict(enumerate(dtensor_jobs))) + server_def = tensorflow_server_pb2.ServerDef( + cluster=cluster_def, + default_session_config=config_proto, + job_name=job_name, + task_index=client_id, + protocol=remote_utils.get_default_communication_protocol(), + port=port) + server_def.default_session_config.rpc_options.num_channels_per_target = 4 + server_def.default_session_config.experimental.recv_buf_max_chunk = -1 + + logging.info("Enabling collectives with server_def: %s", server_def) + + context.context().enable_collective_ops(server_def) + + context.ensure_initialized() + + +@tf_export( + "experimental.dtensor.initialize_accelerator_system", + "experimental.dtensor.initialize_tpu_system", + "experimental.dtensor.initialize_multi_client", + v1=[]) +def initialize_accelerator_system( + device_type: Optional[str] = None, + enable_coordination_service: Optional[bool] = True, + num_logical_cpu_devices: Optional[int] = None, + experimental_reset_context: Optional[bool] = False, +) -> str: + """Initializes accelerators and communication fabrics for DTensor. + + DTensor configures TensorFlow to run in the local mode or multi-client mode. + - In local mode, a mesh can only use devices attached to the current process. + - In multi-client mode, a mesh can span across devices from multiple clients. + + If `DTENSOR_JOBS` is non-empty, DTensor configures TensorFlow to run in the + multi-client mode using the distributed runtime. In multi-client mode devices + on different clients can communicate with each other. + + The following environment variables controls the behavior of this function. + + - `DTENSOR_JOBS`: string, a comma separated list. Each item in the list is + of format `{hostname}:{port}`. If empty, DTensor runs in the local mode. + Examples of valid `DTENSOR_JOBS` values: + - 4 clients on localhost: + `localhost:10000,localhost:10001,localhost:10002,localhost:10003` + - 2 clients on host1, 2 clients on host2 + `host1:10000,host1:10001,host2:10000,host2:10003` + If the hostnames are BNS addresses, the items must be sorted in + alphabetical order. + - `DTENSOR_CLIENT_ID`: integer, between `0` to `num_clients - 1`, to identify + the client id of the current process. The default value is `0`. + - `DTENSOR_JOB_NAME`: string, a string for the name of the TensorFlow job. + The job name controls the job name section of the TensorFlow DeviceSpecs, + e.g., `job:worker` in `/job:worker/replica:0/task:0/device:TPU:0` when + the job name is `worker`. + The default value is `localhost` in local mode, and + `worker` when in the multi-client mode. All DTensor clients within the + same multi-client cluster share the same job name. + - `DTENSOR_USE_PARALLEL_EXECUTOR`: string, with its value being `pw` to + specify that the backend is Pathways, and TensorFlow otherwise. + + Args: + device_type: Type of accelerator to use, can be CPU, GPU, or TPU. If None, + uses `tf.experimental.dtensor.preferred_device_type()`. + enable_coordination_service: If true, enable distributed coordination + service to make sure that workers know the devices on each other, when + there is more than 1 client. + num_logical_cpu_devices: the number of logical CPU devices per DTensor + client. Default to the current number of logical CPU + (`dtensor.num_local_devices("CPU")`),when `device_type` is CPU, otherwise + set automatially to match the number of local GPU/TPU devices. + experimental_reset_context: Reset the tensorflow context. Behaviors of + existing TensorFlow objects (e.g. Tensors) are undefined. Set this to True + as an escape hatch, if there is no clear way to refactor your code to call + initialize_accelerator_system() before calling TensorFlow APIs that + initialize the context. + + Returns: + device_type: the type of accelerator that was initialized. + """ + global _INITIALIZED_ACCELERATOR_SYSTEM_TYPE + assert context.executing_eagerly() + + if is_initialized(): + raise ValueError( + "Accelerator system has already been initialized. " + "Call tf.experimental.dtensor.shutdown_accelerator_system() first.") + + if experimental_reset_context: + if context.context()._initialized: # pylint: disable=protected-access + logging.warn( + "experimental_reset_context is True. " + "Resetting TensorFlow context. Existing TensorFlow objects " + "(e.g. Tensors and resources) are invalidated." + ) + context.context().ensure_uninitialized() + + if context.context()._initialized: # pylint: disable=protected-access + raise ValueError( + "TensorFlow has already been initialized. " + "tf.experimental.dtensor.initialize_accelerator_system() must be " + "called before TensorFlow is initialized.") + + context.context()._clear_caches() # pylint: disable=protected-access + + if device_type is None: + device_type = config.preferred_device_type() + + device_type = device_type.upper() + if device_type not in {"CPU", "GPU", "TPU"}: + raise ValueError(f"Unknown device_type {device_type}. " + "Allowed values are CPU, GPU, or TPU") + + if config.gpu_use_nccl_communication(): + logical_gpu_count = config.num_local_devices("GPU") + physical_gpu_count = len(tf_config.list_physical_devices("GPU")) + if logical_gpu_count > physical_gpu_count: + raise ValueError( + "DTENSOR_GPU_USE_NCCL_COMMUNICATION is set for using NCCL. " + "NCCL Collectives require one to one mapping between logical and " + "physical GPUs. " + f"The number of logical GPU ({logical_gpu_count}) " + f"is more than the number of physical GPU ({physical_gpu_count})." + ) + + # Configure logical host CPU devices for accelerators. + if device_type in ("GPU", "TPU"): + num_local_devices = config.num_local_devices(device_type) + if num_logical_cpu_devices is None: + num_logical_cpu_devices = max( + config.num_local_devices("CPU"), num_local_devices + ) + else: + if num_logical_cpu_devices < num_local_devices: + raise ValueError( + "If set, `num_logical_cpu_devices`" + f" (={num_logical_cpu_devices}) must be greater than or" + f" equal to the number of local {device_type} devices" + f" (={num_local_devices})" + ) + + if num_logical_cpu_devices is not None: + tf_config.set_logical_device_configuration( + tf_config.list_physical_devices("CPU")[0], + [context.LogicalDeviceConfiguration()] + * num_logical_cpu_devices, + ) + + if not config.is_local_mode(): + initialize_multi_client_cluster( + job_name=config.job_name(), + dtensor_jobs=config.jobs(), + client_id=config.client_id(), + collective_leader=config.full_job_name(task_id=0), + gpu_use_nccl_communication=config.gpu_use_nccl_communication(), + enable_coordination_service=enable_coordination_service) + else: + if device_type == "GPU": + # Enables Nccl on local mode. + context.context( # pylint: disable=protected-access + )._collective_use_nccl_communication = config.gpu_use_nccl_communication( + ) + + if device_type == "TPU" and not config.backend_is_pw(): + tpu_util.initialize_tpu_system() + + _INITIALIZED_ACCELERATOR_SYSTEM_TYPE = device_type + + return device_type + + +@tf_export( + "experimental.dtensor.shutdown_accelerator_system", + "experimental.dtensor.shutdown_tpu_system", + v1=[]) +def shutdown_accelerator_system() -> None: + """Shuts down the accelerator system.""" + global _INITIALIZED_ACCELERATOR_SYSTEM_TYPE + try: + context.async_wait() + finally: + if not is_initialized(): + raise ValueError( + "Accelerator system is not initialized. Call " + "tf.experimental.dtensor.initialize_accelerator_system first." + ) + + device_type = _INITIALIZED_ACCELERATOR_SYSTEM_TYPE + + if not config.is_local_mode(): + raise ValueError( + "Shutting down accelerator system under multi-client mode is " + "not supported." + ) + + if device_type == "TPU" and not config.backend_is_pw(): + tpu_util.shutdown_tpu_system() + + # reset TF context to stop gRPC servers. + context._reset_context() # pylint: disable=protected-access + context.context()._clear_caches() # pylint: disable=protected-access + _INITIALIZED_ACCELERATOR_SYSTEM_TYPE = None diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/api.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/api.py new file mode 100644 index 0000000000000000000000000000000000000000..4a49cd82fa33943cd64a12eef5f52111979358e7 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/api.py @@ -0,0 +1,568 @@ +# Copyright 2022 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. +# ============================================================================== +"""Core DTensor Python API.""" + +import contextlib +import threading +from typing import Any, Callable, Optional, Sequence + +from tensorflow.dtensor.python import dtensor_device +from tensorflow.dtensor.python import gen_dtensor_ops +from tensorflow.dtensor.python import layout as layout_lib +from tensorflow.python.eager import context +from tensorflow.python.framework import ops +from tensorflow.python.framework import tensor as tensor_lib +from tensorflow.python.util import deprecation +from tensorflow.python.util.tf_export import tf_export + +_dtensor_singleton = None +_dtensor_singleton_lock = threading.Lock() + +# ----------------------------------------------------------------------------- +# Main methods to launch DTensor computations. + + +@tf_export("experimental.dtensor.call_with_layout", v1=[]) +def call_with_layout(fn: Callable[..., + Any], layout: Optional[layout_lib.Layout], + *args, **kwargs) -> Any: + """Calls a function in the DTensor device scope if `layout` is not None. + + If `layout` is not None, `fn` consumes DTensor(s) as input and produces a + DTensor as output; a DTensor is a tf.Tensor with layout-related attributes. + + If `layout` is None, `fn` consumes and produces regular tf.Tensors. + + Args: + fn: A supported TF API function such as tf.zeros. + layout: Optional, the layout of the output DTensor. + *args: Arguments given to `fn`. + **kwargs: Keyword arguments given to `fn`. + + Returns: + The return value of `fn` transformed to a DTensor if requested. + """ + if layout is not None: + if context.executing_eagerly(): + with default_mesh(layout.mesh): + with _dtensor_device()._default_layout(layout): # pylint: disable=protected-access + return fn(*args, **kwargs) + else: + return relayout(fn(*args, **kwargs), layout) + return fn(*args, **kwargs) + + +@tf_export("experimental.dtensor.run_on", v1=[]) +@deprecation.deprecated(None, "Use `dtensor.default_mesh` scope instead.") +@contextlib.contextmanager +def run_on(mesh: layout_lib.Mesh): + """Runs enclosed functions in the DTensor device scope. + + This function returns a scope. All the ops and tf.functions in this scope will + run on the DTensor device using the mesh provided. + This is useful for wrapping any tf.function that doesn't take a DTensor as + input but would like to produce DTensor as result. The scope will also make + sure all small constants be replicated as DTensor. + + Args: + mesh: A Mesh instance to extract a default mesh from. + + Yields: + A context in which all ops and tf.functions will run on the DTensor device. + """ + with default_mesh(mesh): + yield + + +@tf_export("experimental.dtensor.default_mesh", v1=[]) +@contextlib.contextmanager +def default_mesh(mesh: layout_lib.Mesh): + """Sets the default DTensor device mesh to use for enclosed functions. + + This function returns a scope. All the ops and tf.functions in this scope will + default to this DTensor mesh if a mesh cannot be inferred from any of the + inputs + This is useful for wrapping any tf.function that doesn't take a DTensor as + input but would like to produce DTensor as result. The scope will also make + sure all small constants are replicated as DTensors. + + Args: + mesh: A Mesh instance to extract a default mesh from. + + Yields: + A context in which all ops and tf.functions will run on the given mesh. + """ + if not isinstance(mesh, layout_lib.Mesh): + raise ValueError(f"Expect `mesh` to be `Mesh`, got {type(mesh)}") + + with _dtensor_device()._experimental_default_mesh(mesh): # pylint: disable=protected-access + with ops.device(device_name()): + yield + + +@tf_export("experimental.dtensor.get_default_mesh", v1=[]) +def get_default_mesh() -> Optional[layout_lib.Mesh]: + """Return the default mesh under the current dtensor device context. + + In the case that dtensor device system is not initialized, this function + will return None. + + Returns: + The current default mesh for the dtensor device context. + """ + if _dtensor_singleton is None: + return None + else: + return _dtensor_singleton._current_default_mesh # pylint: disable=protected-access + + +@tf_export("experimental.dtensor.device_name", v1=[]) +def device_name() -> str: + """Returns the singleton DTensor device's name. + + This function can be used in the following way: + + ```python + import tensorflow as tf + + with tf.device(dtensor.device_name()): + # ... + ``` + """ + return _dtensor_device().name + + +@tf_export("experimental.dtensor.is_dtensor", v1=[]) +def is_dtensor(tensor) -> bool: + """Check whether the input tensor is a DTensor. + + In Python, a DTensor has the same type as a `tf.Tensor`. This method will + let you check and handle the tensor differently if a tf.Tensor is a DTensor. + + Args: + tensor: an object to be checked. + + Returns: + bool, True if the given tensor is a DTensor. + """ + return _dtensor_device().is_dtensor(tensor) + + +# ----------------------------------------------------------------------------- +# Data transfer methods. + + +@tf_export("experimental.dtensor.copy_to_mesh", v1=[]) +def copy_to_mesh( + tensor: Any, + layout: layout_lib.Layout, + source_layout: Optional[layout_lib.Layout] = None) -> tensor_lib.Tensor: + """Copies a tf.Tensor onto the DTensor device with the given layout. + + Copies a regular tf.Tensor onto the DTensor device. Use the mesh attached to + `layout` as target mesh. This method currently only supports replicated + layouts, or one-to-one copies for sharded layouts. + + Args: + tensor: A regular tf.Tensor to be copied as a DTensor. + layout: Target layout (and mesh) for the result DTensor. + source_layout: Source layout of the tensor before copy. This argument + is deprecated. + + Returns: + A DTensor on the DTensor device with the given layout. + """ + del source_layout + return relayout(tensor, layout) + + +@tf_export("experimental.dtensor.pack", v1=[]) +def pack(tensors: Sequence[Any], layout: layout_lib.Layout) -> Any: + """Packs `tf.Tensor` components into a DTensor. + + Packing and unpacking are inverse operations: + + ``` + * unpack(pack(tensors)) == tensors + * pack(unpack(dtensor)) == dtensor + ``` + + 1. For any DTensor on the mesh, `unpack` returns the raw components placed on + each underlying device. + 2. Packing these raw components in the same order using `pack` returns a + DTensor which should be identical to the original DTensor--both the content + value and the layout. + + **Shape, Rank, and Scalars**: The rank of the DTensor is the same as the + rank of its raw components, i.e., rank is preserved. This leads to a + consistent interpretation for packing scalar values into a DTensor. The only + valid layout for a scalar value is fully replicated, and the individual + components must be identical scalars. + + Each input `tensors[i]` will be copied to `layout.mesh.local_device[i]` + if not already on the local device. Non-local components should not be passed + to `pack`; use `copy_to_mesh` and `relayout` to place tensors on all global + devices on a mesh. + + It is the caller's responsibility to ensure that the underlying values + for `pack` adhere to the specified layout, and that only as many values are + specified as there are local devices. Pack does not move data between clients. + See examples below for more detail about layouts. + + For example, assume we have a mesh `[X(2), Y(3)]`, which has in total 6 + underlying devices. Futuremore, assume that the device location mapping is + the following: + + ``` + device_ID | location X, Y + 0 0, 0 + 1 0, 1 + 2 0, 2 + 3 1, 0 + 4 1, 1 + 5 1, 2 + ``` + + 1. For 1-D vector DTensor with shape `[128]` with layout `[mesh.X]` and value + as `range(128)`, the raw components will have shape `[64]` each, and the + raw components will be: + + ``` + device_ID | raw component + 0 range(0, 64) + 1 range(0, 64) + 2 range(0, 64) + 3 range(64, 128) + 4 range(64, 128) + 5 range(64, 128) + ``` + + This also means for a 1-D DTensor with shape `[2]` and layout `[mesh.X]`, + the raw components have shape `[1]` rather than the shape for scalar values + `[]`. + + 2. For 2-D vector DTensor with shape `[2, 3]` with layout `[mesh.X, mesh.Y]` + and value as `range(6)`, this is basically a fully-sharded DTensor. + + From global view, the content looks like + ``` + [ + [0.0, 1.0, 2.0], + [3.0, 4.0, 5.0], + ] + ``` + + The raw components will have shape `[1, 1]` each, and have the following + content: + + ``` + device_ID | raw component + 0 [[0.0]] + 1 [[1.0]] + 2 [[2.0]] + 3 [[3.0]] + 4 [[4.0]] + 5 [[5.0]] + ``` + + 3. For a scalar value `123.0` DTensor, it can only have one legitimate layout + `[]` (no dimension, but fully replicated). + + The raw components will have shape `[]` each, and have the following + content: + + ``` + device_ID | raw component + 0 123.0 + 1 123.0 + 2 123.0 + 3 123.0 + 4 123.0 + 5 123.0 + ``` + + Again, caller of `pack` is expected to provide 6 identical value raw + components with scalar shapes. + + 4. For 3-D vector DTensor with shape `[2, 2, 3]` with layout + `[X, unsharded, unsharded]` and value as `range(12)`, + + From global view, the content looks like: + ``` + [ + [ + [0.0, 1.0, 2.0], + [3.0, 4.0, 5.0], + ], + [ + [6.0, 7.0, 8.0], + [9.0, 10., 11.], + ], + ] + ``` + + The raw components will have shape `[1, 2, 3]` each, and have the following + content: + + ``` + device_ID | raw component + 0 range(6).reshape([1, 2, 3]) + 1 range(6).reshape([1, 2, 3]) + 2 range(6).reshape([1, 2, 3]) + 3 range(6, 12).reshape([1, 2, 3]) + 4 range(6, 12).reshape([1, 2, 3]) + 5 range(6, 12).reshape([1, 2, 3]) + ``` + + Args: + tensors: The list of local tensor components to pack into a DTensor. + layout: The layout of the DTensor to be created. + + Returns: + A DTensor created from the individual component tensors. + + Raises: + RuntimeError: When `pack` is not called eagerly. + """ + return _dtensor_device().pack(tensors, layout) + + +@tf_export("experimental.dtensor.unpack", v1=[]) +def unpack(tensor: Any) -> Sequence[Any]: + """Unpacks a DTensor into `tf.Tensor` components. + + Packing and unpacking are inverse operations: + + ``` + * unpack(pack(tensors)) == tensors + * pack(unpack(dtensor)) == dtensor + ``` + + 1. For any DTensor on the mesh, `unpack` returns the raw components placed on + each underlying device. + 2. Packing these raw components in the same order using `pack` returns a + DTensor which should be identical to the original DTensor--both the content + value and the layout. + + See the documentation for `pack` for more information about how packing and + unpacking works. + + Args: + tensor: The DTensor to unpack. + + Returns: + The individual component tensors of the DTensor. This will include only the + client-local components, i.e. the components placed on the local devices. + + Raises: + RuntimeError: When `unpack` is not called eagerly. + """ + return _dtensor_device().unpack(tensor) + + +# ----------------------------------------------------------------------------- +# Layout-related methods. + + +@tf_export("experimental.dtensor.fetch_layout", v1=[]) +def fetch_layout(tensor: tensor_lib.Tensor) -> layout_lib.Layout: + """Fetches the layout of a DTensor. + + Args: + tensor: The DTensor whose layout is to be fetched. + + Returns: + The `Layout` of this DTensor. + + Raises: + RuntimeError: When not called eagerly. + """ + return _dtensor_device().fetch_layout(tensor) + + +@tf_export("experimental.dtensor.check_layout", v1=[]) +def check_layout(tensor: tensor_lib.Tensor, layout: layout_lib.Layout) -> None: + """Asserts that the layout of the DTensor is `layout`. + + Args: + tensor: A DTensor whose layout is to be checked. + layout: The `Layout` to compare against. + + Raises: + ValueError: If the layout of `tensor` does not match the supplied `layout`. + """ + if fetch_layout(tensor) != layout: + raise ValueError("Layout of tensor: " + str(fetch_layout(tensor)) + + ", did not match expected layout: " + str(layout)) + + +@tf_export("experimental.dtensor.relayout", v1=[]) +def relayout( + tensor: tensor_lib.Tensor, + layout: layout_lib.Layout, + name: Optional[str] = None, +) -> tensor_lib.Tensor: + """Changes the layout of `tensor`. + + Changes the layout of `tensor` to `layout`. This is used to fine-tune the + behavior of ops following/connected to `tensor`, such as choosing one SPMD + expansion pattern over another. This works by forward propagating `layout` + to connected TensorFlow computation graphs during layout propagation. + + Currently, only converting layouts from replicated to sharded or sharded to + replicated per mesh dimension is supported. That is, "x, y" -> "unsharded, y" + is supported, while "x, y" -> "z, y" is not supported. + + We also support a special "match" sharding spec, which instructs the relayout + to act as an identity operation with respect to any sharding on these + mesh dimensions. + + Relayout is internally lowered to a set of Split and/or AllToAll ops. When + tensor layouts are converted from replicated to sharded, the cost is + comparatively low because we only insert Split ops and no cross-device + communication is needed. However, when tensor layouts are converted from + sharded to replicated, cross-device communication may occur, causing potential + performance impact. + + Args: + tensor: A DTensor to specify a new layout for. + layout: A Layout object specifying a new sharding spec. + name: name of the Op. + + Returns: + A DTensor output from the Relayout op. + """ + layout_str = layout.to_string() + with default_mesh(layout.mesh): + return gen_dtensor_ops.relayout(tensor, layout_str, name=name) + + +@tf_export("experimental.dtensor.relayout_like", v1=[]) +def relayout_like( + tensor: tensor_lib.Tensor, + layout_tensor: tensor_lib.Tensor, + name: Optional[str] = None, +) -> tensor_lib.Tensor: + """Changes the layout of `tensor` to the same as `layout_tensor`. + + `relayout_like` is often used inside a `tf.function`, to ensure a tensor is + placed to the same mesh and with the same layout as another tensor. + + The backward gradient of a `relayout` is a `relayout_like` operation, to + ensure the backward tensor has the same layout as the forward input tensor: + + ``` + @ops.RegisterGradient("Relayout") + def _relayout_gradient(op, grad): + return relayout_like(grad, layout_input=op.inputs[0]) + ``` + + Here is another illustrative example: + + ``` + @tf.function + def func(x): + z = tf.ones(x.shape) + z = dtensor.relayout_like(z, x) + return x + z + + with dtensor.default_mesh(cpu_mesh): + x = tf.ones((4, 4)) + + with dtensor.default_mesh(gpu_mesh): + y = func(x) + + # y would be on the cpu mesh, following the mesh of x. + ``` + + Args: + tensor: A DTensor to specify a new layout for. + layout_tensor: A Tensor object whose layout will be used for the layout of + result. The shape and type of layout_tensor are irrelevant. + name: name of the Op. + + Returns: + A DTensor output from the RelayoutLike op. + """ + + return gen_dtensor_ops.relayout_like( + input=tensor, layout_input=layout_tensor, name=name + ) + + +@tf_export("experimental.dtensor._reset_dtensor_device", v1=[]) +def reset_dtensor_device(is_async: bool) -> None: + """Resets the Eager execution device for DTensor. + + This function is only intended for testing and diagnostics. + + Args: + is_async: If True, the device uses async execution. + """ + global _dtensor_singleton + device = dtensor_device.DTensorDevice(meshes=[], is_async=is_async) + _dtensor_singleton = device + + +def _dtensor_device() -> dtensor_device.DTensorDevice: + with _dtensor_singleton_lock: + if _dtensor_singleton is None: + reset_dtensor_device(is_async=True) + return _dtensor_singleton + + +def _reset() -> None: + global _dtensor_singleton + with _dtensor_singleton_lock: + if _dtensor_singleton is not None: + _dtensor_singleton.clear_tpu_core_ids() + _dtensor_singleton = None + + +# ---------------------------------------------------------------------------- +# Gradients + + +@ops.RegisterGradient("Relayout") +def _relayout_gradient(op, grad): + grad = gen_dtensor_ops.relayout_like(grad, layout_input=op.inputs[0]) + return grad + + +@ops.RegisterGradient("RelayoutLike") +def _relayout_grad_gradient(op, grad): + # Gradient of RelayoutGrad is relayout to the original Relayout's output. + grad = gen_dtensor_ops.relayout_like(grad, layout_input=op.inputs[0]) + # Return None for forward_input's partial gradient since it is not connected + # to the target's gradient. + return grad, None + + +@ops.RegisterGradient("CopyToMesh") +def _copy_to_mesh_gradient(op, grad): + grad = gen_dtensor_ops.copy_to_mesh_grad( + grad, + forward_input=op.inputs[0], + ) + return grad + + +@ops.RegisterGradient("CopyToMeshGrad") +def _copy_to_mesh_grad_gradient(op, grad): + grad = gen_dtensor_ops.copy_to_mesh_grad( + grad, + forward_input=op.inputs[0], + ) + return grad, None diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/config.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/config.py new file mode 100644 index 0000000000000000000000000000000000000000..d03491d20bbe708bf474c5c8eeb96c19fc85ce39 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/config.py @@ -0,0 +1,219 @@ +# Copyright 2022 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. +# ============================================================================== +"""DTensor Configuration API.""" + +import os +from typing import List, Optional, Union + +from tensorflow.python.eager import context +from tensorflow.python.framework import config as tf_config +from tensorflow.python.framework import device as tf_device +from tensorflow.python.util.tf_export import tf_export + +_DT_CLIENT_ID = "DTENSOR_CLIENT_ID" +# DTENSOR_NUM_CLIENTS is removed, but some DTensor users still use this symbol. +_DT_NUM_CLIENTS = "DTENSOR_NUM_CLIENTS" +_DT_JOB_NAME = "DTENSOR_JOB_NAME" +_DT_JOBS = "DTENSOR_JOBS" +_DT_HEARTBEAT_ENABLED = "DTENSOR_ENABLE_HEARTBEAT" + + +# All functions in this file can be used before calling +# `tf.experimental.dtensor.initialize_accelerator_system`. + + +# ----------------------------------------------------------------------------- +# Distributed training-related methods. +# +# Most users should use DTensor utility methods to create a mesh. The methods +# here are only for advanced users who want to fully customize their meshes. +# Note that local_devices and num_local_devices return the actual number of +# locally attached devices. The others are set through environment variables. + + +@tf_export("experimental.dtensor.local_devices", v1=[]) +def local_devices( + device_type: str, + for_client_id: Optional[int] = None) -> List[tf_device.DeviceSpec]: + """Returns a list of device specs configured on this client.""" + if device_type.upper() not in ["CPU", "GPU", "TPU"]: + raise ValueError(f"Device type {device_type} is not CPU, GPU, or TPU.") + + if for_client_id is None: + for_client_id = client_id() + + # Return fully qualified device specs, sorted by increasing device index. + return [ + tf_device.DeviceSpec( # pylint: disable=g-complex-comprehension + job=job_name(), + replica=0, # replica is deprecated and mostly hard-coded now. + task=for_client_id, + device_type=device_type, + device_index=i) for i in range(num_local_devices(device_type)) + ] + + +@tf_export("experimental.dtensor.num_local_devices", v1=[]) +def num_local_devices(device_type: str) -> int: + """Returns the number of devices of device_type configured on this client.""" + + # Reads from config because CPU and GPU can use logical devices. + if device_type.upper() in ["CPU", "GPU"]: + context_config = context.get_config() + return context_config.device_count[device_type.upper()] + + return len(tf_config.list_physical_devices(device_type)) + + +@tf_export("experimental.dtensor.num_global_devices", v1=[]) +def num_global_devices(device_type: str) -> int: + """Returns the number of devices of device_type in this DTensor cluster.""" + return num_local_devices(device_type) * num_clients() + + +@tf_export("experimental.dtensor.client_id", v1=[]) +def client_id() -> int: + """Returns this client's ID.""" + # If missing, assume running with a single client with client_id of 0. + client_id_value = int(os.environ.get(_DT_CLIENT_ID, "0")) + if client_id_value < 0: + raise ValueError(f"Environment variable {_DT_CLIENT_ID} " + f"must be >= 0, got {client_id_value}. ") + if client_id_value >= num_clients(): + raise ValueError(f"Environment variable {_DT_CLIENT_ID} " + f"must be < {num_clients()}, got {client_id_value}") + return client_id_value + + +@tf_export("experimental.dtensor.num_clients", v1=[]) +def num_clients() -> int: + """Returns the number of clients in this DTensor cluster.""" + if is_local_mode(): + return 1 + return len(jobs()) + + +@tf_export("experimental.dtensor.job_name", v1=[]) +def job_name() -> str: + """Returns the job name used by all clients in this DTensor cluster.""" + # If missing, assumes the program runs locally and use localhost as job name + # per TensorFlow convention. + return os.environ.get(_DT_JOB_NAME, + "localhost" if num_clients() == 1 else "worker") + + +@tf_export("experimental.dtensor.full_job_name", v1=[]) +def full_job_name(task_id: Optional[int] = None) -> str: + """Returns the fully qualified TF job name for this or another task.""" + # If task_id is None, use this client's ID, which is equal to its task ID. + if task_id is None: + task_id = client_id() + # In local runs and unit tests, there should be exactly one client running + # on one TF task. + if num_clients() == 1 and task_id != 0: + raise ValueError(f"Unexpected task ID {task_id} in local runs") + return f"{job_name()}/replica:0/task:{task_id}" + + +def _bns_task_id(job: str) -> Union[int, str]: + """Tries to extract an integer task ID from a job name. + + For example, for `job` = '/.../tpu_worker/0:port_name', return 0. + + Args: + job: A job name to extract task ID from. + + Returns: + The task ID on success, or the original job name on failure. + """ + maybe_task_id = job.rsplit("/")[-1].rsplit(":")[0] + try: + return int(maybe_task_id) + except ValueError: + return job + + +@tf_export("experimental.dtensor.jobs", v1=[]) +def jobs() -> List[str]: + """Returns a list of job names of all clients in this DTensor cluster.""" + d_jobs = os.environ.get(_DT_JOBS) + if d_jobs is None: + return [] + d_jobs_list = d_jobs.split(",") + + # Validate ordering for BNS style job names. + # For definition of BNS, refer to https://research.google/pubs/pub43438/. + if any([name.startswith("/bns/") for name in d_jobs_list]): + if d_jobs_list != sorted(d_jobs_list, key=_bns_task_id): + raise ValueError( + f"Unexpected DTENSOR_JOBS content {d_jobs}. Sort entries " + "in DTENSOR_JOBS because cluster construction relies on " + "the order.") + + return d_jobs_list + + +@tf_export("experimental.dtensor.heartbeat_enabled", v1=[]) +def heartbeat_enabled() -> bool: + """Returns true if DTensor heartbeat service is enabled.""" + return os.environ.get(_DT_HEARTBEAT_ENABLED, "true").lower() in ("true", "1") + + +def is_local_mode() -> bool: + """Returns true if DTensor shall run in local mode.""" + return not jobs() + + +def is_tpu_present() -> bool: + """Returns true if TPU devices are present.""" + # Check if TPU is present from initialized context. + # TPU_SYSTEM is a device that indicates TPUs are present. + tpu_system_devices = tf_config.list_physical_devices("TPU_SYSTEM") + return bool(tpu_system_devices) + + +def is_gpu_present() -> bool: + """Returns true if TPU devices are present.""" + return bool(tf_config.list_physical_devices("GPU")) + + +@tf_export("experimental.dtensor.preferred_device_type", v1=[]) +def preferred_device_type() -> str: + """Returns the preferred device type for the accelerators. + + The returned device type is determined by checking the first present device + type from all supported device types in the order of 'TPU', 'GPU', 'CPU'. + """ + if is_tpu_present(): + return "TPU" + elif is_gpu_present(): + return "GPU" + + return "CPU" + + +def use_multi_device_mode() -> bool: + """Return True if environment indicates multi-device mode is enabled.""" + return os.environ.get("DTENSOR_ENABLE_MULTI_DEVICE_EXPANSION", "0") != "0" + + +def gpu_use_nccl_communication() -> bool: + """Return True if environment indicates NCCL shall be used for GPU.""" + return os.environ.get("DTENSOR_GPU_USE_NCCL_COMMUNICATION", "0") != "0" + + +def backend_is_pw() -> bool: + """Return True if environment indicates the backend is Pathways.""" + return os.environ.get("DTENSOR_USE_PARALLEL_EXECUTOR") == "pw" diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/d_checkpoint.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/d_checkpoint.py new file mode 100644 index 0000000000000000000000000000000000000000..366ddc9e24d9b3009e49d1a81d036f2047be551b --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/d_checkpoint.py @@ -0,0 +1,462 @@ +# Copyright 2022 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. +# ============================================================================== +"""DTensor Checkpoint. + +Note that this module contains deprecated functionality, and the DTensor related +checkpoint has been integrated with tf.train.Checkpoint. It can be used out of +the box to save and restore dtensors. +""" + +from typing import Dict, List, Optional +import weakref + +from tensorflow.core.protobuf import trackable_object_graph_pb2 + +from tensorflow.dtensor.python import api +from tensorflow.dtensor.python import d_variable +from tensorflow.dtensor.python import gen_dtensor_ops +from tensorflow.dtensor.python import layout +from tensorflow.dtensor.python import save_restore +from tensorflow.python.checkpoint import checkpoint as util +from tensorflow.python.checkpoint import checkpoint_options +from tensorflow.python.checkpoint import graph_view as graph_view_lib +from tensorflow.python.checkpoint import restore as restore_lib +from tensorflow.python.eager import context +from tensorflow.python.framework import constant_op +from tensorflow.python.framework import errors_impl +from tensorflow.python.framework import ops +from tensorflow.python.ops import array_ops +from tensorflow.python.trackable import base +from tensorflow.python.trackable import data_structures +from tensorflow.python.training import py_checkpoint_reader +from tensorflow.python.training.saving import saveable_object +from tensorflow.python.training.saving import saveable_object_util +from tensorflow.python.util import deprecation +from tensorflow.python.util import nest +from tensorflow.python.util.tf_export import tf_export + + +class _DSaver: # pylint: disable=protected-access + """A single device saver that places tensors on DTensor Device.""" + + def __init__(self, mesh: layout.Mesh, + saveable_objects: List[saveable_object.SaveableObject]): + self._saveable_objects = saveable_objects + self._mesh = mesh + + def save( + self, + file_prefix: str, + options: Optional[checkpoint_options.CheckpointOptions] = None + ) -> Optional[ops.Operation]: + """Saves the saveable objects to a checkpoint with `file_prefix`. + + Also query the generated shards from the distributed DTensor SaveV2 ops and + do a MergeV2 on those. Each op here is backed by a global_barrier to avoid + racing from multiple clients. + + Args: + file_prefix: A string or scalar string Tensor containing the prefix to + save under. + options: Optional `CheckpointOptions` object. This is unused in DTensor. + + Returns: + An `Operation`, or None when executing eagerly. + """ + if options is not None and options.experimental_io_device is not None: + raise ValueError( + "Specified experimental_io_device in DTensor checkpoint is not supported." + ) + del options + tensor_names = [] + tensors = [] + tensor_slices = [] + for saveable in self._saveable_objects: + for spec in saveable.specs: + tensor = spec.tensor + # A tensor value of `None` indicates that this SaveableObject gets + # recorded in the object graph, but that no value is saved in the + # checkpoint. + if tensor is not None: + if api.device_name() != spec.device: + # Some small tensors are placed on CPU0 from save manager and + # broadcasted to DTensor mesh, e,g., SaveCounter. + tensor = api.pack([tensor] * + self._mesh.host_mesh().num_local_devices(), + layout.Layout.replicated( + self._mesh.host_mesh(), + rank=tensor.shape.rank)) + tensor_names.append(spec.name) + tensors.append(tensor) + tensor_slices.append(spec.slice_spec) + return save_restore.sharded_save(self._mesh, file_prefix, tensor_names, + tensor_slices, tensors) + + def restore( + self, + file_prefix: str, + options: Optional[checkpoint_options.CheckpointOptions] = None + ) -> Dict[str, ops.Operation]: + """Restore the saveable objects from a checkpoint with `file_prefix`. + + Args: + file_prefix: A string or scalar string Tensor containing the prefix for + files to read from. + options: Optional `CheckpointOptions` object. This is unused in DTensor. + + Returns: + A dictionary mapping from SaveableObject names to restore operations. + """ + if options is not None and options.experimental_io_device is not None: + raise ValueError( + "Specified experimental_io_device in DTensor checkpoint is not " + "supported.") + del options + restore_specs = [] + tensor_structure = [] + for saveable in self._saveable_objects: + saveable_tensor_structure = [] + tensor_structure.append(saveable_tensor_structure) + # DTensor change 1 : Gather shapes and layout from original saveable + # specs. + # Note that this relies on the fact that the variables are already + # initialized -- which isn't the behavior we want eventually. + # TODO(b/159035705): Handle the variable initialization in restore. + for spec in saveable.specs: + saveable_tensor_structure.append(spec.name) + if isinstance(spec, d_variable.DSaveSpec): + restore_specs.append((spec.name, spec.slice_spec, spec.dtype, + spec.layout, spec.global_shape)) + # Fall back to replicated layouts for non-DTensor saves that constructs + # normal SaveSpec. + elif isinstance(spec, saveable_object.SaveSpec): + restore_specs.append( + (spec.name, spec.slice_spec, spec.dtype, + layout.Layout.replicated(self._mesh.host_mesh(), + spec.tensor.shape.rank).to_string(), + spec.tensor.shape.as_list())) + tensor_names, tensor_slices, tensor_dtypes, layouts, global_shapes = zip( + *restore_specs) + with ops.device(api.device_name()): + # DTensor change 2 : Run on customized DTensor RestoreV2 op rather than + # stock TF io_ops.RestoreV2. + restored_tensors = gen_dtensor_ops.d_tensor_restore_v2( + prefix=file_prefix, + tensor_names=tensor_names, + shape_and_slices=tensor_slices, + input_shapes=global_shapes, + input_layouts=layouts, + dtypes=tensor_dtypes) + structured_restored_tensors = nest.pack_sequence_as(tensor_structure, + restored_tensors) + restore_ops = {} + for saveable, restored_tensors in zip(self._saveable_objects, + structured_restored_tensors): + restore_ops[saveable.name] = saveable.restore( + restored_tensors, restored_shapes=None) + return restore_ops + + +class _DCheckpointRestoreCoordinator(util._CheckpointRestoreCoordinator): # pylint: disable=protected-access + """Holds the status of an object-based checkpoint load.""" + + def __init__(self, mesh: layout.Mesh, **kwargs): + super().__init__(**kwargs) + self._mesh = mesh + + def restore_saveables(self, + tensor_saveables: Dict[str, + saveable_object.SaveableObject], + python_positions: List[restore_lib.CheckpointPosition], + registered_savers: Optional[Dict[str, Dict[ + str, base.Trackable]]] = None, + reader: py_checkpoint_reader.NewCheckpointReader = None + ) -> Optional[List[ops.Operation]]: + """Run or build restore operations for SaveableObjects. + + Args: + tensor_saveables: `SaveableObject`s which correspond to Tensors. + python_positions: `CheckpointPosition`s which correspond to `PythonState` + Trackables bound to the checkpoint. + registered_savers: a dict mapping saver names-> object name -> Trackable. + This argument is not implemented for DTensorCheckpoint. + reader: A CheckpointReader. Creates one lazily if None. + + Returns: + When graph building, a list of restore operations, either cached or newly + created, to restore `tensor_saveables`. + """ + del registered_savers + + restore_ops = [] + # Eagerly run restorations for Python state. + if python_positions: + # Lazily create the NewCheckpointReader, since this requires file access + # and we may not have any Python saveables. + if reader is None: + reader = py_checkpoint_reader.NewCheckpointReader(self.save_path_string) + for position in python_positions: + key = position.object_proto.attributes[0].checkpoint_key + position.trackable.deserialize(reader.get_tensor(key)) + + # If we have new SaveableObjects, extract and cache restore ops. + if tensor_saveables: + validated_saveables = saveable_object_util.validate_and_slice_inputs( + tensor_saveables) + validated_names = set(saveable.name for saveable in validated_saveables) + if set(tensor_saveables.keys()) != validated_names: + raise AssertionError( + ("Saveable keys changed when validating. Got back %s, was " + "expecting %s") % (tensor_saveables.keys(), validated_names)) + # DTensor change: Use _DSaver that does restore on DTensor with + # customized DTensorRestoreV2 op. + new_restore_ops = _DSaver(self._mesh, validated_saveables).restore( + self.save_path_tensor, self.options) + if not context.executing_eagerly(): + for name, restore_op in sorted(new_restore_ops.items()): + restore_ops.append(restore_op) + assert name not in self.restore_ops_by_name + self.restore_ops_by_name[name] = restore_op + return restore_ops + + +class DTrackableSaver(util.TrackableSaver): + """A DTensor trackable saver that uses _SingleDeviceSaver.""" + + def __init__(self, mesh: layout.Mesh, graph_view): + super(DTrackableSaver, self).__init__(graph_view) + self._mesh = mesh + + def _gather_saveables(self, object_graph_tensor=None): + # Since the base Checkpoint class does not return SaveableObjects, re-use + # the saveables cache or generate new Saveables. + (serialized_tensors, feed_additions, registered_savers, + graph_proto) = self._gather_serialized_tensors(object_graph_tensor) + + saveables_dict = self._saveables_cache + if saveables_dict is None: + # Get and remove object graph tensor from `serialized_tensors`, because + # the function `serialized_tensors_to_saveable_cache` isn't equipped + # to handle it. + object_graph_tensor = serialized_tensors.pop( + None)[base.OBJECT_GRAPH_PROTO_KEY] + saveables_dict = ( + saveable_object_util.serialized_tensors_to_saveable_cache( + serialized_tensors)) + named_saveable_objects = [] + for saveable_by_name in saveables_dict.values(): + for saveables in saveable_by_name.values(): + named_saveable_objects.extend(saveables) + named_saveable_objects.append( + base.NoRestoreSaveable( + tensor=object_graph_tensor, + name=base.OBJECT_GRAPH_PROTO_KEY)) + return (named_saveable_objects, graph_proto, feed_additions, + registered_savers) + + def _save_cached_when_graph_building(self, + file_prefix, + object_graph_tensor, + options, + update_ckpt_state=False): + """Create or retrieve save ops, overrides parents's private method. + + Args: + file_prefix: The prefix for saved checkpoint files. + object_graph_tensor: A `Tensor` to which the current object graph will be + fed. + options: `CheckpointOptions` object. + update_ckpt_state: Optional bool flag. Indiciate whether the internal + checkpoint state needs to be updated. This is used for async checkpoint, + which DTrackableSaver currently does not support. + TODO(chienchunh): Implement async checkpoint for DTrackableSaver. + + Returns: + A two-element tuple with a filename tensor and a feed_dict of tensors to + feed when running it (if graph building). The feed dict contains the + current object graph and any Python state to be saved in the + checkpoint. When executing eagerly only the first argument is meaningful. + """ + (named_saveable_objects, graph_proto, feed_additions, + unused_registered_savers) = self._gather_saveables( + object_graph_tensor=object_graph_tensor) + if (self._last_save_object_graph != graph_proto + # When executing eagerly, we need to re-create SaveableObjects each time + # save() is called so they pick up new Tensors passed to their + # constructors. That means the Saver needs to be copied with a new + # var_list. + or context.executing_eagerly() or ops.inside_function()): + # This is needed to avoid MultiDeviceSaver creating unnecessary MergeV2 + # ops in DTensor. It is an issue when saving TPU Variables on host CPU + # mesh given our limited expressiveness in API and hard-coded logic in + # broadcasting -- for a small constant Tensor with no extra information, + # we place it on the first registered mesh(A.K.A. default mesh). + saver = _DSaver(self._mesh, named_saveable_objects) + save_op = saver.save(file_prefix, options=options) + with ops.device("/cpu:0"): + with ops.control_dependencies([save_op]): + self._cached_save_operation = array_ops.identity(file_prefix) + self._last_save_object_graph = graph_proto + return self._cached_save_operation, feed_additions + + # TODO(b/180466245): Use proper mesh placement semantic. + def restore(self, save_path, options=None): + """Restore a training checkpoint with host mesh placement.""" + options = options or checkpoint_options.CheckpointOptions() + if save_path is None: + return util.InitializationOnlyStatus(self._graph_view, ops.uid()) + reader = py_checkpoint_reader.NewCheckpointReader(save_path) + graph_building = not context.executing_eagerly() + if graph_building: + dtype_map = None + else: + dtype_map = reader.get_variable_to_dtype_map() + try: + object_graph_string = reader.get_tensor(base.OBJECT_GRAPH_PROTO_KEY) + except errors_impl.NotFoundError: + # The object graph proto does not exist in this checkpoint. Try the + # name-based compatibility mode. + restore_coordinator = util._NameBasedRestoreCoordinator( # pylint: disable=protected-access + save_path=save_path, + dtype_map=dtype_map) + if not graph_building: + for existing_trackable in self._graph_view.list_objects(): + # pylint: disable=protected-access + existing_trackable._maybe_initialize_trackable() + existing_trackable._name_based_restores.add(restore_coordinator) + existing_trackable._name_based_attribute_restore(restore_coordinator) + # pylint: enable=protected-access + return util.NameBasedSaverStatus( + restore_coordinator, graph_view=self._graph_view) + + if graph_building: + if self._file_prefix_placeholder is None: + # DTensor change: provide a hint for mesh broadcasting to put the input + # onto the host mesh. + self._file_prefix_placeholder = api.pack( + [constant_op.constant("model")] * self._mesh.num_local_devices(), + layout.Layout.replicated(self._mesh.host_mesh(), rank=0)) + file_prefix_tensor = self._file_prefix_placeholder + file_prefix_feed_dict = {self._file_prefix_placeholder: save_path} + else: + # DTensor change: provide a hint for mesh broadcasting to put the input + # onto the host mesh. + file_prefix_tensor = api.pack( + [constant_op.constant(save_path)] * self._mesh.num_local_devices(), + layout.Layout.replicated(self._mesh.host_mesh(), rank=0)) + file_prefix_feed_dict = None + object_graph_proto = (trackable_object_graph_pb2.TrackableObjectGraph()) + object_graph_proto.ParseFromString(object_graph_string) + # DTensor Change: Hook the proper DSaver in restore. + checkpoint = _DCheckpointRestoreCoordinator( + mesh=self._mesh, + object_graph_proto=object_graph_proto, + save_path=save_path, + save_path_tensor=file_prefix_tensor, + reader=reader, + restore_op_cache=self._restore_op_cache, + graph_view=self._graph_view, + options=options, + saveables_cache=self._saveables_cache) + restore_lib.CheckpointPosition( + checkpoint=checkpoint, proto_id=0).restore(self._graph_view.root) + + # Attached dependencies are not attached to the root, so should be restored + # separately. + if self._graph_view.attached_dependencies: + for ref in self._graph_view.attached_dependencies: + if ref.name == "root": + # Root dependency is automatically added to attached dependencies -- + # this can be ignored since it maps back to the root object. + continue + proto_id = None + # Find proto ID of attached dependency (if it is in the proto). + for proto_ref in object_graph_proto.nodes[0].children: + if proto_ref.local_name == ref.name: + proto_id = proto_ref.node_id + break + + if proto_id in checkpoint.object_by_proto_id: + # Object has already been restored. This can happen when there's an + # indirect connection from the attached object to the root. + continue + + restore_lib.CheckpointPosition( + checkpoint=checkpoint, proto_id=proto_id).restore(ref.ref) + + load_status = util.CheckpointLoadStatus( + checkpoint, + graph_view=self._graph_view, + feed_dict=file_prefix_feed_dict) + return load_status + + +@deprecation.deprecated( + date=None, + instructions="Please use tf.train.Checkpoint instead of DTensorCheckpoint. " + "DTensor is integrated with tf.train.Checkpoint and it can be " + "used out of the box to save and restore dtensors.") +@tf_export("experimental.dtensor.DTensorCheckpoint", v1=[]) +class DTensorCheckpoint(util.Checkpoint): + """Manages saving/restoring trackable values to disk, for DTensor.""" + + def __init__(self, mesh: layout.Mesh, root=None, **kwargs): + super(DTensorCheckpoint, self).__init__(root=root, **kwargs) + self._mesh = mesh + + saver_root = self + attached_dependencies = None + self._save_counter = None # Created lazily for restore-on-create. + self._save_assign_op = None + + if root: + util._assert_trackable(root, "root") + saver_root = root + attached_dependencies = [] + + # All keyword arguments (including root itself) are set as children + # of root. + kwargs["root"] = root + root._maybe_initialize_trackable() + + self._save_counter = data_structures.NoDependency( + root._lookup_dependency("save_counter")) + self._root = data_structures.NoDependency(root) + + for k, v in sorted(kwargs.items(), key=lambda item: item[0]): + setattr(self, k, v) + + # Call getattr instead of directly using v because setattr converts + # v to a Trackable data structure when v is a list/dict/tuple. + converted_v = getattr(self, k) + util._assert_trackable(converted_v, k) + + if root: + # Make sure that root doesn't already have dependencies with these names + attached_dependencies = attached_dependencies or [] + child = root._lookup_dependency(k) + if child is None: + attached_dependencies.append(base.TrackableReference(k, converted_v)) + elif child != converted_v: + raise ValueError( + "Cannot create a Checkpoint with keyword argument {name} if " + "root.{name} already exists.".format(name=k)) + # DTensor Change: + # Override the parents saver with DTrackableSaver with _SingleDeviceSaver. + self._saver = DTrackableSaver( + mesh, + graph_view_lib.ObjectGraphView( + weakref.ref(saver_root), + attached_dependencies=attached_dependencies)) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/d_variable.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/d_variable.py new file mode 100644 index 0000000000000000000000000000000000000000..b99875f03fa70ed4f942a0d70c828040a7223e64 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/d_variable.py @@ -0,0 +1,260 @@ +# Copyright 2022 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. +# ============================================================================== +"""DTensor variable and saveable.""" + +import functools + +from tensorflow.dtensor.python import api +from tensorflow.dtensor.python import layout as layout_lib +from tensorflow.python.eager import context +from tensorflow.python.eager import def_function +from tensorflow.python.framework import dtypes +from tensorflow.python.framework import errors_impl +from tensorflow.python.framework import ops +from tensorflow.python.ops import math_ops +from tensorflow.python.ops import resource_variable_ops +from tensorflow.python.trackable import base as trackable +from tensorflow.python.training.saving import saveable_object +from tensorflow.python.util.tf_export import tf_export + + +class DSaveSpec(saveable_object.SaveSpec): + """DTensor SaveSpec that additionaly captures global_shape and layout.""" + + def __init__(self, + tensor, + slice_spec, + name, + global_shape, + layout, + dtype=None, + device=None): + super().__init__( + tensor=tensor, + slice_spec=slice_spec, + name=name, + dtype=dtype, + device=device) + self.global_shape = global_shape + self.layout = layout + + +class _DVariableSaveable(saveable_object.SaveableObject): + """Class for defining how to save/restore DTensor variable.""" + + def __init__(self, dvariable, name): + with ops.device(dvariable.device): + original_layout = api.fetch_layout(dvariable) + # Record original layout to allow restore. + self._original_layout = original_layout + self._dvariable = dvariable + + def pack(tensors, layout): + with ops.device(dvariable.device): + return api.pack(tensors, layout) + + host_layout = layout_lib.Layout(original_layout.sharding_specs, + original_layout.mesh.host_mesh()) + + def get_host_dtensor(): + # Copy to host mesh if needed. + if original_layout.mesh.device_type().upper() != 'CPU': + # Prefer pack and unpack in eager mode because it supports sharded + # layouts. + if context.executing_eagerly(): + host_dtensor = api.pack( + api.unpack(dvariable.read_value()), host_layout) + else: + host_dtensor = api.copy_to_mesh(dvariable.read_value(), host_layout) + else: + host_dtensor = dvariable.read_value() + return (math_ops.cast(host_dtensor, dtypes.bfloat16) + if self.should_cast(host_dtensor) else host_dtensor) + + num_local_devices = original_layout.mesh.num_local_devices() + super(_DVariableSaveable, self).__init__( + None, + [ + DSaveSpec( + tensor=get_host_dtensor, + slice_spec=pack([''] * num_local_devices, + layout_lib.Layout.replicated( + original_layout.mesh.host_mesh(), rank=0)), + name=pack([name] * num_local_devices, + layout_lib.Layout.replicated( + original_layout.mesh.host_mesh(), rank=0)), + global_shape=dvariable.shape, + # Layout is attached as attribute, no need to put it as a + # Tensor on DTensorDevice. + layout=host_layout.to_string(), + dtype=dtypes.bfloat16 + if self.should_cast(dvariable) else dvariable.dtype, + device=dvariable.device) + ], + name) + + def should_cast(self, v): + """Returns True if v has float32 dtype and is intructed to save as bf16. + + Args: + v : The variable that determines whether to cast. + + Returns: + True if current savable DVariable is instructed to save as bfloat16 and + the variable has dtype float32. + """ + return self._dvariable.save_as_bf16 and v.dtype == dtypes.float32 + + def restore(self, restored_tensors, restored_shapes): + """Restores the same value into all variables.""" + tensor, = restored_tensors + + @def_function.function + def _restore(t): + with ops.device(self._dvariable.device): + return api.copy_to_mesh(t, self._original_layout) + + # This assign establishes connections from restored tensor and tensors + # being restored to -- so that restore in SPMD can backtrack the DVariable + # and its layout, given that we're using tf.function style restore. + # Note that the restored dvaraible is on CPU no matter what as the restoreV2 + # op must run on CPU. + # TODO(b/159035705): Allow restore for Tensor objects as well? + # Restore the dvariable back to original layout. + if self._original_layout.mesh.device_type().upper() != 'CPU': + tensor = _restore(tensor) + return self._dvariable.assign( + math_ops.cast(tensor, dtype=self._dvariable.dtype) if self._dvariable + .save_as_bf16 else tensor) + + +@tf_export('experimental.dtensor.DVariable', v1=[]) +class DVariable(resource_variable_ops.ResourceVariable): + """A replacement for tf.Variable which follows initial value placement. + + The class also handles restore/save operations in DTensor. Note that, + DVariable may fall back to normal tf.Variable at this moment if + `initial_value` is not a DTensor. + """ + + def __init__(self, initial_value, *args, dtype=None, **kwargs): + """Overrides tf.Variable to fix VarHandleOp placements.""" + # Variables by default use the current device scope for placement. This + # wrapper has them follow the initial value's placement instead (which will + # be the DTensor device if the initial value has a layout). + + # Pop layout from kwargs since keras make_variable may pass a 'layout' + # keyword argument. We need to pop it because we are passing kwargs to + # super class constructor. + layout = kwargs.pop('layout', None) + shape = kwargs.get('shape', None) + + if callable(initial_value): + unwrapped = initial_value + if issubclass(type(initial_value), functools.partial): + unwrapped = initial_value.func + + # If wrapped is a CheckpointInitialValueCallable, this means that + # we are creating a Variable during a checkpoint restore. + # Thus the restore will happen now through this callable + # and we will create the DVariable with the restored dtensor. + if issubclass(type(unwrapped), trackable.CheckpointInitialValueCallable): + if not shape or not layout: + raise ValueError('Expected shape and layout to be not None.') + + # CheckpointInitialValueCallable will call an eager tf.RestoreV2, + # which does not have any shape information or layout information + # attached. Thus we will do two things to have them correctly specified: + # + # The default layout scope allows us to correctly specify the output + # layout of the tf.RestoreV2 that will be called + # + # Passing shard_info with the correct shape allows the tf.RestoreV2 + # ShapeInference to extract the shape. + initial_value = api.call_with_layout( + initial_value, + layout, + shard_info=trackable.ShardInfo( + shape=shape, offset=[0] * len(shape))) + else: + initial_value = initial_value() + + # When the initial value came from a Checkpoint restoration, fetch tensor. + if isinstance(initial_value, trackable.CheckpointInitialValue): + initial_value = initial_value.wrapped_value + + initial_value = ops.convert_to_tensor(initial_value, dtype=dtype) + variable_device = initial_value.device + self._save_as_bf16 = False + # TODO(b/159035705): The following code enables variable creation inside + # a tf.function. However, it requires a global dtensor device. + # if not variable_device and not tf.executing_eagerly(): + # try: + # initial_value.op.get_attr("_layout") + # except ValueError: + # pass + # else: + # # The initial value is a DTensor, but because the DTensor device is + # # only active during eager execution at the moment we need to + # # translate that into a placement for the eager VarHandleOp. + # variable_device = _dtensor_device().name + with ops.device(variable_device): + # If initial tensor assigned to DVariable is DTensor, record the layout of + # the resource so that this can be queried. + if context.executing_eagerly(): + if api.is_dtensor(initial_value): + value_layout = api.fetch_layout(initial_value) + if layout is not None and layout != value_layout: + raise errors_impl.InvalidArgumentError( + None, + None, + 'Conflicting layout are provided for initial ' + f'value layout ({value_layout}) and variable ({layout}).', + ) + layout = value_layout + elif layout is not None: + initial_value = api.relayout(initial_value, layout) + else: + raise errors_impl.InvalidArgumentError( + None, + None, + 'Neither layout nor DTensor initial value are provided.', + ) + self.layout = layout + with api.default_mesh(layout.mesh): + super(DVariable, self).__init__( + initial_value, *args, dtype=dtype, **kwargs + ) + else: + # FIXME(175928457): Record value layout in graph mode. + if layout is not None: + initial_value = api.relayout(initial_value, layout) + super(DVariable, self).__init__( + initial_value, *args, dtype=dtype, **kwargs) + + @property + def save_as_bf16(self): + return self._save_as_bf16 + + @save_as_bf16.setter + def save_as_bf16(self, save_as_bf16): + """Enables saving float32 as bfloat16.""" + self._save_as_bf16 = save_as_bf16 and self.dtype == dtypes.float32 + + def _gather_saveables_for_checkpoint(self): + return { + trackable.VARIABLE_VALUE_KEY: + functools.partial(_DVariableSaveable, self) + } diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/dtensor_device.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/dtensor_device.py new file mode 100644 index 0000000000000000000000000000000000000000..5c6dff23052b66f0c31e945af35bf86716ef5026 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/dtensor_device.py @@ -0,0 +1,437 @@ +# Copyright 2022 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. +# ============================================================================== +"""Propagates information about tensor layouts across operations.""" + +import contextlib +import logging +import threading +from typing import Any, List, Sequence, Set + +import numpy as np + +from tensorflow.core.framework import attr_value_pb2 +from tensorflow.dtensor.python import config +from tensorflow.dtensor.python import layout as layout_lib +from tensorflow.python import _pywrap_dtensor_device +from tensorflow.python.eager import context +from tensorflow.python.eager import core +from tensorflow.python.framework import device as tf_device +from tensorflow.python.framework import dtypes +from tensorflow.python.framework import ops +from tensorflow.python.framework import sparse_tensor +from tensorflow.python.framework import tensor_util +from tensorflow.python.util import _pywrap_utils + + +# TODO(allenl): Allow something other than "CUSTOM" so we don't need device +# numbering hacks to avoid collisions between parallel devices and dtensor +# devices. +_next_device_number = 0 +_next_device_number_lock = threading.Lock() + + +class DTensorDevice(object): + """Wraps a custom device which attempts to propagate tensor layouts.""" + + def __init__(self, + meshes: List[layout_lib.Mesh], + is_async=True, + in_flight_nodes_limit=8): + """Create a new DTensorDevice which executes ops on `underlying_device`. + + Args: + meshes: A list of `Mesh` objects indicating groups of devices to execute + on. These may also be registered lazily. + is_async: Indicates whether DTensor operations on this client will return + immediately (with "non-ready" handles) or block until executed. This is + on by default and is exposed as an option for ease of debugging. + in_flight_nodes_limit: Indicates the limit of in-flight nodes before + enqueueing of async operations to DTensorDevice is blocked. This limit + is per mesh. 0 for no limits from DTensor. Default is 8. + """ + if any(not isinstance(mesh, layout_lib.Mesh) for mesh in meshes): + raise TypeError( + "Expected a flat list of Mesh objects, got {}".format(meshes)) + global _next_device_number + ctx = context.context() + with _next_device_number_lock: + self.name = "{}/device:CUSTOM:{}".format(ctx.host_address_space(), + _next_device_number) + _next_device_number += 1 + device, device_info = _pywrap_dtensor_device.Allocate( + self.name, is_async, in_flight_nodes_limit + ) + context.register_custom_device(device, self.name, device_info) + + self._device_info = device_info + self._current_output_layout = None + self._current_default_mesh = None + self._meshes = set() + self._mesh_lock = threading.Lock() + for mesh in meshes: + self._register_mesh(mesh) + + def _create_host_array(self, shape, host_id): + """Returns ID and device lists that can be used to create a host mesh.""" + num_global_devices = np.prod(shape) + global_device_ids = np.arange(num_global_devices).reshape(shape) + local_device_list = [ + tf_device.DeviceSpec( + job=config.full_job_name(), device_type="CPU", device_index=0) + ] + num_local_devices = len(local_device_list) + local_device_ids = [ + x + host_id * num_local_devices for x in range(num_local_devices) + ] + return global_device_ids, local_device_ids, local_device_list + + def _register_mesh(self, mesh: layout_lib.Mesh): + """Idempotently register `mesh` with the dtensor device.""" + with self._mesh_lock: + if mesh not in self._meshes: + _pywrap_dtensor_device.AddMesh( + self._device_info, mesh.to_string(), False + ) + self._meshes.add(mesh) + if mesh.device_type().upper() == "TPU": + logging.info( + "Registering virtual 1:1 mapped host mesh %s for mesh %s", + mesh.host_mesh().to_string(), mesh.to_string()) + _pywrap_dtensor_device.AddMesh( + self._device_info, mesh.host_mesh().to_string(), True + ) + self._meshes.add(mesh.host_mesh()) + + @property + def meshes(self) -> Set[layout_lib.Mesh]: + return self._meshes + + def pack(self, tensors: Sequence[Any], layout: layout_lib.Layout) -> Any: + """Packs tensors into a DTensor handle on this DTensor device. + + Packing and unpacking are inverse operations: + + ``` + * unpack(pack(tensors)) == tensors + * pack(unpack(dtensor)) == dtensor + ``` + + Refer to `dtensor.pack` for more information. + + Args: + tensors: The list of tensors to pack into a DTensor. + layout: The layout of the DTensor to be created. + + Returns: + A DTensor created from the individual component tensors. + + Raises: + RuntimeError: When not called eagerly. + """ + if not context.executing_eagerly(): + raise RuntimeError("`pack` must be called eagerly.") + self._register_mesh(layout.mesh) + with ops.device(self.name): + if all(isinstance(t, sparse_tensor.SparseTensor) for t in tensors): + if not all(t.shape == tensors[0].shape for t in tensors): + raise TypeError("All input SparseTensors to Pack must be same shape.") + is_sparse = True + tensors = [t.indices for t in tensors] + [t.values for t in tensors] + [ + ops.convert_to_tensor(t.shape, dtype=dtypes.int64) for t in tensors + ] + elif any(isinstance(t, sparse_tensor.SparseTensor) for t in tensors): + raise TypeError("Cannot Pack SparseTensors with Tensors.") + else: + is_sparse = False + try: + return _pywrap_dtensor_device.Pack( + context.context()._handle, # pylint: disable=protected-access + tensors, + layout.to_string(), + self._device_info, + is_sparse) + except core._NotOkStatusException as e: # pylint: disable=protected-access + raise core._status_to_exception(e) from None # pylint: disable=protected-access + + def unpack(self, dtensor: Any) -> Sequence[Any]: + """Unpacks a DTensor handle on this DTensor device. + + Packing and unpacking are inverse operations: + + ``` + * unpack(pack(tensors)) == tensors + * pack(unpack(dtensor)) == dtensor + ``` + + Refer to `dtensor.unpack` for more information. + + Args: + dtensor: The DTensor to unpack. + + Returns: + The raw underlying tensor components of the DTensor. + + Raises: + RuntimeError: When not called eagerly. + """ + if not context.executing_eagerly(): + raise RuntimeError("`unpack` must be called eagerly.") + try: + tensors = _pywrap_dtensor_device.Unpack( + context.context()._handle, # pylint: disable=protected-access + dtensor, + self._device_info) + except core._NotOkStatusException as e: # pylint: disable=protected-access + raise core._status_to_exception(e) from None # pylint: disable=protected-access + + is_sparse = _pywrap_dtensor_device.IsSparseDTensor( + context.context()._handle, # pylint: disable=protected-access. + dtensor, + self._device_info) + if is_sparse: + result = [] + for i in range(len(tensors) // 3): + result.append( + sparse_tensor.SparseTensor(tensors[i], + tensors[i + len(tensors) // 3], + tensors[i + 2 * len(tensors) // 3])) + return result + else: + return tensors + + def fetch_layout(self, dtensor: Any) -> layout_lib.Layout: + """Fetches the layout of the DTensor. + + Args: + dtensor: The DTensor whose layout is to be fetched. + + Returns: + The `Layout` of this DTensor. + + Raises: + RuntimeError: When not called eagerly. + """ + if not context.executing_eagerly(): + raise RuntimeError("`fetch_layout` must be called eagerly.") + if _pywrap_utils.IsVariable(dtensor): + dtensor = dtensor.read_value() + try: + layout_string = _pywrap_dtensor_device.FetchLayout( + context.context()._handle, # pylint: disable=protected-access + dtensor, + self._device_info) + except core._NotOkStatusException as e: # pylint: disable=protected-access + raise core._status_to_exception(e) from None # pylint: disable=protected-access + + if layout_string is None: + return None + return layout_lib.Layout.from_string(layout_string) + + def is_dtensor(self, tensor: Any) -> bool: + """Check whether the input tensor is a DTensor. + + In Python, a DTensor has the same type as a `tf.Tensor`. This method will + let you check and handle the tensor differently if a tf.Tensor is a DTensor. + + Args: + tensor: an object to be checked. + + Returns: + bool, True if the given tensor is a DTensor. + + Raises: + RuntimeError: When not called eagerly. + """ + if not context.executing_eagerly(): + raise RuntimeError("`is_dtensor` must be called eagerly.") + if not tensor_util.is_tensor(tensor): + return False + if _pywrap_utils.IsVariable(tensor): + tensor = tensor._handle # pylint: disable=protected-access + return _pywrap_dtensor_device.IsDTensor( + context.context()._handle, # pylint: disable=protected-access + tensor, + self._device_info, + ) + + def set_tpu_core_ids(self, mesh_name, tpu_core_ids): + """Sets the singleton global device ID-to-physical core ID map. + + Args: + mesh_name: The name of a mesh. If empty, set the default mapping. + tpu_core_ids: TPU core IDs sorted by TF task/device ordinal. + """ + _pywrap_dtensor_device.SetTPUCoreIDs(self._device_info, mesh_name, + tpu_core_ids) + + def clear_tpu_core_ids(self): + _pywrap_dtensor_device.ClearTPUCoreIDs(self._device_info) + + def tpu_core_ids_to_locations(self, tpu_core_ids): + """Translates TPU core IDs to TPU core locations. + + Args: + tpu_core_ids: A list of TPU core IDs. Each one is an unsigned integer. + + Returns: + A list of corresponding TPU core locations. + """ + return _pywrap_dtensor_device.TPUCoreIDsToLocations( + context.context()._handle, # pylint: disable=protected-access + self._device_info, + tpu_core_ids) + + def tpu_core_locations_to_ids(self, tpu_core_locations): + """Translates TPU core locations to TPU core IDs. + + Args: + tpu_core_locations: A list of TPU core locations. Each one is a list of + four unsigned integers, [x, y, z, core]. + + Returns: + A list of corresponding TPU core IDs. + """ + return _pywrap_dtensor_device.TPUCoreLocationsToIDs( + context.context()._handle, # pylint: disable=protected-access + self._device_info, + tpu_core_locations) + + def _get_stats(self): + """Returns the number of cache hit and miss for function compilation. + + Returns: + A dictionary. + 'miss': number of cache misses; + 'hit': number of cache hits; and + 'size': size of cache; + miss count. + """ + return _pywrap_dtensor_device.GetStats( + context.context()._handle, # pylint: disable=protected-access, + self._device_info, + ) + + def set_iterator_element_layouts(self, iterator_resource_dtensor, + layouts: List[layout_lib.Layout]): + """Sets the element layouts on an iterator resource tensor. + + Args: + iterator_resource_dtensor: a DTensor created by packing the individiual + iterator resource tensors. + layouts: the flattened list of layouts to be applied to the elements + emitted by the iterator resource DTensor. + """ + _pywrap_dtensor_device.SetIteratorElementLayouts( + context.context()._handle, # pylint: disable=protected-access + iterator_resource_dtensor, + [layout.to_string() for layout in layouts], + self._device_info) + + @contextlib.contextmanager + def _experimental_default_mesh(self, mesh: layout_lib.Mesh): + """Sets a default mesh for all ops in the scope. + + Note: This is an internal helper method, which is not user facing api. + + Useful for requesting a specific mesh for ops which would have no inferred + layout, e.g. tf.zeros. + + Args: + mesh: A Mesh to be used for ops without Mesh. + + Yields: + Nothing. + """ + previous_default = self._current_default_mesh + self._register_mesh(mesh) + _pywrap_dtensor_device.ExperimentalSetDefaultMesh( + self._device_info, + mesh.to_string().encode("utf-8")) + self._current_default_mesh = mesh + yield + _pywrap_dtensor_device.ExperimentalClearDefaultMesh(self._device_info) + if previous_default: + _pywrap_dtensor_device.ExperimentalSetDefaultMesh( + self._device_info, + previous_default.to_string().encode("utf-8")) + self._current_default_mesh = previous_default + + @contextlib.contextmanager + def _default_layout(self, layout: layout_lib.Layout): + """Sets a default output layout for all ops in the scope. + + Note: This is an internal helper method, which is not user facing api. + + Useful for requesting a specific layout for ops which would have no inferred + layout, e.g. tf.zeros. + + Caveats: + + - Currently only affects the first output of an op. For Op with multiple + outputs, this does not support yet. + + - All Ops in the scope will be attached with the same layout. This might not + be valid as the rank is different. The current suggestion is: Try to wrap + the raw op wheneven possible. + + Args: + layout: A Layout for the outputs of all operations in this scope. + + Yields: + Nothing. + """ + previous_default = None + previous_graph_size = None + graph = None + + self._register_mesh(layout.mesh) + try: + previous_default = self._current_output_layout + self._current_output_layout = layout.to_string().encode("utf-8") + _pywrap_dtensor_device.ExperimentalSetDefaultLayout( + self._device_info, self._current_output_layout) + if context.executing_eagerly(): + with ops.device(self.name): + yield + else: + # Custom devices currently don't affect graph building, so we need a + # separate way to indicate layouts. + # + # TODO(allenl): Remove this case once the DTensor device is active + # during tracing. + graph = ops.get_default_graph() + previous_graph_size = len(graph.get_operations()) + yield + finally: + if graph is not None: + # Tag operations added under this scope + for operation in graph.get_operations()[previous_graph_size:]: + # Set layout directly on the Op itself. + operation._set_attr( # pylint: disable=protected-access + "_layout", + attr_value_pb2.AttrValue( + list=attr_value_pb2.AttrValue.ListValue( + s=[self._current_output_layout]))) + operation._set_attr( # pylint: disable=protected-access + "_mesh", + attr_value_pb2.AttrValue( + s=layout.mesh.to_string().encode("utf-8"))) + + self._current_output_layout = previous_default + if self._current_output_layout is None: + _pywrap_dtensor_device.ExperimentalClearDefaultLayout(self._device_info) + else: + _pywrap_dtensor_device.ExperimentalSetDefaultLayout( + self._device_info, self._current_output_layout.decode("utf-8")) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/gen_dtensor_ops.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/gen_dtensor_ops.py new file mode 100644 index 0000000000000000000000000000000000000000..adae6de33ef18549f27f8c90b689001d085fd942 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/gen_dtensor_ops.py @@ -0,0 +1,763 @@ +"""Python wrappers around TensorFlow ops. + +This file is MACHINE GENERATED! Do not edit. +""" + +import collections + +from tensorflow.python import pywrap_tfe as pywrap_tfe +from tensorflow.python.eager import context as _context +from tensorflow.python.eager import core as _core +from tensorflow.python.eager import execute as _execute +from tensorflow.python.framework import dtypes as _dtypes +from tensorflow.security.fuzzing.py import annotation_types as _atypes + +from tensorflow.python.framework import op_def_registry as _op_def_registry +from tensorflow.python.framework import ops as _ops +from tensorflow.python.framework import op_def_library as _op_def_library +from tensorflow.python.util.deprecation import deprecated_endpoints +from tensorflow.python.util import dispatch as _dispatch +from tensorflow.python.util.tf_export import tf_export + +from typing import TypeVar, List, Any +from typing_extensions import Annotated + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('configure_and_initialize_global_tpu') +def configure_and_initialize_global_tpu(use_tfrt_host_runtime:bool=True, name=None) -> Annotated[Any, _atypes.Int32]: + r"""TODO: add doc. + + Args: + use_tfrt_host_runtime: An optional `bool`. Defaults to `True`. + name: A name for the operation (optional). + + Returns: + A `Tensor` of type `int32`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "ConfigureAndInitializeGlobalTPU", name, + "use_tfrt_host_runtime", use_tfrt_host_runtime) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_configure_and_initialize_global_tpu( + (use_tfrt_host_runtime, name,), None) + if _result is not NotImplemented: + return _result + return configure_and_initialize_global_tpu_eager_fallback( + use_tfrt_host_runtime=use_tfrt_host_runtime, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + configure_and_initialize_global_tpu, (), dict(use_tfrt_host_runtime=use_tfrt_host_runtime, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_configure_and_initialize_global_tpu( + (use_tfrt_host_runtime, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + if use_tfrt_host_runtime is None: + use_tfrt_host_runtime = True + use_tfrt_host_runtime = _execute.make_bool(use_tfrt_host_runtime, "use_tfrt_host_runtime") + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "ConfigureAndInitializeGlobalTPU", use_tfrt_host_runtime=use_tfrt_host_runtime, + name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + configure_and_initialize_global_tpu, (), dict(use_tfrt_host_runtime=use_tfrt_host_runtime, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("use_tfrt_host_runtime", + _op._get_attr_bool("use_tfrt_host_runtime")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "ConfigureAndInitializeGlobalTPU", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +ConfigureAndInitializeGlobalTPU = tf_export("raw_ops.ConfigureAndInitializeGlobalTPU")(_ops.to_raw_op(configure_and_initialize_global_tpu)) +_dispatcher_for_configure_and_initialize_global_tpu = configure_and_initialize_global_tpu._tf_type_based_dispatcher.Dispatch + + +def configure_and_initialize_global_tpu_eager_fallback(use_tfrt_host_runtime: bool, name, ctx) -> Annotated[Any, _atypes.Int32]: + if use_tfrt_host_runtime is None: + use_tfrt_host_runtime = True + use_tfrt_host_runtime = _execute.make_bool(use_tfrt_host_runtime, "use_tfrt_host_runtime") + _inputs_flat = [] + _attrs = ("use_tfrt_host_runtime", use_tfrt_host_runtime) + _result = _execute.execute(b"ConfigureAndInitializeGlobalTPU", 1, + inputs=_inputs_flat, attrs=_attrs, ctx=ctx, + name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "ConfigureAndInitializeGlobalTPU", _inputs_flat, _attrs, _result) + _result, = _result + return _result + + +TV_CopyToMesh_T = TypeVar("TV_CopyToMesh_T", _atypes.BFloat16, _atypes.Bool, _atypes.Complex128, _atypes.Complex64, _atypes.Float16, _atypes.Float32, _atypes.Float64, _atypes.Float8e4m3fn, _atypes.Float8e5m2, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int4, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.Resource, _atypes.String, _atypes.UInt16, _atypes.UInt32, _atypes.UInt4, _atypes.UInt64, _atypes.UInt8, _atypes.Variant) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('copy_to_mesh') +def copy_to_mesh(input: Annotated[Any, TV_CopyToMesh_T], mesh: str, name=None) -> Annotated[Any, TV_CopyToMesh_T]: + r"""TODO: add doc. + + Args: + input: A `Tensor`. + mesh: A `string`. + name: A name for the operation (optional). + + Returns: + A `Tensor`. Has the same type as `input`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "CopyToMesh", name, input, "mesh", mesh) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_copy_to_mesh( + (input, mesh, name,), None) + if _result is not NotImplemented: + return _result + return copy_to_mesh_eager_fallback( + input, mesh=mesh, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + copy_to_mesh, (), dict(input=input, mesh=mesh, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_copy_to_mesh( + (input, mesh, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + mesh = _execute.make_str(mesh, "mesh") + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "CopyToMesh", input=input, mesh=mesh, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + copy_to_mesh, (), dict(input=input, mesh=mesh, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("mesh", _op.get_attr("mesh"), "T", _op._get_attr_type("T")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "CopyToMesh", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +CopyToMesh = tf_export("raw_ops.CopyToMesh")(_ops.to_raw_op(copy_to_mesh)) +_dispatcher_for_copy_to_mesh = copy_to_mesh._tf_type_based_dispatcher.Dispatch + + +def copy_to_mesh_eager_fallback(input: Annotated[Any, TV_CopyToMesh_T], mesh: str, name, ctx) -> Annotated[Any, TV_CopyToMesh_T]: + mesh = _execute.make_str(mesh, "mesh") + _attr_T, (input,) = _execute.args_to_matching_eager([input], ctx, []) + _inputs_flat = [input] + _attrs = ("mesh", mesh, "T", _attr_T) + _result = _execute.execute(b"CopyToMesh", 1, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "CopyToMesh", _inputs_flat, _attrs, _result) + _result, = _result + return _result + + +TV_CopyToMeshGrad_T = TypeVar("TV_CopyToMeshGrad_T", _atypes.BFloat16, _atypes.Bool, _atypes.Complex128, _atypes.Complex64, _atypes.Float16, _atypes.Float32, _atypes.Float64, _atypes.Float8e4m3fn, _atypes.Float8e5m2, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int4, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.Resource, _atypes.String, _atypes.UInt16, _atypes.UInt32, _atypes.UInt4, _atypes.UInt64, _atypes.UInt8, _atypes.Variant) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('copy_to_mesh_grad') +def copy_to_mesh_grad(input: Annotated[Any, TV_CopyToMeshGrad_T], forward_input: Annotated[Any, TV_CopyToMeshGrad_T], name=None) -> Annotated[Any, TV_CopyToMeshGrad_T]: + r"""TODO: add doc. + + Args: + input: A `Tensor`. + forward_input: A `Tensor`. Must have the same type as `input`. + name: A name for the operation (optional). + + Returns: + A `Tensor`. Has the same type as `input`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "CopyToMeshGrad", name, input, forward_input) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_copy_to_mesh_grad( + (input, forward_input, name,), None) + if _result is not NotImplemented: + return _result + return copy_to_mesh_grad_eager_fallback( + input, forward_input, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + copy_to_mesh_grad, (), dict(input=input, + forward_input=forward_input, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_copy_to_mesh_grad( + (input, forward_input, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "CopyToMeshGrad", input=input, forward_input=forward_input, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + copy_to_mesh_grad, (), dict(input=input, + forward_input=forward_input, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("T", _op._get_attr_type("T")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "CopyToMeshGrad", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +CopyToMeshGrad = tf_export("raw_ops.CopyToMeshGrad")(_ops.to_raw_op(copy_to_mesh_grad)) +_dispatcher_for_copy_to_mesh_grad = copy_to_mesh_grad._tf_type_based_dispatcher.Dispatch + + +def copy_to_mesh_grad_eager_fallback(input: Annotated[Any, TV_CopyToMeshGrad_T], forward_input: Annotated[Any, TV_CopyToMeshGrad_T], name, ctx) -> Annotated[Any, TV_CopyToMeshGrad_T]: + _attr_T, _inputs_T = _execute.args_to_matching_eager([input, forward_input], ctx, []) + (input, forward_input) = _inputs_T + _inputs_flat = [input, forward_input] + _attrs = ("T", _attr_T) + _result = _execute.execute(b"CopyToMeshGrad", 1, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "CopyToMeshGrad", _inputs_flat, _attrs, _result) + _result, = _result + return _result + + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('d_tensor_restore_v2') +def d_tensor_restore_v2(prefix: Annotated[Any, _atypes.String], tensor_names: Annotated[Any, _atypes.String], shape_and_slices: Annotated[Any, _atypes.String], input_shapes, input_layouts, dtypes, name=None): + r"""TODO: add doc. + + Args: + prefix: A `Tensor` of type `string`. + tensor_names: A `Tensor` of type `string`. + shape_and_slices: A `Tensor` of type `string`. + input_shapes: A list of shapes (each a `tf.TensorShape` or list of `ints`). + input_layouts: A list of `strings`. + dtypes: A list of `tf.DTypes` that has length `>= 1`. + name: A name for the operation (optional). + + Returns: + A list of `Tensor` objects of type `dtypes`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "DTensorRestoreV2", name, prefix, tensor_names, + shape_and_slices, "input_shapes", input_shapes, "input_layouts", + input_layouts, "dtypes", dtypes) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_d_tensor_restore_v2( + (prefix, tensor_names, shape_and_slices, input_shapes, + input_layouts, dtypes, name,), None) + if _result is not NotImplemented: + return _result + return d_tensor_restore_v2_eager_fallback( + prefix, tensor_names, shape_and_slices, input_shapes=input_shapes, + input_layouts=input_layouts, dtypes=dtypes, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + d_tensor_restore_v2, (), dict(prefix=prefix, + tensor_names=tensor_names, + shape_and_slices=shape_and_slices, + input_shapes=input_shapes, + input_layouts=input_layouts, + dtypes=dtypes, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_d_tensor_restore_v2( + (prefix, tensor_names, shape_and_slices, input_shapes, input_layouts, + dtypes, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + if not isinstance(input_shapes, (list, tuple)): + raise TypeError( + "Expected list for 'input_shapes' argument to " + "'d_tensor_restore_v2' Op, not %r." % input_shapes) + input_shapes = [_execute.make_shape(_s, "input_shapes") for _s in input_shapes] + if not isinstance(input_layouts, (list, tuple)): + raise TypeError( + "Expected list for 'input_layouts' argument to " + "'d_tensor_restore_v2' Op, not %r." % input_layouts) + input_layouts = [_execute.make_str(_s, "input_layouts") for _s in input_layouts] + if not isinstance(dtypes, (list, tuple)): + raise TypeError( + "Expected list for 'dtypes' argument to " + "'d_tensor_restore_v2' Op, not %r." % dtypes) + dtypes = [_execute.make_type(_t, "dtypes") for _t in dtypes] + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "DTensorRestoreV2", prefix=prefix, tensor_names=tensor_names, + shape_and_slices=shape_and_slices, + input_shapes=input_shapes, + input_layouts=input_layouts, dtypes=dtypes, + name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + d_tensor_restore_v2, (), dict(prefix=prefix, + tensor_names=tensor_names, + shape_and_slices=shape_and_slices, + input_shapes=input_shapes, + input_layouts=input_layouts, + dtypes=dtypes, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if not _result: + return _op + if _execute.must_record_gradient(): + _attrs = ("input_shapes", _op.get_attr("input_shapes"), "input_layouts", + _op.get_attr("input_layouts"), "dtypes", _op.get_attr("dtypes")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "DTensorRestoreV2", _inputs_flat, _attrs, _result) + return _result + +DTensorRestoreV2 = tf_export("raw_ops.DTensorRestoreV2")(_ops.to_raw_op(d_tensor_restore_v2)) +_dispatcher_for_d_tensor_restore_v2 = d_tensor_restore_v2._tf_type_based_dispatcher.Dispatch + + +def d_tensor_restore_v2_eager_fallback(prefix: Annotated[Any, _atypes.String], tensor_names: Annotated[Any, _atypes.String], shape_and_slices: Annotated[Any, _atypes.String], input_shapes, input_layouts, dtypes, name, ctx): + if not isinstance(input_shapes, (list, tuple)): + raise TypeError( + "Expected list for 'input_shapes' argument to " + "'d_tensor_restore_v2' Op, not %r." % input_shapes) + input_shapes = [_execute.make_shape(_s, "input_shapes") for _s in input_shapes] + if not isinstance(input_layouts, (list, tuple)): + raise TypeError( + "Expected list for 'input_layouts' argument to " + "'d_tensor_restore_v2' Op, not %r." % input_layouts) + input_layouts = [_execute.make_str(_s, "input_layouts") for _s in input_layouts] + if not isinstance(dtypes, (list, tuple)): + raise TypeError( + "Expected list for 'dtypes' argument to " + "'d_tensor_restore_v2' Op, not %r." % dtypes) + dtypes = [_execute.make_type(_t, "dtypes") for _t in dtypes] + prefix = _ops.convert_to_tensor(prefix, _dtypes.string) + tensor_names = _ops.convert_to_tensor(tensor_names, _dtypes.string) + shape_and_slices = _ops.convert_to_tensor(shape_and_slices, _dtypes.string) + _inputs_flat = [prefix, tensor_names, shape_and_slices] + _attrs = ("input_shapes", input_shapes, "input_layouts", input_layouts, + "dtypes", dtypes) + _result = _execute.execute(b"DTensorRestoreV2", len(dtypes), + inputs=_inputs_flat, attrs=_attrs, ctx=ctx, + name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "DTensorRestoreV2", _inputs_flat, _attrs, _result) + return _result + + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('d_tensor_set_global_tpu_array') +def d_tensor_set_global_tpu_array(topology: Annotated[Any, _atypes.String], name=None): + r"""TODO: add doc. + + Args: + topology: A `Tensor` of type `string`. + name: A name for the operation (optional). + + Returns: + The created Operation. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "DTensorSetGlobalTPUArray", name, topology) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_d_tensor_set_global_tpu_array( + (topology, name,), None) + if _result is not NotImplemented: + return _result + return d_tensor_set_global_tpu_array_eager_fallback( + topology, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + d_tensor_set_global_tpu_array, (), dict(topology=topology, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_d_tensor_set_global_tpu_array( + (topology, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "DTensorSetGlobalTPUArray", topology=topology, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + d_tensor_set_global_tpu_array, (), dict(topology=topology, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + return _op +DTensorSetGlobalTPUArray = tf_export("raw_ops.DTensorSetGlobalTPUArray")(_ops.to_raw_op(d_tensor_set_global_tpu_array)) +_dispatcher_for_d_tensor_set_global_tpu_array = d_tensor_set_global_tpu_array._tf_type_based_dispatcher.Dispatch + + +def d_tensor_set_global_tpu_array_eager_fallback(topology: Annotated[Any, _atypes.String], name, ctx): + topology = _ops.convert_to_tensor(topology, _dtypes.string) + _inputs_flat = [topology] + _attrs = None + _result = _execute.execute(b"DTensorSetGlobalTPUArray", 0, + inputs=_inputs_flat, attrs=_attrs, ctx=ctx, + name=name) + _result = None + return _result + + +TV_Relayout_T = TypeVar("TV_Relayout_T", _atypes.BFloat16, _atypes.Bool, _atypes.Complex128, _atypes.Complex64, _atypes.Float16, _atypes.Float32, _atypes.Float64, _atypes.Float8e4m3fn, _atypes.Float8e5m2, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int4, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.Resource, _atypes.String, _atypes.UInt16, _atypes.UInt32, _atypes.UInt4, _atypes.UInt64, _atypes.UInt8, _atypes.Variant) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('relayout') +def relayout(input: Annotated[Any, TV_Relayout_T], layout: str, name=None) -> Annotated[Any, TV_Relayout_T]: + r"""TODO: add doc. + + Args: + input: A `Tensor`. + layout: A `string`. + name: A name for the operation (optional). + + Returns: + A `Tensor`. Has the same type as `input`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "Relayout", name, input, "layout", layout) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_relayout( + (input, layout, name,), None) + if _result is not NotImplemented: + return _result + return relayout_eager_fallback( + input, layout=layout, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + relayout, (), dict(input=input, layout=layout, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_relayout( + (input, layout, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + layout = _execute.make_str(layout, "layout") + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "Relayout", input=input, layout=layout, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + relayout, (), dict(input=input, layout=layout, name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("layout", _op.get_attr("layout"), "T", _op._get_attr_type("T")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "Relayout", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +Relayout = tf_export("raw_ops.Relayout")(_ops.to_raw_op(relayout)) +_dispatcher_for_relayout = relayout._tf_type_based_dispatcher.Dispatch + + +def relayout_eager_fallback(input: Annotated[Any, TV_Relayout_T], layout: str, name, ctx) -> Annotated[Any, TV_Relayout_T]: + layout = _execute.make_str(layout, "layout") + _attr_T, (input,) = _execute.args_to_matching_eager([input], ctx, []) + _inputs_flat = [input] + _attrs = ("layout", layout, "T", _attr_T) + _result = _execute.execute(b"Relayout", 1, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "Relayout", _inputs_flat, _attrs, _result) + _result, = _result + return _result + + +TV_RelayoutLike_T = TypeVar("TV_RelayoutLike_T", _atypes.BFloat16, _atypes.Bool, _atypes.Complex128, _atypes.Complex64, _atypes.Float16, _atypes.Float32, _atypes.Float64, _atypes.Float8e4m3fn, _atypes.Float8e5m2, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int4, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.Resource, _atypes.String, _atypes.UInt16, _atypes.UInt32, _atypes.UInt4, _atypes.UInt64, _atypes.UInt8, _atypes.Variant) +TV_RelayoutLike_U = TypeVar("TV_RelayoutLike_U", _atypes.BFloat16, _atypes.Bool, _atypes.Complex128, _atypes.Complex64, _atypes.Float16, _atypes.Float32, _atypes.Float64, _atypes.Float8e4m3fn, _atypes.Float8e5m2, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int4, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.Resource, _atypes.String, _atypes.UInt16, _atypes.UInt32, _atypes.UInt4, _atypes.UInt64, _atypes.UInt8, _atypes.Variant) + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('relayout_like') +def relayout_like(input: Annotated[Any, TV_RelayoutLike_T], layout_input: Annotated[Any, TV_RelayoutLike_U], name=None) -> Annotated[Any, TV_RelayoutLike_T]: + r"""TODO: add doc. + + Args: + input: A `Tensor`. + layout_input: A `Tensor`. + name: A name for the operation (optional). + + Returns: + A `Tensor`. Has the same type as `input`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "RelayoutLike", name, input, layout_input) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_relayout_like( + (input, layout_input, name,), None) + if _result is not NotImplemented: + return _result + return relayout_like_eager_fallback( + input, layout_input, name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + relayout_like, (), dict(input=input, layout_input=layout_input, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_relayout_like( + (input, layout_input, name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "RelayoutLike", input=input, layout_input=layout_input, name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + relayout_like, (), dict(input=input, layout_input=layout_input, + name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = ("T", _op._get_attr_type("T"), "U", _op._get_attr_type("U")) + _inputs_flat = _op.inputs + _execute.record_gradient( + "RelayoutLike", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +RelayoutLike = tf_export("raw_ops.RelayoutLike")(_ops.to_raw_op(relayout_like)) +_dispatcher_for_relayout_like = relayout_like._tf_type_based_dispatcher.Dispatch + + +def relayout_like_eager_fallback(input: Annotated[Any, TV_RelayoutLike_T], layout_input: Annotated[Any, TV_RelayoutLike_U], name, ctx) -> Annotated[Any, TV_RelayoutLike_T]: + _attr_T, (input,) = _execute.args_to_matching_eager([input], ctx, []) + _attr_U, (layout_input,) = _execute.args_to_matching_eager([layout_input], ctx, []) + _inputs_flat = [input, layout_input] + _attrs = ("T", _attr_T, "U", _attr_U) + _result = _execute.execute(b"RelayoutLike", 1, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "RelayoutLike", _inputs_flat, _attrs, _result) + _result, = _result + return _result + + +@_dispatch.add_fallback_dispatch_list +@_dispatch.add_type_based_api_dispatcher +@tf_export('shutdown_tpu_system') +def shutdown_tpu_system(name=None) -> Annotated[Any, _atypes.Bool]: + r"""TODO: add doc. + + Args: + name: A name for the operation (optional). + + Returns: + A `Tensor` of type `bool`. + """ + _ctx = _context._context or _context.context() + tld = _ctx._thread_local_data + if tld.is_eager: + try: + _result = pywrap_tfe.TFE_Py_FastPathExecute( + _ctx, "ShutdownTPUSystem", name) + return _result + except _core._NotOkStatusException as e: + _ops.raise_from_not_ok_status(e, name) + except _core._FallbackException: + pass + try: + _result = _dispatcher_for_shutdown_tpu_system( + (name,), None) + if _result is not NotImplemented: + return _result + return shutdown_tpu_system_eager_fallback( + name=name, ctx=_ctx) + except _core._SymbolicException: + pass # Add nodes to the TensorFlow graph. + except (TypeError, ValueError): + _result = _dispatch.dispatch( + shutdown_tpu_system, (), dict(name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + else: + _result = _dispatcher_for_shutdown_tpu_system( + (name,), None) + if _result is not NotImplemented: + return _result + # Add nodes to the TensorFlow graph. + try: + _, _, _op, _outputs = _op_def_library._apply_op_helper( + "ShutdownTPUSystem", name=name) + except (TypeError, ValueError): + _result = _dispatch.dispatch( + shutdown_tpu_system, (), dict(name=name) + ) + if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED: + return _result + raise + _result = _outputs[:] + if _execute.must_record_gradient(): + _attrs = () + _inputs_flat = _op.inputs + _execute.record_gradient( + "ShutdownTPUSystem", _inputs_flat, _attrs, _result) + _result, = _result + return _result + +ShutdownTPUSystem = tf_export("raw_ops.ShutdownTPUSystem")(_ops.to_raw_op(shutdown_tpu_system)) +_dispatcher_for_shutdown_tpu_system = shutdown_tpu_system._tf_type_based_dispatcher.Dispatch + + +def shutdown_tpu_system_eager_fallback(name, ctx) -> Annotated[Any, _atypes.Bool]: + _inputs_flat = [] + _attrs = None + _result = _execute.execute(b"ShutdownTPUSystem", 1, inputs=_inputs_flat, + attrs=_attrs, ctx=ctx, name=name) + if _execute.must_record_gradient(): + _execute.record_gradient( + "ShutdownTPUSystem", _inputs_flat, _attrs, _result) + _result, = _result + return _result + diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/input_util.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/input_util.py new file mode 100644 index 0000000000000000000000000000000000000000..280fcdabe7d08132ca1ff20c59937dd9d1cdaef1 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/input_util.py @@ -0,0 +1,666 @@ +# Copyright 2022 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. +# ============================================================================== +"""APIs to deal with input datasets efficiently in DTensor. + +When using tf.data with DTensor, the `DTensorDataset` API can be used to +efficiently handle loading the input data and correctly packing it to the +corresponding devices. This API is intended to work with unbatched data and can +be used for both data and model parallel setups. + +Example usage: + +>>> # 1-D mesh with 4 devices +>>> mesh = dtensor.Mesh(dim_names=['batch'], ...) +>>> layout = dtensor.Layout.batch_sharded(mesh, 'batch', rank=1) +>>> dataset = tf.data.Dataset.range(256) +>>> d_dataset = dtensor.DTensorDataset( +... dataset=dataset, +... global_batch_size=16, +... mesh=mesh, +... layouts=layout, +... batch_dim='batch') +>>> d_iter = iter(d_dataset) +>>> # Each batch is a length 16 tensor sharded across 4 devices +>>> batch_0_dtensor = next(d_iter) +>>> batch_0_dtensor + +>>> batch_1_dtensor = next(d_iter) +>>> batch_1_dtensor + + +For multi-client setups, `DTensorDataset` interacts with tf.data service to +correctly distribute the dataset among the participating clients. DTensor works +with tf.data service in co-located mode where each worker is running alongside +the DTensor client (the Tensorflow Python process). The `TFDataServiceConfig` +dataclass can be filled with information about the tf.data service cluster, and +passed to `DTensorDataset` to enable distribution. +""" + +import dataclasses +import operator + +from typing import Any, List, Optional, Sequence, Tuple + +from tensorflow.dtensor.python import api +from tensorflow.dtensor.python import config +from tensorflow.dtensor.python import layout as layout_lib +from tensorflow.python.data.experimental.ops import data_service_ops +from tensorflow.python.data.experimental.ops import distribute +from tensorflow.python.data.ops import dataset_ops +from tensorflow.python.data.ops import iterator_ops +from tensorflow.python.eager import context +from tensorflow.python.framework import constant_op +from tensorflow.python.framework import dtypes +from tensorflow.python.framework import errors +from tensorflow.python.framework import ops +from tensorflow.python.framework import tensor +from tensorflow.python.framework import tensor_shape +from tensorflow.python.framework import tensor_spec +from tensorflow.python.ops import array_ops +from tensorflow.python.ops import math_ops +from tensorflow.python.types import data as data_types +from tensorflow.python.util import nest +from tensorflow.python.util.tf_export import tf_export + + +@dataclasses.dataclass +class TFDataServiceConfig: + """Specifies the tf.data service configuration to use. + + Attributes: + dispatcher_address: a string specifying the address of the tf.data service + dispatcher server. + job_name: a non-empty string identifying the shared job that will be created + on tf.data service to process this dataset. + """ + dispatcher_address: str + job_name: str + + +# TODO(b/223275517): Add support for get_next_as_optional(). +class _DTensorIterator(iterator_ops.OwnedIterator): + """An iterator for a tf.data.Dataset distributed using DTensor. + + DTensorIterator encapsulates multiple underlying dataset iterators. It handles + retrieving the tensors to be placed on each underlying device and then uses + the 'pack' operation to create and return a DTensor. Thus users need only + interact with a single DTensorIterator to automatically distribute dataset + tensors onto devices. + """ + + def __init__( + self, + dtensor_components: Tuple[tensor.Tensor], + global_element_spec: tensor_spec.TensorSpec, + layouts: Any): + """Initializes a distributed iterator for DTensor datasets. + + This iterator encapsulates tf.data iterators for the underlying devices, and + treats it as a packed DTensor of iterator resource tensors. + + Args: + dtensor_components: a tuple containing the underlying iterator resources + packed into a DTensor. This is expected to be a tuple with a single + element. + global_element_spec: the underlying dataset's element spec from a global + view. + layouts: a structure of DTensor layouts to be applied to the elements + returned by the underlying iterators. This can be a single layout or + (possibly nested) tuples or dictionaries of layouts, and the structure + must match the structure of the iterator elements. + """ + # dtensor_components is expected to be a single-element tuple. + [self._iterator_resource_dtensor] = dtensor_components + self._global_element_spec = global_element_spec + self._layouts = layouts + self._layouts_str = nest.map_structure( + lambda layout: layout.to_string(), layouts) + + super().__init__( + components=dtensor_components, element_spec=global_element_spec) + + def __next__(self): + try: + # IteratorGetNext will return a DTensor on the host, so move it to the + # device mesh. If the dataset layouts are on the host mesh itself, this + # is handled by DTensor as a no-op. + host_elem = self._next_internal() + context.async_wait() + device_elem = nest.map_structure( + api.copy_to_mesh, host_elem, self._layouts) + context.async_wait() + return device_elem + except errors.OutOfRangeError as e: + # Match TF2 eager executor behavior by raising StopIteration when iterator + # is out of range. + if context.executing_eagerly(): + raise StopIteration from e + else: + raise e + + @property + def _type_spec(self): + return _DTensorIteratorSpec(self._global_element_spec, self._layouts_str) + + +class _DTensorIteratorSpec(iterator_ops.IteratorSpec): + """Type specification for `_DTensorIterator`.""" + + __slots__ = ['_global_element_spec', '_layouts_str'] + + def __init__( + self, global_element_spec: tensor_spec.TensorSpec, layouts_str: Any): + super().__init__(global_element_spec) + self._global_element_spec = global_element_spec + self._layouts_str = layouts_str + + @property + def value_type(self): + return _DTensorIterator + + def _serialize(self): + return (self._global_element_spec, self._layouts_str) + + @property + def _component_specs(self): + return (tensor_spec.TensorSpec([], dtypes.resource),) + + def _to_components(self, value): + return (value._iterator_resource_dtensor,) # pylint: disable=protected-access + + def _from_components(self, components): + layouts = nest.map_structure( + layout_lib.Layout.from_string, self._layouts_str) + return _DTensorIterator( + dtensor_components=components, + global_element_spec=self._global_element_spec, + layouts=layouts) + + @classmethod + def from_value(cls, value): + return cls(value._global_element_spec, value._layouts_str) # pylint: disable=protected-access + + +def _validate_input(flattened_layouts: Sequence[layout_lib.Layout], + flattened_elem_spec: Sequence[tensor_spec.TensorSpec], + dataset_already_batched: bool): + """Checks that the dataset's layouts and element specs are compatible. + + Args: + flattened_layouts: the flattened list of layouts used to distribute the + dataset. + flattened_elem_spec: the flattened list of element specs used in the + dataset's components. + dataset_already_batched: whether the dataset to be validated is already + batched. + + Raises: + ValueError: if the dataset's inputs are incompatible. + """ + if not flattened_elem_spec: + raise ValueError( + 'Expected input element spec of at least one element, was empty.') + + first_elem_shape = flattened_elem_spec[0].shape + + for layout, elem_spec in zip(flattened_layouts, flattened_elem_spec): + if elem_spec.shape.rank is None: + raise ValueError( + 'Dataset element shape must have a valid rank, got spec %s.' % + elem_spec) + + # Check that layout's rank matches the element's rank. If dataset is not yet + # batched, then the layout's rank must be one greater than the element's + # rank. + expected_rank = elem_spec.shape.rank + if not dataset_already_batched: + expected_rank += 1 + if layout.rank != expected_rank: + raise ValueError( + ('Expected layout with rank %d for element spec %s, got layout %s. ' + 'Check that the dataset is not batched before passing to ' + 'DTensorDataset.') % + (expected_rank, elem_spec, layout.sharding_specs)) + + if dataset_already_batched: + # Check that the batch dimension size of all dataset elements match. + batch_dim_size = first_elem_shape.as_list()[0] + if batch_dim_size is None: + raise ValueError( + ('Size of batch dimension of element spec %s is None. Ensure ' + 'drop_remainder=True when batching the dataset.') % elem_spec) + + if elem_spec.shape.as_list()[0] != batch_dim_size: + raise ValueError( + ('Size of batch dimension of element spec %s does not match ' + 'expected size %d.') % (elem_spec, batch_dim_size)) + + +def _shard_counts(layout: layout_lib.Layout, + batch_dim: Optional[str] = None) -> List[int]: + """Computes a list of the number of shards in each dimension of the layout. + + The shard counts are used to slice each dataset element. The batch dimension's + count is overridden to 1 since we only consider how many shards to make + locally (within each local replica). Sharding across clients is handled by + either tf.data.Dataset's shard transformation (in the single-client case) or + tf.data service's distribute function (in the multi-client case). + + Args: + layout: the layout to compute the shard counts for. + batch_dim: the name of the batch dimension of the layout, if present. + + Returns: + A list of shard counts, one element per dimension of the layout. + """ + shard_counts = [] + for spec in layout.sharding_specs: + if spec in (batch_dim, layout_lib.UNSHARDED): + shard_counts.append(1) + else: + shard_counts.append(layout.mesh.dim_size(spec)) + return shard_counts + + +def _index_matrix(layout: layout_lib.Layout, + elem_spec: tensor_spec.TensorSpec) -> tensor.Tensor: + """Computes a utility matrix to derive device-based slice offsets. + + This function builds a matrix of shape `[mesh.rank, layout.rank]` for each + dataset element. This matrix can be used to slice the DTensor components + returned by the iterator according to the local device that component is to be + placed on. This can be done by multiplying the device offsets of shape + `[1, mesh.rank]` with this index matrix to get a `[1, layout.rank]` shape + tensor containing the slice offsets. + + Note: the index on the batch dim is always 0 since sharding on the batch + dimension is handled by either tf.data.Dataset's shard transformation (in the + single-client case) or tf.data service's distribute function (in the + multi-client case). If there is no sharding on the batch dimension (or any + other dimension), the slice index remains 0. + + Args: + layout: the layout of the dataset element. + elem_spec: the spec of the dataset element. + + Returns: + The index matrix as a tensor. + """ + matrix = [] + for dim in layout.mesh.dim_names: + row = [0] + for layout_idx, spec in enumerate(layout.sharding_specs[1:]): + if spec == layout_lib.UNSHARDED or spec != dim: + row.append(0) + else: + row.append(elem_spec.shape[layout_idx] // layout.mesh.dim_size(dim)) + matrix.append(row) + + return constant_op.constant(matrix, dtype=dtypes.int32) + + +def _pack_iterator_resource_dtensor( + datasets: List[Tuple[int, data_types.DatasetV2]], + layouts: Any, + mesh: layout_lib.Mesh, + num_local_devices_per_replica: int): + """Creates a DTensor iterator resource for the per-replica datasets. + + Given a list of replica ID to tf.data.Dataset mappings, this function creates + iterators for each device and then packs the underlying iterator resource + tensors into a single DTensor. This resource tensor is used by the + IteratorGetNext op to retrieve the next element in the dataset. + + Args: + datasets: a list of tuples of each unique local replica ID to the dataset + object whose elements will be placed on the devices corresponding to that + replica. + layouts: a structure of DTensor layouts to be applied to the elements + returned by the underlying iterators. This can be a single layout or + (possibly nested) tuples or dictionaries of layouts, and the structure + must match the structure of the iterator elements. + mesh: the DTensor mesh to place the iterator batches on. + num_local_devices_per_replica: the number of devices in each data-parallel + replica. + + Returns: + A DTensor of the underlying iterator resource tensors. + """ + host_mesh_devices = mesh.host_mesh().local_devices() + device_idx = 0 + + iterators = [] + for _, dataset in datasets: + for idx in range(num_local_devices_per_replica): + with ops.device_v2(host_mesh_devices[device_idx]): + device_dataset = dataset.shard( + num_shards=num_local_devices_per_replica, index=idx) + iterators.append(iter(device_dataset)) + device_idx += 1 + + if device_idx != len(host_mesh_devices): + raise ValueError( + 'The `datasets` argument does not have the correct number of' + f' underlying datasets, found {device_idx} but expected' + f' {len(host_mesh_devices)}.') + + host_layouts = nest.map_structure( + lambda l: layout_lib.Layout(l.sharding_specs, mesh.host_mesh()), layouts) + + # Pack the iterator resource tensors into a replicated 0-dimensional DTensor + # and set the element layouts. + iterator_resources = [it._iterator_resource for it in iterators] # pylint: disable=protected-access + d_iterator_resource = api.pack( + iterator_resources, + layout_lib.Layout.replicated(mesh=mesh.host_mesh(), rank=0)) + api._dtensor_device().set_iterator_element_layouts( # pylint: disable=protected-access + d_iterator_resource, nest.flatten(host_layouts)) + + return d_iterator_resource + + +@tf_export('experimental.dtensor.DTensorDataset', v1=[]) +class DTensorDataset(dataset_ops.UnaryUnchangedStructureDataset): + """A dataset of DTensors. + + DTensorDataset encapsulates a `tf.data.Dataset` whose elements are + automatically packed and returned as DTensors based on a given mesh and + layouts. + """ + + def __init__(self, + dataset: data_types.DatasetV2, + *, + mesh: layout_lib.Mesh, + layouts: Any, + global_batch_size: int, + dataset_already_batched: bool = False, + batch_dim: Optional[str] = None, + prefetch: Optional[int] = None, + tf_data_service_config: Optional[TFDataServiceConfig] = None): + """Creates a DTensorDataset. + + DTensorDataset automatically handles distribution of the dataset elements to + each client's devices. It can be used to create an iterator that returns + DTensors of the input data on each iteration. + + DTensorDataset works best with unbatched datasets. It takes the mesh and the + provided layouts to automatically calculate how to batch the input locally + for each replica. + + If the provided dataset is already batched according to the per-replica + batch size, then `dataset_already_batched` must be set and DTensorDataset + will check that the batch size is consistent with the intended + `global_batch_size` using the layout information. Each replica receives a + separate slice of the global batch, thus the per-replica batch size can be + computed as the global batch size divided by the number of model replicas. + For a DTensor mesh, the number of replicas is equal to the size of the + mesh's batch dimension. + + Note: `tf.experimental.dtensor.DTensorDataset` instances do *not* implement + the full interface of `tf.data.Dataset`. It only supports two usages we will + mention below: iteration and `element_spec`. We don't support any other APIs + to transform or inspect the dataset. + + TODO(b/223275517): add support for input datasets that are already batched + to the global batch size. + + Args: + dataset: a `tf.data.Dataset` object. + mesh: the DTensor mesh to place the dataset batches on. + layouts: a structure of DTensor layouts to be applied to the input dataset + values. This can be a single layout or (possibly nested) tuples or + dictionaries of layouts, and the structure must match the structure of + the dataset. Either all or none of the layouts should be sharded on the + batch dimension; having only a subset of layouts batch sharded will not + work and raises a ValueError. + global_batch_size: the desired global batch size. + dataset_already_batched: must be set only if the dataset is already + batched to the per-replica batch size. The batched dataset must have + `drop_remainder=True` set since DTensor requires static shapes for + slicing the input tensors. + batch_dim: the mesh dimension on which the input's batch dimension is + sharded. Set to None if the input layouts do not shard on the batch + dimension. + prefetch: number of batches to prefetch using Dataset.prefetch. + tf_data_service_config: if operating in multi-client mode, this config + specifies the tf.data service configuration to use. + + Raises: + ValueError: on any of the following situations, + 1. if the structures and ranks of layouts and the dataset do not match. + 2. if the shapes in the dataset's spec are not fully defined. + 3. if batch_dim is specified and all layouts are not batch-sharded. + 4. if per_replica_batch_size is specified for an already batched Dataset + but it does not match the expected per-replica size based on the + provided mesh. + TypeError: if type of structures of layouts and the dataset do not match. + """ + super().__init__(dataset, dataset_ops.to_variant(dataset)) + + # TODO(b/271162918): fix multi-client use case. + if tf_data_service_config is not None: + raise NotImplementedError( + 'Multi-client DTensorDataset is currently not supported.' + ' Check b/271162918.') + + self._mesh = mesh + self._layouts = layouts + self._batch_dim = batch_dim + self._prefetch = prefetch + self._tf_data_service_config = tf_data_service_config + + nest.assert_same_structure(dataset.element_spec, layouts) + flattened_layouts = nest.flatten(layouts) + flattened_elem_spec = nest.flatten(dataset.element_spec) + + if batch_dim: + self.num_global_replicas = mesh.dim_size(batch_dim) + self._local_replica_ids = list( + dict.fromkeys( + [loc[batch_dim] for loc in mesh.local_device_locations()])) + + for layout in flattened_layouts: + if batch_dim != layout.sharding_specs[0]: + raise ValueError( + ('batch_dim %s was specified but at least one layout did not ' + 'contain it: %s') % (batch_dim, layout)) + else: + # Only one replica since there is no sharding on the batch dimension. + self.num_global_replicas = 1 + self._local_replica_ids = [0] + + # Validate layout and element spec compatibility, and raise ValueError if + # invalid. + _validate_input( + flattened_layouts, + flattened_elem_spec, + dataset_already_batched=dataset_already_batched) + + expected_batch_size = global_batch_size // self.num_global_replicas + if not dataset_already_batched: + self._batched_dataset = dataset.batch( + expected_batch_size, drop_remainder=True) + else: + per_replica_batch_size = flattened_elem_spec[0].shape.as_list()[0] + if per_replica_batch_size != expected_batch_size: + raise ValueError( + ('per_replica_batch_size does not matched expected size based on ' + 'the mesh, got %d but expected %d.') % + (per_replica_batch_size, expected_batch_size)) + self._batched_dataset = dataset + + # Construct a global element spec of the dataset. + flattened_global_elem_spec = [] + batch_tensor_shape = tensor_shape.as_shape([global_batch_size]) + for elem_spec in nest.flatten(self._batched_dataset.element_spec): + new_elem_spec = tensor_spec.TensorSpec( + shape=operator.concat(batch_tensor_shape, elem_spec.shape[1:]), + dtype=elem_spec.dtype, + name=elem_spec.name) + flattened_global_elem_spec.append(new_elem_spec) + self._global_element_spec = nest.pack_sequence_as( + dataset.element_spec, flattened_global_elem_spec) + + num_global_devices_per_replica = config.num_global_devices( + mesh.device_type()) // self.num_global_replicas + self._num_local_replicas = len(self._local_replica_ids) + self._num_local_devices_per_replica = mesh.num_local_devices( + ) // self._num_local_replicas + # The number of clients each replica is split over. + self._num_clients_per_replica = ( + num_global_devices_per_replica // self._num_local_devices_per_replica) + # In the case where a replica is split across multiple clients, an offset + # needs to be added to the index used by the partitioning logic such that + # the local devices on that client can be correctly matched to slices of the + # input tensor(s). If replicas are wholly contained within a client, then + # this offset is always 0. + self._partition_offset = (config.client_id() % self._num_clients_per_replica + ) * self._num_local_devices_per_replica + + # Helper data structures used in partitioning the dataset tensors. + self._all_shard_counts = [ + _shard_counts(layout, batch_dim) for layout in flattened_layouts + ] + self._index_matrices = [ + _index_matrix(layout, elem_spec) + for layout, elem_spec in zip(flattened_layouts, flattened_elem_spec) + ] + + def __iter__(self): + datasets: List[Tuple[int, data_types.DatasetV2]] = [] + + # Start with the batched the dataset. + local_dataset = self._batched_dataset + + if self._batch_dim is not None: + if self._num_clients_per_replica > 1: + # If a replica is split over multiple clients then each batch needs to + # be repeated before distribution as many times as there are clients + # corresponding to that replica. + local_dataset = self._repeat_batch(local_dataset, + self._num_clients_per_replica) + sharding_policy = data_service_ops.ShardingPolicy.DATA + else: + # Replicas are unique to each client, so FILE based sharding can be used + # which is more performant since each worker does not need to read the + # entire dataset. + sharding_policy = data_service_ops.ShardingPolicy.FILE + else: + # No batch dimension sharding specified so disable dataset sharding during + # the distribute step. + sharding_policy = data_service_ops.ShardingPolicy.OFF + + # Apply distribution here (if specified) so all remaining transformations + # are executed locally. + if self._tf_data_service_config is not None: + local_dataset = local_dataset.apply( + data_service_ops.distribute( + processing_mode=sharding_policy, + service=self._tf_data_service_config.dispatcher_address, + job_name=f'{self._tf_data_service_config.job_name}_{config.client_id()}', + target_workers='LOCAL')) + + for local_replica_idx, replica_id in enumerate(self._local_replica_ids): + # Select the shard for the corresponding replica. + dataset = distribute._AutoShardDataset( + local_dataset, + num_workers=self._num_local_replicas, + index=local_replica_idx, + num_replicas=self.num_global_replicas) + + # Repeat each batch for each local device in the replica. + dataset = self._repeat_batch(dataset, self._num_local_devices_per_replica) + + # Slice each shard further for all non-batch dim shards. If there is no + # non-batch dim sharding, this slice is essentially a no-op. + dataset = self._partition(dataset) + + # Apply prefetch as the last step. Since each batch is repeated, the + # number of elements to prefetch has to be scaled by the same size. + if self._prefetch is not None: + dataset = dataset.prefetch( + self._prefetch * self._num_local_devices_per_replica) + + datasets.append((replica_id, dataset)) + + # Convert the datasets into iterators placed on the host. + d_iterator_resource = _pack_iterator_resource_dtensor( + datasets=datasets, + layouts=self._layouts, + mesh=self._mesh, + num_local_devices_per_replica=self._num_local_devices_per_replica) + + return _DTensorIterator( + dtensor_components=(d_iterator_resource,), + global_element_spec=self._global_element_spec, + layouts=self._layouts) + + def _repeat_batch(self, dataset, repeats): + if repeats == 1: + # Remove this shortcut if tf.data can optimize this away. + return dataset + + def repeat(*x): + return dataset_ops.DatasetV2.from_tensors(x).repeat(repeats) + + return dataset.flat_map(repeat) + + def _partition(self, dataset): + """Slices each dataset element on any sharded non-batch dimension.""" + if self._num_local_devices_per_replica == 1 and self._partition_offset == 0: + # Remove this shortcut if tf.data can optimize this away. + return dataset + + # TODO(b/223275517): decouple from self and make testable. + def slice_batch(index, batch): + flattened_batch = nest.flatten(batch) + flattened_output = [] + + norm_index = math_ops.cast( + index % self._num_local_devices_per_replica, dtype=dtypes.int32) + norm_index += self._partition_offset + coords = self._mesh.coords(norm_index) + coords = array_ops.reshape(coords, (1, -1)) + + for element, shard_counts, idx_matrix in zip(flattened_batch, + self._all_shard_counts, + self._index_matrices): + indexes = math_ops.matmul(coords, idx_matrix) + start = array_ops.reshape(indexes, (-1,)) + size = array_ops.shape_v2( + element, out_type=dtypes.int32) // shard_counts + flattened_output.append( + array_ops.slice(element, begin=start, size=size)) + + return nest.pack_sequence_as(batch, flattened_output) + + enumerated_dataset = dataset.enumerate() + partitioned_dataset = enumerated_dataset.map(slice_batch) + return partitioned_dataset + + @property + def element_spec(self): + return self._global_element_spec diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/layout.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/layout.py new file mode 100644 index 0000000000000000000000000000000000000000..e55039757f692d8d8f346ce73eb7e08e253af8a2 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/layout.py @@ -0,0 +1,550 @@ +# Copyright 2022 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. +# ============================================================================== +"""Python definitions for `Mesh` and `Layout`.""" + +import collections +import functools +import itertools +from typing import List, Dict, Optional, Union + +import numpy as np + +from tensorflow.dtensor.proto import layout_pb2 +from tensorflow.python import _pywrap_dtensor_device +from tensorflow.python.framework import device as tf_device +from tensorflow.python.framework import ops +from tensorflow.python.framework import tensor +from tensorflow.python.util.tf_export import tf_export + +# UNSHARDED indicates a tensor dimension is not sharded over any mesh dimension. +UNSHARDED = 'unsharded' +MATCH = 'match' +USE_XLA_SPMD = False + +tf_export( + 'experimental.dtensor.UNSHARDED', + v1=[]).export_constant(__name__, 'UNSHARDED') +tf_export( + 'experimental.dtensor.MATCH', v1=[]).export_constant(__name__, 'MATCH') + +MeshDimension = collections.namedtuple('MeshDimension', ['name', 'size']) + + +def _compute_mesh_strides(shape: List[int]) -> List[int]: + strides = [1] + for idx, dim_size in enumerate(reversed(shape[1:])): + strides.append(strides[idx] * dim_size) + strides.reverse() + return strides + + +@tf_export('experimental.dtensor.Mesh', v1=[]) +class Mesh(_pywrap_dtensor_device.Mesh): + """Represents a Mesh configuration over a certain list of Mesh Dimensions. + + A mesh consists of named dimensions with sizes, which describe how a set of + devices are arranged. Defining tensor layouts in terms of mesh dimensions + allows us to efficiently determine the communication required when computing + an operation with tensors of different layouts. + + A mesh provides information not only about the placement of the tensors but + also the topology of the underlying devices. For example, we can group 8 TPUs + as a 1-D array for data parallelism or a `2x4` grid for (2-way) data + parallelism and (4-way) model parallelism. + + Refer to [DTensor Concepts](https://www.tensorflow.org/guide/dtensor_overview) + for in depth discussion and examples. + + Note: the utilities `dtensor.create_mesh` and + `dtensor.create_distributed_mesh` provide a simpler API to create meshes for + single- or multi-client use cases. + """ + + def __init__( + self, + dim_names: List[str], + global_device_ids: np.ndarray, + local_device_ids: List[int], + local_devices: List[Union[tf_device.DeviceSpec, str]], + mesh_name: str = '', + global_devices: Optional[List[Union[tf_device.DeviceSpec, str]]] = None, + use_xla_spmd: bool = USE_XLA_SPMD, + ): + """Builds a Mesh. + + The `dim_names` and `global_device_ids` arguments describe the dimension + names and shape for the mesh. + + For example, + + ```python + dim_names = ('x', 'y'), + global_device_ids = [[0, 1], + [2, 3], + [4, 5]] + ``` + + defines a 2D mesh of shape 3x2. A reduction over the 'x' dimension will + reduce across columns (0, 2, 4) and (1, 3, 5), and a reduction over the 'y' + dimension reduces across rows. + + Note: the utilities `dtensor.create_mesh` and + `dtensor.create_distributed_mesh` provide a simpler API to create meshes for + single- or multi-client use cases. + + Args: + dim_names: A list of strings indicating dimension names. + global_device_ids: An ndarray of global device IDs is used to compose + DeviceSpecs describing the mesh. The shape of this array determines the + size of each mesh dimension. Values in this array should increment + sequentially from 0. This argument is the same for every DTensor client. + local_device_ids: A list of local device IDs equal to a subset of values + in global_device_ids. They indicate the position of local devices in the + global mesh. Different DTensor clients must contain distinct + local_device_ids contents. All local_device_ids from all DTensor clients + must cover every element in global_device_ids. + local_devices: The list of devices hosted locally. The elements correspond + 1:1 to those of local_device_ids. + mesh_name: The name of the mesh. Currently, this is rarely used, and is + mostly used to indicate whether it is a CPU, GPU, or TPU-based mesh. + global_devices (optional): The list of global devices. Set when multiple + device meshes are in use. + use_xla_spmd (optional): Boolean when True, will use XLA SPMD instead of + DTensor SPMD. + """ + # Check if input args are valid. + if not isinstance(global_device_ids, np.ndarray): + raise ValueError('Variable global_device_ids must be an ndarray.') + if global_device_ids.size == 0: + raise ValueError('Variable global_device_ids must be non-empty.') + flat_global_device_ids = global_device_ids.flatten() + # global_device_ids are expected to be consecutive numbers. + # LINT.IfChange + distance = flat_global_device_ids[0] + if any( + (gid - i != distance) for i, gid in enumerate(flat_global_device_ids)): + raise ValueError('global_device_ids must sequentially increase: %s' % + global_device_ids) + # LINT.ThenChange(//tensorflow/dtensor/cc/dtensor_device.cc) + + # TODO(b/242201545): This class is only for args type transformation for + # exported C++ Mesh class after the unification is complete. Any other + # logics should reside in the C++ layer, including validation checks, shall + # go to C++. + + if len(dim_names) != global_device_ids.ndim: + raise ValueError( + 'Number of mesh dimensions does not match number of dimension names.') + + if not isinstance(local_device_ids, list): + raise ValueError('Variable local_device_ids must be a list of integers.') + + if not isinstance(local_devices, list): + raise ValueError('Variable local_devices must be a list of DeviceSpecs.') + + if global_devices and not isinstance(global_devices, list): + raise ValueError('Variable global_devices must be a list of DeviceSpecs.') + + if not local_devices and not global_devices: + raise ValueError('Empty list of devices not allowed.') + + # Transform args format for C++ Mesh constructor + global_device_ids_flatten = global_device_ids.flatten() + global_device_ids_shape = global_device_ids.shape + + def to_str(d) -> str: + if isinstance(d, tf_device.DeviceSpec): + return d.to_string() + return d + + def to_spec(d) -> tf_device.DeviceSpec: + if not isinstance(d, tf_device.DeviceSpec): + return tf_device.DeviceSpec.from_string(d) + return d + + local_devices_str = [to_str(d) for d in local_devices] + local_devices_spec = [to_spec(d) for d in local_devices] + if not global_devices: + global_devices = [] + global_devices_str = [to_str(d) for d in global_devices] + global_devices_spec = [to_spec(d) for d in global_devices] + + local_devices_set = set(local_devices_spec) + local_device_only_contains_host_cpu = ( + len(local_devices_set) == 1 and + list(local_devices_set)[0].device_type == 'CPU') + if not local_device_only_contains_host_cpu and len(local_devices) != len( + local_devices_set): + raise ValueError('Duplicate devices found in mesh specification %s.' % + [d for d in local_devices if local_devices.count(d) > 1]) + + if len(local_device_ids) != len(local_devices): + raise ValueError( + 'Variable local_device_ids does not have same size as local_devices.') + + if len(local_device_ids) > len(np.ravel(global_device_ids)): + raise ValueError('Cannot have more local than gobal device IDs.') + + device_types = set([device.device_type for device in local_devices_spec]) + if not device_types: + device_types = set([device.device_type for device in global_devices_spec]) + if None in device_types: + raise ValueError('device_type is required') + if len(device_types) > 1: + raise ValueError('Devices containing multiple device_types : %s' % + device_types) + device_type = device_types.pop() + if use_xla_spmd and device_type != 'TPU': + raise ValueError('XLA SPMD is not currently not supported for %s mesh.' % + device_type) + + super().__init__( + mesh_name, + dim_names, + global_device_ids_shape, + global_device_ids_flatten, + global_devices_str, + local_device_ids, + local_devices_str, + use_xla_spmd, + ) + + @classmethod + def _new_object(cls, *args, **kwargs): + # Need to explicitly invoke the base class __init__ because + # Mesh.__init__ overrode it with a different signature. + self = _pywrap_dtensor_device.Mesh.__new__(cls) + super().__init__(self, *args, **kwargs) + return self + + def global_device_ids(self) -> np.ndarray: + """Returns a global device list as an array.""" + return np.array(super().global_device_ids(), dtype=np.int64).reshape( + self.shape() + ) + + def __getitem__(self, dim_name: str) -> MeshDimension: + return MeshDimension(name=dim_name, size=self.dim_size(dim_name)) + + def __hash__(self): + return hash(self.as_proto().SerializeToString(deterministic=True)) + + def __repr__(self) -> str: + return f'Mesh.from_string({self.to_string()})' + + # TODO(panzf): change to pybind11 pickle implementation in the last step + def __reduce__(self): + return Mesh.from_string, (self.to_string(),) + + # TODO(b/242201545): implement this in Mesh C++ class + def coords(self, device_idx: int) -> tensor.Tensor: + """Converts the device index into a tensor of mesh coordinates.""" + strides = ops.convert_to_tensor(self.strides) + shape = ops.convert_to_tensor(self.shape()) + return (device_idx // strides) % shape + + @classmethod + def from_proto(cls, proto: layout_pb2.MeshProto) -> 'Mesh': + """Construct a mesh instance from input `proto`.""" + return cls._new_object(mesh_proto=proto) + + @classmethod + def from_string(cls, mesh_str: str) -> 'Mesh': + return cls._new_object(mesh_str=mesh_str) + + @classmethod + def from_device(cls, device: str) -> 'Mesh': + """Constructs a single device mesh from a device string.""" + return cls._new_object(single_device=device) + + @classmethod + def _from_mesh(cls, mesh: _pywrap_dtensor_device.Mesh): + """Creates a copy from an existing pywrap mesh object.""" + return cls._new_object(mesh=mesh) + + @functools.cached_property + def _host_mesh(self) -> 'Mesh': + return Mesh._from_mesh(super().host_mesh()) + + def host_mesh(self) -> 'Mesh': + """Returns a host mesh.""" + # TODO(b/242201545): Find a way to get the super class to return correct + # typed objects. + return self._host_mesh + + # TODO(b/242201545): implement this in Mesh C++ class + def local_device_locations(self) -> List[Dict[str, int]]: + """Returns a list of local device locations. + + A device location is a dictionary from dimension names to indices on those + dimensions. + """ + mapping = self.unravel_index() + return [mapping[device_id] for device_id in self.local_device_ids()] + + # TODO(b/242201545): implement this in Mesh C++ class + @property + def strides(self) -> List[int]: + """Returns the strides tensor array for this mesh. + + If the mesh shape is `[a, b, c, d]`, then the strides array can be computed + as `[b*c*d, c*d, d, 1]`. This array can be useful in computing local device + offsets given a device ID. Using the same example, the device coordinates of + the mesh can be computed as: + + ``` + [(device_id / (b*c*d)) % a, + (device_id / (c*d)) % b, + (device_id / (d)) % c, + (device_id) % d] + ``` + + This is the same as `(device_id // mesh.strides) % mesh.shape`. + + Returns: + The mesh strides as an integer tensor. + """ + return _compute_mesh_strides(self.shape()) + + # TODO(b/242201545): implement this in Mesh C++ class + def unravel_index(self): + """Returns a dictionary from device ID to {dim_name: dim_index}. + + For example, for a 3x2 mesh, return this: + + ``` + { 0: {'x': 0, 'y', 0}, + 1: {'x': 0, 'y', 1}, + 2: {'x': 1, 'y', 0}, + 3: {'x': 1, 'y', 1}, + 4: {'x': 2, 'y', 0}, + 5: {'x': 2, 'y', 1} } + ``` + """ + idx_ranges = [range(self.dim_size(dim_name)) for dim_name in self.dim_names] + mesh_pos = itertools.product(*idx_ranges) + mapping = {} + for device_id, device_pos in enumerate(mesh_pos): + device_loc = {} + for dim_name, dim_index in zip(self.dim_names, device_pos): + device_loc[dim_name] = dim_index + mapping[device_id] = device_loc + return mapping + + +LayoutType = _pywrap_dtensor_device.LayoutType + + +# TODO(hthu): Consider making this class immutable. +@tf_export('experimental.dtensor.Layout', v1=[]) +class Layout(_pywrap_dtensor_device.Layout): + """Represents the layout information of a DTensor. + + A layout describes how a distributed tensor is partitioned across a mesh (and + thus across devices). For each axis of the tensor, the corresponding + sharding spec indicates which dimension of the mesh it is sharded over. A + special sharding spec `UNSHARDED` indicates that axis is replicated on + all the devices of that mesh. + + Refer to [DTensor Concepts](https://www.tensorflow.org/guide/dtensor_overview) + for in depth discussion and examples. + + For example, let's consider a 1-D mesh: + + ``` + Mesh(["TPU:0", "TPU:1", "TPU:2", "TPU:3", "TPU:4", "TPU:5"], [("x", 6)]) + ``` + + This mesh arranges 6 TPU devices into a 1-D array. `Layout([UNSHARDED], mesh)` + is a layout for rank-1 tensor which is replicated on the 6 devices. + + For another example, let's consider a 2-D mesh: + + ``` + Mesh(["TPU:0", "TPU:1", "TPU:2", "TPU:3", "TPU:4", "TPU:5"], + [("x", 3), ("y", 2)]) + ``` + + This mesh arranges 6 TPU devices into a `3x2` 2-D array. + `Layout(["x", UNSHARDED], mesh)` is a layout for rank-2 tensor whose first + axis is sharded on mesh dimension "x" and the second axis is replicated. If we + place `np.arange(6).reshape((3, 2))` using this layout, the individual + components tensors would look like: + + ``` + Device | Component + TPU:0 [[0, 1]] + TPU:1 [[0, 1]] + TPU:2 [[2, 3]] + TPU:3 [[2, 3]] + TPU:4 [[4, 5]] + TPU:5 [[4, 5]] + ``` + """ + + def __init__(self, sharding_specs: List[str], mesh: Mesh): + """Builds a Layout from a list of dimension names and a Mesh. + + Args: + sharding_specs: List of sharding specifications, each corresponding to a + tensor axis. Each specification (dim_sharding) can either be a mesh + dimension or the special value UNSHARDED. + mesh: A mesh configuration for the Tensor. + + Returns: + A valid Layout built with given layout & mesh. + """ + # Validate mesh + if not isinstance(mesh, Mesh): + raise ValueError('mesh is not a valid Mesh object.') + + # Validate sharding spec + for _, dim_sharding in enumerate(sharding_specs): + # If special value no need to check for uniqueness, just skip. + if dim_sharding == UNSHARDED or dim_sharding == MATCH: + continue + # Check dim_sharding is unique. + if sharding_specs.count(dim_sharding) > 1: + raise ValueError( + ('Mesh dimension {mesh_dim} was repeated in sharding ' + + 'specification {sharding_specs}. Mesh dimensions must be unique ' + + 'in a layout.').format( + mesh_dim=dim_sharding, sharding_specs=sharding_specs)) + # Check dim_sharding is mesh dimension. + if dim_sharding not in mesh: + raise ValueError( + ('{dim_sharding}: A dimension sharding must either be a ' + + 'valid mesh dimension or UNSHARDED.').format( + dim_sharding=dim_sharding)) + + super().__init__( + type=LayoutType.STATIC, sharding_specs=sharding_specs, mesh=mesh + ) + + @classmethod + def _new_object(cls, *args, **kwargs): + # Need to explicitly invoke the base class __init__ because + # Layout.__init__ overrode it with a different signature. + self = _pywrap_dtensor_device.Layout.__new__(cls) + super().__init__(self, *args, **kwargs) + return self + + def __repr__(self) -> str: + return f'Layout.from_string({self.to_string()})' + + def __hash__(self): + return hash(self.as_proto().SerializeToString(deterministic=True)) + + # TODO(panzf): change to pybind11 pickle implementation in the last step + def __reduce__(self): + return Layout.from_string, (self.to_string(),) + + @property + def mesh(self): + return Mesh._from_mesh(mesh=super().mesh) # pylint: disable=protected-access + + @property + def shape(self): + return self.mesh.shape() + + @classmethod + def batch_sharded( + cls, mesh: Mesh, batch_dim: str, rank: int, axis: int = 0 + ) -> 'Layout': + """Returns a layout sharded on batch dimension.""" + return cls._new_object( + # Watchout for the different ordering. + mesh=mesh, + rank=rank, + batch_dim=batch_dim, + axis=axis, + ) + + # TODO(b/242201545): Move this to C++ / find the corresponding function there. + def delete(self, dims: List[int]) -> 'Layout': + """Returns the layout with the give dimensions deleted.""" + if not isinstance(dims, list): + dims = [dims] + new_specs = [ + spec for i, spec in enumerate(self.sharding_specs) if i not in dims + ] + return Layout(new_specs, self.mesh) + + @classmethod + def from_proto(cls, layout_proto: layout_pb2.LayoutProto) -> 'Layout': + """Creates an instance from a LayoutProto.""" + return cls._new_object(layout_proto=layout_proto) + + @classmethod + def from_string(cls, layout_str: str) -> 'Layout': + """Creates an instance from a human-readable string.""" + return cls._new_object(layout_str=layout_str) + + def to_parted(self) -> 'Layout': + """Returns a "parted" layout from a static layout. + + A parted layout contains axes that are treated as independent by most of + SPMD expanders. + + FIXME(b/285905569): The exact semantics is still being investigated. + """ + return Layout._new_object(layout=super().to_parted()) + + @classmethod + def inner_sharded(cls, mesh: Mesh, inner_dim: str, rank: int) -> 'Layout': + """Returns a layout sharded on inner dimension.""" + return cls.batch_sharded(mesh, inner_dim, rank, axis=rank - 1) + + @classmethod + def from_single_device_mesh(cls, mesh: Mesh) -> 'Layout': + """Constructs a single device layout from a single device mesh.""" + return cls._new_object(mesh=mesh) + + @classmethod + def from_device(cls, device: str) -> 'Layout': + """Constructs a single device layout from a single device mesh.""" + return cls.from_single_device_mesh(Mesh.from_device(device)) + + # TODO(b/242201545): Move this to C++ / find the corresponding function there. + def offset_to_shard(self): + """Mapping from offset in a flattened list to shard index.""" + unravel_index = self.mesh.unravel_index() + locations = [None] * self.mesh.size + for offset, mesh_loc in unravel_index.items(): + loc = [] + for dim_sharding in self.sharding_specs: + if dim_sharding == UNSHARDED: + loc.append(0) + else: + loc.append(mesh_loc[dim_sharding]) + locations[offset] = tuple(loc) + + return locations + + # TODO(b/242201545): Move this to C++ / find the corresponding function there. + def offset_tuple_to_global_index(self, offset_tuple): + """Mapping from offset to index in global tensor.""" + index = 0 + for i, o in enumerate(offset_tuple): + m = 1 + for x in range(i + 1, self.rank): + m = m * self.num_shards(x) + index = index + m * o + return index + + @classmethod + def replicated(cls, mesh: Mesh, rank: int) -> 'Layout': + """Returns a replicated layout of rank `rank`.""" + return cls._new_object(mesh=mesh, rank=rank) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/mesh_util.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/mesh_util.py new file mode 100644 index 0000000000000000000000000000000000000000..12e86e321e1210fb88096077c808ed44fae80fe0 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/mesh_util.py @@ -0,0 +1,310 @@ +# Copyright 2022 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. +# ============================================================================== +"""Utilities to help with mesh creation.""" + +from typing import Dict, List, Optional, Tuple, Union + +from absl import logging +import numpy as np + +from tensorflow.dtensor.python import accelerator_util +from tensorflow.dtensor.python import api +from tensorflow.dtensor.python import config +from tensorflow.dtensor.python import layout +from tensorflow.dtensor.python import tpu_util +from tensorflow.python.eager import context +from tensorflow.python.framework import device as tf_device +from tensorflow.python.ops import array_ops +from tensorflow.python.ops import math_ops +from tensorflow.python.util.tf_export import tf_export + + +def _print_context(num_global_devices: int, num_clients: int, client_id: int, + device_type: str, mesh: layout.Mesh) -> None: + logging.info('This is client %d of %d clients', client_id, num_clients) + logging.info('Number of global %s devices: %d', device_type.upper(), + num_global_devices) + # pylint: disable=protected-access + logging.info('Global device IDs: %s', mesh.global_device_ids()) + logging.info('Local device IDs: %s', mesh.local_device_ids()) + logging.info('Local devices: %s', mesh.local_devices()) + # pylint: enable=protected-access + + +def _make_device_specs( + devices: Optional[List[Union[tf_device.DeviceSpec, str]]] = None, + device_type: Optional[str] = None +) -> Tuple[List[tf_device.DeviceSpec], str]: + """Makes device specs for all local devices or from a provided list.""" + + if devices is None: + if device_type is None: + device_type = 'CPU' + devices = config.local_devices(device_type) + else: + if isinstance(devices[0], str): + devices = [tf_device.DeviceSpec.from_string(d) for d in devices] + if device_type is None: + device_type = devices[0].device_type + + if device_type.upper() != devices[0].device_type.upper(): + raise ValueError( + f'Conflicting devices {str(devices)} and device_type {device_type}' + ) + + return devices, device_type + + +@tf_export('experimental.dtensor.create_mesh', v1=[]) +def create_mesh( + mesh_dims: Optional[Union[List[Tuple[str, int]], Dict[str, int]]] = None, + mesh_name: str = '', + devices: Optional[List[Union[tf_device.DeviceSpec, str]]] = None, + device_type: Optional[str] = None, + use_xla_spmd: bool = layout.USE_XLA_SPMD, +) -> layout.Mesh: + """Creates a single-client mesh. + + If both `mesh_dims` and `devices` are specified, they must match each otehr. + As a special case, when all arguments are missing, this creates a 1D CPU mesh + with an empty name, assigning all available devices to that dimension. + + Args: + mesh_dims: A dict of dim_name: dim_size, or a list of (dim_name, dim_size) + tuples. Defaults to a single batch-parallel dimension called 'x' usin all + devices. As a special case, a single-element mesh_dims whose dim_size is + -1 also uses all devices. e.g. `{'x' : 4, 'y' : 1}` or `[('x', 4), ('y', + 1)]`. + mesh_name: Name of the created mesh. Defaults to ''. + devices: String representations of devices to use. This is the device part + of tf.DeviceSpec, e.g. 'CPU:0'. Defaults to all available logical devices. + device_type: If `devices` is missing, the type of devices to use. Defaults + to 'CPU'. + use_xla_spmd: Boolean when True, will use XLA SPMD instead of DTensor SPMD. + + Returns: + A single-client mesh created from specified or default arguments. + """ + device_specs, device_type = _make_device_specs(devices, device_type) + + local_spec = tf_device.DeviceSpec(job=config.job_name(), replica=0, task=0) + device_specs = [local_spec.make_merged_spec(d) for d in device_specs] + + if isinstance(mesh_dims, dict): + mesh_dims = list(mesh_dims.items()) + if mesh_dims is None: + mesh_dims = [('x', len(device_specs))] + elif len(mesh_dims) == 1 and mesh_dims[0][1] == -1: + # Replace -1 dim_size in a 1D mesh will the number of all devices. + mesh_dims[0] = (mesh_dims[0][0], len(device_specs)) + + dim_names = [d[0] for d in mesh_dims] + shape = [d[1] for d in mesh_dims] + + if np.prod(shape) != len(device_specs): + raise ValueError(f'length of devices ({len(device_specs)}) must be ' + f'equal to total size of the mesh of shape {shape}') + + global_device_ids = np.arange(len(device_specs)).reshape(shape) + local_device_ids = np.ravel(global_device_ids).tolist() + mesh = layout.Mesh( + dim_names=dim_names, + global_device_ids=global_device_ids, + local_device_ids=local_device_ids, + local_devices=device_specs, + mesh_name=mesh_name, + use_xla_spmd=use_xla_spmd) + _print_context( + num_global_devices=len(device_specs), + num_clients=1, + client_id=0, + device_type=device_type, + mesh=mesh) + return mesh + + +@tf_export('experimental.dtensor.create_distributed_mesh', v1=[]) +def create_distributed_mesh( + mesh_dims: Union[List[Tuple[str, int]], Dict[str, int]], + mesh_name: str = '', + local_devices: Optional[List[Union[tf_device.DeviceSpec, str]]] = None, + device_type: Optional[str] = None, + use_xla_spmd: bool = layout.USE_XLA_SPMD, +) -> layout.Mesh: + """Creates a distributed mesh. + + This is similar to `create_mesh`, but with a different set of arguments to + create a mesh that spans evenly across a multi-client DTensor cluster. + + For CPU and GPU meshes, users can choose to use fewer local devices than what + is available `local_devices`. + + For TPU, only meshes that uses all TPU cores is supported by the DTensor + runtime. + + Args: + mesh_dims: A dict of dim_name: dim_size, or a list of (dim_name, dim_size) + tuples. e.g. `{'x' : 4, 'y' : 1}` or `[('x', 4), ('y', 1)]`. + mesh_name: Name of the created mesh. Defaults to ''. + local_devices: String representations of devices to use. This is the device + part of tf.DeviceSpec, e.g. 'CPU:0'. Defaults to all available local + logical devices. + device_type: Type of device to build the mesh for. Defaults to 'CPU'. + Supported values are 'CPU', 'GPU', 'TPU'.6 + use_xla_spmd: Boolean when True, will use XLA SPMD instead of DTensor SPMD. + + Returns: + A mesh that spans evenly across all DTensor clients in the cluster. + """ + if isinstance(mesh_dims, dict): + mesh_dims = list(mesh_dims.items()) + dim_names, shape = zip(*mesh_dims) + + if not accelerator_util.is_initialized(): + raise ValueError('Accelerators are uninitialized, please run ' + 'dtensor.initialize_accelerator_system() first.') + + if device_type and device_type.upper() == 'TPU': + # TODO(b/185940495): Allow multi-mesh and partial on TPU. + # TPU meshes can only be configured through environment variables that + # reflect the actual TPU topology. Do not let users specify custom args. + if local_devices is not None: + raise ValueError( + f'Do not specify devices for {device_type.upper()} meshes. ' + f'Using a partial list of devices for {device_type.upper()} ' + f'is not supported.') + + device_specs, device_type = _make_device_specs(local_devices, device_type) + + if device_type.upper() in ['CPU', 'GPU']: + # For CPU and GPU meshes, user-specified args take precedence over env vars. + # This is particularly useful on single clients when users want to create + # meshes that use fewer logical devices than what's available. + + local_spec = tf_device.DeviceSpec( + job=config.job_name(), replica=0, task=config.client_id()) + device_specs = [local_spec.make_merged_spec(d) for d in device_specs] + + # Assumes identical number of local devices per client. + num_global_devices = len(device_specs) * config.num_clients() + + if np.prod(shape) != num_global_devices: + raise ValueError( + f'Global number of devices ' + f'({len(device_specs)} per client * {config.num_clients()} clients ' + f'= {num_global_devices}) must be ' + f'equal to total size of the mesh of shape {shape}') + + global_device_ids = np.arange(num_global_devices).reshape(shape) + flattened = np.ravel(global_device_ids).tolist() + start_idx = len(device_specs) * config.client_id() + local_device_ids = flattened[start_idx:start_idx + len(device_specs)] + + mesh = layout.Mesh( + dim_names=dim_names, + global_device_ids=global_device_ids, + local_device_ids=local_device_ids, + local_devices=device_specs, + mesh_name=mesh_name, + use_xla_spmd=use_xla_spmd) + _print_context(num_global_devices, config.num_clients(), config.client_id(), + device_type, mesh) + return mesh + + if device_type.upper() == 'TPU': + mesh = tpu_util.create_tpu_mesh( + mesh_dim_names=dim_names, + mesh_shape=shape, + mesh_name=mesh_name, + use_xla_spmd=use_xla_spmd) + _print_context( + config.num_global_devices(device_type), config.num_clients(), + config.client_id(), device_type, mesh) + return mesh + + raise ValueError(f'Device type {device_type} is not CPU, GPU or TPU') + + +_BARRIER_DICT = {} + + +@tf_export('experimental.dtensor.barrier', v1=[]) +def barrier(mesh: layout.Mesh, + barrier_name: Optional[str] = None, + timeout_in_ms: Optional[int] = None): + """Runs a barrier on the mesh. + + Upon returning from the barrier, all operations run before the barrier + would have completed across all clients. Currently we allocate a fully + sharded tensor with mesh shape and run an all_reduce on it. + + Example: + + A barrier can be used before application exit to ensure completion of pending + ops. + + ```python + + x = [1, 2, 3] + x = dtensor.relayout(x, dtensor.Layout.batch_sharded(mesh, 'batch', 1)) + dtensor.barrier(mesh) + + # At this point all devices on all clients in the mesh have completed + # operations before the barrier. Therefore it is OK to tear down the clients. + sys.exit() + ``` + + Args: + mesh: The mesh to run the barrier on. + barrier_name: The name of the barrier. Mainly used for logging purpose. + timeout_in_ms: The timeout of the barrier in ms. If omitted, blocks + indefinitely till the barrier is reached from all clients. + """ + if barrier_name is None: + barrier_name = '(barrier)' + + logging.info('entering barrier before op: %s', barrier_name) + + # Make sure all ops are consumed before running the sync. + context.async_wait() + + # Reduction on a fully sharded tensor requires all devices to participate + # and serves as a barrier on the mesh. + component = array_ops.reshape(1.0, [1] * len(mesh.shape())) + ones = api.pack([component] * mesh.num_local_devices(), + layout.Layout(mesh.dim_names, mesh)) + + mesh_size = math_ops.reduce_sum(ones) + if mesh_size != mesh.size: + raise ValueError( + 'Global barrier produced wrong mesh size : {0} while mesh has actual' + 'size : {1}'.format(mesh_size, mesh.size)) + + # TODO(hthu): This isn't strictly needed but might cause confusing behaviors + # from users. Consider dropping this if there is a `big` performance hit. + context.async_wait() + + if context.context().coordination_service: + if timeout_in_ms is None: + timeout_in_ms = 24 * 60 * 60 * 1000 # 24 hours to stand in for infinite. + + num_calls = _BARRIER_DICT.setdefault(barrier_name, 0) + _BARRIER_DICT[barrier_name] = num_calls + 1 + + barrier_id = f'{barrier_name}:{num_calls}' + context.context().wait_at_barrier(barrier_id, timeout_in_ms) + + logging.info('finished running barrier across all clients after ' + 'op: %s', barrier_name) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/numpy_util.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/numpy_util.py new file mode 100644 index 0000000000000000000000000000000000000000..8cab7a592d1bbba14fa1c43fd2f79ea363e02a5f --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/numpy_util.py @@ -0,0 +1,116 @@ +# Copyright 2022 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. +# ============================================================================== +"""Utilities to convert data buffers to/from DTensor tensors.""" +from typing import List + +import numpy as np + +from tensorflow.dtensor.python import api +from tensorflow.dtensor.python import layout as layout_lib +from tensorflow.python.eager.polymorphic_function import polymorphic_function +from tensorflow.python.ops import array_ops +from tensorflow.python.ops import array_ops_stack +from tensorflow.python.ops import sparse_ops +from tensorflow.python.ops import stateless_random_ops +from tensorflow.python.types.core import Tensor, TensorLike # pylint: disable=g-multiple-import + +# FIXME(b/262894693): Functions in this file are buggy. +# They do not distinguish between the client-local data and the global view. + + +def _split(value, splits, axis=0, split_fn=np.split, stack_fn=np.stack): + """Split `value` into a sharded nparray/tf tensor based on the number of splits. + """ + children = split_fn(value, splits[0], axis=axis) + if len(splits) > 1: + splits = splits[1:] + children = [_split(child, splits, axis + 1) for child in children] + return stack_fn(children) + + +def to_numpy(tensor: TensorLike) -> np.ndarray: + """Copy `input` DTensor to an equivalent local numpy array.""" + layout = api.fetch_layout(tensor) + if layout.mesh.is_remote(): + return np.array([None]) + + unpacked = [tensor.numpy() for tensor in api.unpack(tensor)] + return unpacked_to_numpy(unpacked, layout) + + +def unpacked_to_numpy(unpacked: List[TensorLike], + layout: layout_lib.Layout) -> np.ndarray: + """Heals local Tensor components to a numpy array.""" + if len(unpacked) != len(layout.offset_to_shard()): + raise ValueError('Wrong number of component Tensors.') + + unravelled = np.ndarray([layout.num_shards(i) for i in range(layout.rank)], + dtype=object) + + for offset, loc in enumerate(layout.offset_to_shard()): + unravelled[loc] = unpacked[offset] + + concat_tensor = np.block(unravelled.tolist()) + + # np.block can introduce empty initial dimensions, peel these off until + # the output matches the rank of the input tensors. + while concat_tensor.ndim > unpacked[0].ndim: + concat_tensor = np.squeeze(concat_tensor, axis=0) + return concat_tensor + + +# TODO(feyu): rename to slice. +def unpack(t: TensorLike, + layout: layout_lib.Layout, + split_fn=np.split, + stack_fn=np.stack) -> List[TensorLike]: + """Slice `t` into a flattened list of tensors suitable for `pack`.""" + if not layout.rank: + return [t] * layout.mesh.size + sharded_tensor = _split( + t, [layout.num_shards(i) for i in range(layout.rank)], + split_fn=split_fn, + stack_fn=stack_fn) + flattened = [np.ndarray([])] * layout.mesh.size + for offset, shard in enumerate(layout.offset_to_shard()): + flattened[offset] = sharded_tensor[tuple(shard)] + return flattened + + +def pack_numpy(value: np.ndarray, + layout: layout_lib.Layout, + make_sparse: bool = False) -> Tensor: + assert value is not None + unpacked = unpack(value, layout) + if make_sparse: + return api.pack([sparse_ops.from_dense(t) for t in unpacked], layout) + return api.pack(unpacked, layout) + + +def pack_tf_tensor(value: Tensor, layout: layout_lib.Layout) -> Tensor: + if value is None: + raise ValueError('pack requires values to be passed in') + unpacked = unpack( + value, layout, split_fn=array_ops.split, stack_fn=array_ops_stack.stack) + return api.pack(unpacked, layout) + + +@polymorphic_function.function +def stateless_random_uniform(shape, seed, layout): + """Creates uniform random tensor with the given layout.""" + return api.relayout( + stateless_random_ops.stateless_random_uniform(shape=shape, seed=seed), + layout=layout, + ) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/save_restore.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/save_restore.py new file mode 100644 index 0000000000000000000000000000000000000000..25bd78cdf00a991c13181c33218e060c999577b0 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/save_restore.py @@ -0,0 +1,222 @@ +# Copyright 2022 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. +# ============================================================================== +"""Contains functionaility for Checkpoint/SavedModel in DTensor.""" + +import collections +from typing import Dict, List, Union + +from tensorflow.dtensor.python import api +from tensorflow.dtensor.python import d_variable +from tensorflow.dtensor.python import gen_dtensor_ops +from tensorflow.dtensor.python import layout as layout_lib +from tensorflow.dtensor.python import mesh_util +from tensorflow.python.eager import context +from tensorflow.python.framework import errors_impl +from tensorflow.python.framework import ops +from tensorflow.python.framework import tensor as tensor_lib +from tensorflow.python.ops import io_ops +from tensorflow.python.ops import variables as tf_variables +from tensorflow.python.util.tf_export import tf_export + + +@tf_export('experimental.dtensor.sharded_save', v1=[]) +def sharded_save( + mesh: layout_lib.Mesh, + file_prefix: Union[str, tensor_lib.Tensor], + tensor_names: Union[List[str], tensor_lib.Tensor], + shape_and_slices: Union[List[str], tensor_lib.Tensor], + tensors: List[Union[tensor_lib.Tensor, tf_variables.Variable]], +): + """Saves given named tensor slices in a sharded, multi-client safe fashion. + + The method makes sure the checkpoint directory state is correct in a sharded + mutli-client saving. Namely, we place a barrier after SaveV2 to make sure + every client has done writing the files. And another one after + MergeV2Checkpoints to make sure all Metadata is properly merged. + + Upon existing, the checkpoint is completed and the all directory operations + are done. + + Args: + mesh: The Mesh that contains the Tensors to save. + file_prefix: The prefix of checkpoint. + tensor_names: a list of tensor names used in save op. + shape_and_slices: a list of shape and slice specification used in save op. + The only supported value is "" as we don't support distributed saving with + slices yet. + tensors: a list of tensors used in save op. The order should match + tensor_names. + + Returns: + A MergeV2Checkpoints op that merged all Metadata. + """ + with ops.device(api.device_name()): + io_ops.save_v2(file_prefix, tensor_names, shape_and_slices, tensors) + + # Make sure all clients have written the files + mesh_util.barrier(mesh.host_mesh(), 'SaveV2') # pylint: disable=protected-access + + with api.default_mesh(mesh.host_mesh()): + merge_op = io_ops.MergeV2Checkpoints( + checkpoint_prefixes=[file_prefix], + destination_prefix=file_prefix, + delete_old_dirs=True) + + # Make sure first device in first host has finished merge. + mesh_util.barrier(mesh.host_mesh(), 'MergeV2Checkpoints') + + return merge_op + + +@tf_export('experimental.dtensor.enable_save_as_bf16', v1=[]) +def enable_save_as_bf16(variables: List[tf_variables.Variable]): + """Allows float32 DVariables to be checkpointed and restored as bfloat16. + + The method only affects the DVariable part inside the model and leaves + non-DTensor Variables/Tensors untouched. + + Args: + variables: A list of tf.Variable to be enabled with bfloat16 save/restore. + Only has effect on DTensor Variables as they go through d_variables with + DTensor Specific logis. + """ + for v in variables: + if isinstance(v, d_variable.DVariable): + v.save_as_bf16 = True + + +@tf_export('experimental.dtensor.name_based_restore', v1=[]) +def name_based_restore( + mesh: layout_lib.Mesh, + checkpoint_prefix: str, + name_tensor_dict: Dict[ + str, Union[tensor_lib.Tensor, tf_variables.Variable]], +): + """Restores from checkpoint_prefix to name based DTensors. + + It is required to have already-initialized DTensor variables that have same + shape/dtype for the tensors being restored. + + Also, we currently only support a named based restore on a single mesh. + + Args: + mesh: The single mesh that all Tensors would be restored to. + checkpoint_prefix : The prefix of checkpoint to be restored. + name_tensor_dict: A ordered dictionary of tensor_names to a DTensor. The + DTensor shape/dtype must match the tensors being saved/restored for now. + + Returns: + A dictionary of name to its restored DTensor value. + """ + if not context.executing_eagerly(): + raise ValueError('name based restore must run eagerly.') + + ordered_name_tensor_dict = name_tensor_dict + if not isinstance(name_tensor_dict, collections.OrderedDict): + ordered_name_tensor_dict = collections.OrderedDict(name_tensor_dict) + + # Make sure that all tensors are on CPU mesh for now. + # This might not be a hard limitation in the future. + for name, tensor in ordered_name_tensor_dict.items(): + try: + if api.fetch_layout(tensor).mesh.device_type().upper() != 'CPU': + raise ValueError( + 'Restoring a non CPU Tensor is not supported currently. Offending ' + 'tensor name : {tensor_name}'.format(tensor_name=name)) + except errors_impl.OpError as op_error: + raise ValueError( + 'Saving/Restoring tensor must be a DTensor') from op_error + + # Now that we have all tensors on CPU mesh, do a DTensorRestoreV2. + checkpoint_prefix = api.pack( + [checkpoint_prefix] * mesh.num_local_devices(), + layout_lib.Layout.replicated(mesh.host_mesh(), rank=0)) + # Explicitly pack to mesh to avoid implicit small constant extraction, which + # does not work larger restores that has lots of names. + tensor_names = api.pack( + [list(ordered_name_tensor_dict.keys())] * mesh.num_local_devices(), + layout_lib.Layout.replicated(mesh.host_mesh(), rank=1)) + shape_and_slices = api.pack( + [[''] * len(ordered_name_tensor_dict)] * mesh.num_local_devices(), + layout_lib.Layout.replicated(mesh.host_mesh(), rank=1)) + # A list of TensorShape representing all shapes for the input tensors. + input_shapes = [tensor.shape for tensor in ordered_name_tensor_dict.values()] + input_layouts = [ + api.fetch_layout(tensor).to_string() + for tensor in ordered_name_tensor_dict.values() + ] + + with ops.device(api.device_name()): + restored_cpu_tensors = gen_dtensor_ops.d_tensor_restore_v2( + prefix=checkpoint_prefix, + tensor_names=tensor_names, + shape_and_slices=shape_and_slices, + input_shapes=input_shapes, + input_layouts=input_layouts, + dtypes=[tensor.dtype for tensor in ordered_name_tensor_dict.values()], + ) + + return collections.OrderedDict( + zip(ordered_name_tensor_dict.keys(), restored_cpu_tensors) + ) + + +@tf_export('experimental.dtensor.name_based_save', v1=[]) +def name_based_save( + mesh: layout_lib.Mesh, + checkpoint_prefix: Union[str, tensor_lib.Tensor], + name_tensor_dict: Dict[ + str, Union[tensor_lib.Tensor, tf_variables.Variable]], +): + """Saves name based Tensor into a Checkpoint. + + The function prepares the input dictionary to the format of a `sharded_save`, + so that it can take advantage of DTensor SPMD based distributed save. + + Same as restore, the function only supports saving on the single mesh. + + Args: + mesh: The single mesh that all Tensors would be restored to. + checkpoint_prefix : The prefix of checkpoint to be restored. + name_tensor_dict: A ordered dictionary of tensor_names to a DTensor. The + DTensor shape/dtype must match the tensors being saved/restored for now. + """ + if not context.executing_eagerly(): + raise ValueError('name based save must run eagerly.') + + ordered_name_tensor_dict = name_tensor_dict + if not isinstance(name_tensor_dict, collections.OrderedDict): + ordered_name_tensor_dict = collections.OrderedDict(name_tensor_dict) + + # Current _dtensor_device() in api.py is the correct way of specifying + # DTensor device singletons. The API itself will be eventually be moved to + # a public API and provides global singleton in DTensor context. + # For now, we just use the current `internal` API and aim at migrating in + # one shot later. + # TODO(hthu): Provide _dtensor_device() singleton as a public API. + # pylint: disable=protected-access + checkpoint_prefix = api.pack([checkpoint_prefix] * mesh.num_local_devices(), + layout_lib.Layout.replicated( + mesh.host_mesh(), rank=0)) + tensor_names = api.pack( + [list(ordered_name_tensor_dict.keys())] * mesh.num_local_devices(), + layout_lib.Layout.replicated(mesh.host_mesh(), rank=1)) + + sharded_save( + mesh, + file_prefix=checkpoint_prefix, + tensor_names=tensor_names, + shape_and_slices=[''] * len(ordered_name_tensor_dict), + tensors=list(ordered_name_tensor_dict.values())) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/tests/__init__.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/tests/multi_client_test_util.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/tests/multi_client_test_util.py new file mode 100644 index 0000000000000000000000000000000000000000..35d3e7aa10ef982bc4a88f12ca28afd070cfa6ae --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/tests/multi_client_test_util.py @@ -0,0 +1,141 @@ +# Copyright 2023 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. +# ============================================================================== +"""Utilities for multi-client setup.""" +import os +import sys + +from absl import flags +import portpicker + +from tensorflow.dtensor.python.tests import test_backend_util +from tensorflow.python.platform import test as tf_test + + +_NUM_LOCAL_DEVICES = flags.DEFINE_integer( + 'num_local_devices', 4, + 'Number of local devices. 4 is the only allowed value for TPU.') +_NUM_CLIENTS = flags.DEFINE_integer( + 'num_clients', 2, + 'Number of clients. 0 for local mode. 2 is the only allowed value for TPU.') + + +def multi_client_main(client_config_function): + """Creates a Flock of TensorFlow Processes on localhost.""" + flags.FLAGS(sys.argv, known_only=True) + num_clients = _NUM_CLIENTS.value + num_process = num_clients or 1 + num_local_devices = _NUM_LOCAL_DEVICES.value + + # No GPU visible to the flock controller. + os.environ['CUDA_VISIBLE_DEVICES'] = '' + os.environ['HIP_VISIBLE_DEVICES'] = '' + + # Python multiprocess module in OSS. + mp_context = test_backend_util.get_mp_context() + + print('Check per client log in Test artifacts.', flush=True) + + # Inverts the order of ports intentionally to rule out ordering bugs. + server_ports = sorted( + [portpicker.pick_unused_port() for _ in range(num_process)], reverse=True) + + additional_ports = sorted( + [portpicker.pick_unused_port() for _ in range(num_process)] + ) + + # Starts processes + procs = [] + for client_idx in range(num_process): + proc = mp_context.Process( + target=run_client, + args=(client_idx, num_clients, server_ports, additional_ports, + num_local_devices, client_config_function), + name=f'Client-{client_idx}', + ) + proc.start() + procs.append(proc) + + # Joins processes + exitcode = 0 + for proc in procs: + proc.join() + if proc.exitcode != 0: + exitcode = proc.exitcode + + sys.exit(exitcode) + + +def run_client(idx, num_clients, server_ports, additional_ports, + num_local_devices, client_config_function): + """Runs test.main() from a DTensor Client process on localhost. + + This function runs in a separate process so that the eager context is + properly separated, which resembles real world multi-client setup. + + Virtual devices are configured before test.main() is called. + + Each client is configured to only have access to the physical GPU device + corresponding to its client id via CUDA_VISIBLE_DEVICES/HIP_VISIBLE_DEVICES. + + Each client is configured to only have access to some TPU cores + corresponding to its client id via flags. + + The clients redirect stdout and stderr to files under Test Artifacts. + + Args: + idx: integer task number represents the client's id from global picture. + num_clients: total number of clients. + server_ports: A list of ports that is allocated and to be used to construct + GRPC server. server_ports[idx] will be the GRPC server on the + corresponding client. + additional_ports: A list of ports that is allocated and to be used to + construct the backends. + num_local_devices: Number of devices per client. + client_config_function: A function, for each of the client to config the + local environment variables, etc. Note that the function will be called + with a dict of extra params, eg: + {'num_clients': 2 + 'client_id': 0, + 'worker_jobs': ['localhost:port1', 'localhost:port2'], + 'num_devices': 4, + } + """ + test_backend_util.slice_host_devices_for_multiworker( + num_clients, idx, additional_ports + ) + + artifact_dir = os.environ.get('TEST_UNDECLARED_OUTPUTS_DIR', '') + + # Redirect extra client's stderr/stdout to undeclared outputs on sponge. + if artifact_dir: + with open( + os.path.join(artifact_dir, f'test-client-process-{idx}.log'), + 'wb') as fp: + os.dup2(fp.fileno(), 1) + os.dup2(fp.fileno(), 2) + + # Set up cluster and enable collectives. + worker_jobs = [f'localhost:{port:06d}' for port in server_ports] + client_config_func_param = { + 'num_clients': num_clients, + 'client_id': idx, + 'worker_jobs': worker_jobs, + 'num_devices': num_local_devices, + } + client_config_function(client_config_func_param) + + # The following function call never returns. + tf_test.main() + diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/tests/test_backend_name.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/tests/test_backend_name.py new file mode 100644 index 0000000000000000000000000000000000000000..0aa665b58bc35934e70dbba6684939351969da77 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/tests/test_backend_name.py @@ -0,0 +1,40 @@ +# Copyright 2022 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. +# ============================================================================== +"""List of test backend names.""" + +import enum +import os + + +# LINT.IfChange(backend_name) +class DTensorTestUtilBackend(enum.Enum): + """DTensor backend the test is being run on.""" + UNSPECIFIED = 'unspecified' + CPU = 'cpu' + GPU = 'gpu' + GPU_2DEVS_BACKEND = '2gpus' + TPU = 'tpu' + TPU_STREAM_EXECUTOR = 'tpu_se' + TPU_V3_DONUT_BACKEND = 'tpu_v3_2x2' + TPU_V4_DONUT_BACKEND = 'tpu_v4_2x2' + PATHWAYS = 'pw' + PATHWAYS_V3_DONUT_BACKEND = 'pw_v3_2x2' + + +DTENSOR_TEST_UTIL_BACKEND = DTensorTestUtilBackend( + os.getenv('DTENSOR_TEST_UTIL_BACKEND', default='unspecified') +) + +# LINT.ThenChange() diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/tests/test_backend_util.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/tests/test_backend_util.py new file mode 100644 index 0000000000000000000000000000000000000000..02fc82a71b7543482a4d6e07e9858468718365e4 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/tests/test_backend_util.py @@ -0,0 +1,81 @@ +# Copyright 2022 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. +# ============================================================================== +"""Utility to set up DTensor backend in tests.""" + +# LINT.IfChange +import multiprocessing +import os + +from tensorflow.dtensor.python import accelerator_util +from tensorflow.dtensor.python import config +from tensorflow.dtensor.python import layout as layout_lib +from tensorflow.dtensor.python.tests.test_backend_name import DTENSOR_TEST_UTIL_BACKEND +from tensorflow.python.platform import test as tf_test + + +class DTensorTestBackendConfigurator: + """Configurate test backends.""" + + def __init__(self, test_case: tf_test.TestCase): + self._test_case = test_case + # TODO(b/260771689): Refactor common backend set up logic to here. + + def tearDown(self): + # Only need to explicitly shuts down TPU system in TFRT since in current + # runtime, the shutdown is done in initialization process. + if accelerator_util.is_initialized(): + accelerator_util.shutdown_accelerator_system() + + +def config_test_mesh(mesh: layout_lib.Mesh): + """No Op. + + Args: + mesh: The DTensor mesh. + """ + if config.backend_is_pw(): + del mesh + + +def slice_host_devices_for_multiworker(num_clients, client_id, ports): + """Configure the current process to only use a slice of devices.""" + if num_clients == 0: + # All GPUs are visible to the client. + del os.environ['CUDA_VISIBLE_DEVICES'] + del os.environ['HIP_VISIBLE_DEVICES'] + else: + # Make the client_id-th GPU visible to the client. + os.environ['CUDA_VISIBLE_DEVICES'] = f'{client_id}' + os.environ['HIP_VISIBLE_DEVICES'] = f'{client_id}' + # Make the client_id-th (4x) TPU cores visible to the client. + os.environ['CLOUD_TPU_TASK_ID'] = f'{client_id}' + if 'tpu' in DTENSOR_TEST_UTIL_BACKEND.value: + del ports # Unused due to lack of implementation. + # We need to find out if there is a way to slice a CloudTPU host to + # multiple workers. + raise NotImplementedError( + 'OSS multi-client tests of TPU is not supported.' + ) + + +def get_mp_context(): + return multiprocessing.get_context('forkserver') + + +def handle_test_main(main, *args, **kwargs): + main(*args, **kwargs) + + +# LINT.ThenChange(test_backend_util.py) diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/tests/test_util.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/tests/test_util.py new file mode 100644 index 0000000000000000000000000000000000000000..268e7856794d50df69230a19ced1e689a2b652ce --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/tests/test_util.py @@ -0,0 +1,408 @@ +# Copyright 2022 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. +# ============================================================================== +"""Utility methods for DTensor testing.""" +import collections +import copy +import itertools +import json +import os +import typing + +from absl import flags +from absl.testing import parameterized + +import numpy as np + +# pylint: disable=g-direct-tensorflow-import +from tensorflow.dtensor.python import accelerator_util +from tensorflow.dtensor.python import api +from tensorflow.dtensor.python import config +from tensorflow.dtensor.python import layout as layout_lib +from tensorflow.dtensor.python import numpy_util +from tensorflow.dtensor.python.config import is_gpu_present # pylint: disable=unused-import +from tensorflow.dtensor.python.config import is_tpu_present # pylint: disable=unused-import +from tensorflow.dtensor.python.config import preferred_device_type # pylint: disable=unused-import +from tensorflow.dtensor.python.config import use_multi_device_mode # pylint: disable=unused-import +from tensorflow.dtensor.python.tests import test_backend_util +from tensorflow.dtensor.python.tests.test_backend_name import DTENSOR_TEST_UTIL_BACKEND +from tensorflow.dtensor.python.tests.test_backend_name import DTensorTestUtilBackend +from tensorflow.dtensor.python.tests.test_backend_util import DTensorTestBackendConfigurator +from tensorflow.python.compat import v2_compat +from tensorflow.python.eager import context +from tensorflow.python.framework import config as tf_config +from tensorflow.python.framework import device as tf_device +from tensorflow.python.ops import resource_variable_ops +from tensorflow.python.platform import test as tf_test +# pylint: enable=g-direct-tensorflow-import + +# DTensor only runs with TF V2. +v2_compat.enable_v2_behavior() + +DEFAULT_TOL = 1e-5 + +_DEFAULT_GPU_MEMORY_LIMIT = 1024 # 1G + + +def get_use_xla_spmd(device_type): + """Returns True when device_type is TPU and environment variable is set. + + Args: + device_type: A str representing the type of device on the mesh. + + Returns: + bool: True when device_type is TPU and environment variable is set. + """ + return device_type == 'TPU' and '0' != os.environ.get( + 'DTENSOR_TEST_USE_XLA_SPMD', '0' + ) + + +def create_device_ids_array(shape): + device_count = np.prod(shape) + return np.arange(device_count).reshape(shape) + + +def create_device_array(shape, device_type): + device_count = np.prod(shape) + return np.asarray([ + tf_device.DeviceSpec( # pylint: disable=g-complex-comprehension + job='localhost/replica:0/task:0', + device_type=device_type, + device_index=i) for i in range(device_count) + ]).reshape(shape) + + +def create_device_list(shape, device_type): + devices = create_device_array(shape, device_type) + return np.ravel(devices).tolist() + + +def reset_context(): + context._reset_context() # pylint: disable=protected-access + + +def reset_logical_devices(device_type, count): + """Resets logical devices for CPU/GPU. + + Logical devices can only be instantiated once on a particular context. For + now, context re-use is triggering some function duplication errors, so we + reset the context on each call. + + Args: + device_type: The device_type to reset. + count: numbers of virtual device to reset to. + """ + reset_context() + devices = tf_config.list_physical_devices(device_type) + if device_type.upper() not in ('CPU', 'GPU'): + raise ValueError('resetting logical device for non-supported device type : ' + '%s' % device_type) + + if count < len(devices): + devices = devices[:count] + tf_config.set_visible_devices(devices, device_type=device_type.upper()) + + for i, device in enumerate(devices): + n = (i + 1) * count // len(devices) - i * count // len(devices) + assert n > 0 # guaranteed if count >= len(devices) + configs = [] + for ordinal in range(n): + if device_type.upper() == 'GPU': + dev_config = context.LogicalDeviceConfiguration( + memory_limit=_DEFAULT_GPU_MEMORY_LIMIT, + experimental_device_ordinal=ordinal) + else: + dev_config = context.LogicalDeviceConfiguration() + configs.append(dev_config) + + tf_config.set_logical_device_configuration(device, configs) + + +def list_local_logical_devices(device_type): + """Returns a list of local logial devices.""" + + # When coordinator service is enabled, list_logical_devices returns + # a global list. + devices = tf_config.list_logical_devices(device_type) + + def is_local(device): + spec = tf_device.DeviceSpec.from_string(device.name) + if spec.job is None or spec.job == 'localhost': + return True + elif spec.job == config.job_name() and spec.task == config.client_id(): + return True + return False + + return [d for d in devices if is_local(d)] + + +def is_tfrt_enabled(): + return context.is_tfrt_enabled() + + +FLAGS = flags.FLAGS + + +class DTensorBaseTest(tf_test.TestCase, parameterized.TestCase): + """Provides comparison helper for dtensor vs local results.""" + + @classmethod + def setUpClass(cls): + super(DTensorBaseTest, cls).setUpClass() + + def setUp(self): + super().setUp() + self._backend_configurator = DTensorTestBackendConfigurator(self) + + def tearDown(self): + # Make sure all async ops finish. + try: + context.async_wait() + finally: + # TODO(hthu): Remove the reset once we fixed the CopyToMesh with + # DefaultMesh placement issue. + reset_dtensor() + + self._backend_configurator.tearDown() + super().tearDown() + + @staticmethod + def configTestMesh( # pylint: disable=invalid-name + device_type_mesh_map: typing.Dict[typing.Text, layout_lib.Mesh] + ) -> layout_lib.Mesh: + """Configs corresponding mesh given test context. + + If runs on a CPU mesh, set virtual device on CPU. + If runs on a GPU mesh, sets virtual device on GPU with proper memory limits. + if runs on a TPU mesh, initializes TPU system. + + Args: + device_type_mesh_map: A dictionary containing device_type -> mesh mapping. + + Returns: + A properly configured mesh for use in test. + """ + reset_context() + + def get_mesh(device_type): + mesh = device_type_mesh_map.get(device_type, None) + if mesh is None: + raise ValueError('Requires a %s mesh to run test on %s.' % + (device_type, device_type)) + return mesh + + mesh = None + if is_tpu_present(): + mesh = get_mesh('TPU') + reset_context() + accelerator_util.initialize_accelerator_system('TPU') + elif tf_config.list_physical_devices('GPU'): + mesh = get_mesh('GPU') + reset_logical_devices('GPU', np.prod(mesh.shape())) + accelerator_util.initialize_accelerator_system('GPU') + else: + mesh = get_mesh('CPU') + reset_logical_devices('CPU', np.prod(mesh.shape())) + accelerator_util.initialize_accelerator_system('CPU') + + test_backend_util.config_test_mesh(mesh) + + return mesh + + def skipForDeviceType( # pylint: disable=invalid-name + self, + device_type: typing.List[str], + reason: str, + unless_device_count_equals_to=None): + """Skip the test for the specific device_type. + + Args: + device_type: list of device types, one of "CPU", "GPU", or "TPU". + reason: string that describe the reason for skipping the test. + unless_device_count_equals_to: Optional int. This parameter only works if + device_type is "TPU". If set, the test will be skipped unless the number + of TPUs equals to the specified count. + """ + physical_device_types = set( + [d.device_type for d in tf_config.list_physical_devices()]) + for device in device_type: + if device == 'TPU' and is_tpu_present(): + if unless_device_count_equals_to is None: + self.skipTest(reason) + elif len(list_local_logical_devices( + device)) != unless_device_count_equals_to: + self.skipTest(reason) + if device == 'CPU' and len( + physical_device_types) == 1 and 'CPU' in physical_device_types: + # Make sure we skip when only `CPU` is present. + self.skipTest(reason) + if device == 'GPU' and 'GPU' in physical_device_types: + self.skipTest(reason) + + def skipForTfrt(self, reason: str): # pylint: disable=invalid-name + if is_tfrt_enabled(): + self.skipTest(reason) + + def skipTest(self, reason): # pylint: disable=invalid-name + # skipTest() may be called in super().setUp() + if hasattr(self, '_backend_configurator'): + self._backend_configurator.tearDown() + super().skipTest(reason) + + def skipForPathways(self, reason: str): # pylint: disable=invalid-name + if config.backend_is_pw(): + self.skipTest(reason) + + def assertDTensorEqual( + self, # pylint: disable=invalid-name + expected_result, + expected_layout, + result_dtensor, + tol=DEFAULT_TOL): + """Asserts DTensor is of the particular value.""" + if issubclass( + type(result_dtensor), resource_variable_ops.BaseResourceVariable): + result_dtensor = result_dtensor.value() + if expected_layout is not None: + # This, the assertEqual, is a pure proto raw bytes comparison. To make it + # human-readable, use the `to_string` api for Layout for the dedicated msg + # field. + # + # Futhurmore, as the mesh part is very long and usually identical. Try to + # cut them as well, to make it easier to read. + expected_str = expected_layout.to_string() + got_str = api.fetch_layout(result_dtensor).to_string() + index_for_mesh = expected_str.find('mesh:') + if index_for_mesh != -1 and got_str.find( + expected_str[index_for_mesh:]) != -1: + # the mesh part is same. cut them so it is more readable. + expected_str = expected_str[:index_for_mesh] + got_str = got_str[:got_str.find('mesh:')] + + self.assertEqual( + api.fetch_layout(result_dtensor), + expected_layout, + msg=( + '=======\nexpected layout is\n {}\n\nwhile got layout is\n {}\n' + .format(expected_str, got_str) + ), + ) + + layout = api.fetch_layout(result_dtensor) + unpacked = [t.numpy() for t in api.unpack(result_dtensor)] + + # Check global shape. + self.assertAllEqual(expected_result.shape, result_dtensor.shape) + + result_dtensor = numpy_util.to_numpy(result_dtensor) + + # Check dtype. + # Note: This check needs be after result_dtensor is converted + # into numpy, due to failure with Numpy version 1.18.5. + self.assertEqual( + expected_result.dtype, result_dtensor.dtype, result_dtensor + ) + + # Check value on concatenated result DTensor. + self.assertAllClose(expected_result, result_dtensor, atol=tol, rtol=tol) + + # In addition to check the 'concatenated' DTensor, we also check all + # "replicated" parts are same. + # + # The algorithm is simple: + # 1. For a mesh with topology (x,y,z,p), and a DTensor with layout ('',z,x). + # 2. Create some data structures: + # - create a mapping from device id (called offset below) to mesh + # location. For the mesh above, loc {x:1,y:2,z:2,p:0} means the device + # is located at that coordinates in the 4-D mesh. + # - create a mapping from mesh location to device id. + # 3. Find all replicated mesh dimension names, i.e., 'y' and `p` in the + # example above. + # 4. Iterate over all unpacked components, translate the offset (device id) + # to mesh location, called (x',y',z',p'). + # - For `y`, which is replicated dim in the mesh, check all unpacked + # components at (x',*,z',p') are same as the component at (x',0,z',p'). + # - For `p`, which is also replicated dim in the mesh, check all unpacked + # components at (x',y',z',*) are same as the component at (x',y',z',0). + + def hash_key(loc): + """Hash key for Python dict.""" + # Python dict is unhashable. Creates a sorted dict and dumps as json str. + d = collections.OrderedDict(sorted(loc.items(), key=lambda x: x[0])) + return json.dumps(d) + + offset_to_mesh_loc_dict = layout.mesh.unravel_index() + mesh_loc_to_offset_dict = {} + for offset, loc in offset_to_mesh_loc_dict.items(): + mesh_loc_to_offset_dict[hash_key(loc)] = offset + + # pylint: disable=protected-access + replicated_dims = [ + x for x in layout.mesh.dim_names if x not in layout.sharding_specs + ] + # pylint: enable=protected-access + + for offset, tensor in enumerate(unpacked): + mesh_loc = offset_to_mesh_loc_dict[offset] + for dim_sharding in replicated_dims: + if mesh_loc[dim_sharding] != 0: + mesh_loc = copy.deepcopy(mesh_loc) # deepcopy as we will mutate + mesh_loc[dim_sharding] = 0 + offset = mesh_loc_to_offset_dict[hash_key(mesh_loc)] + # tol is be as low as possible as they should match "exactly". so, we + # ignore the `tol` passed by caller and choose the default one. + self.assertAllClose(tensor, unpacked[offset]) + + +def product(*lists): + """Makes a product of names parameters list.""" + # Each element lists should be a tuple of tuples of the form + # (("test1", ...), ("test2", ...), ...). + # Function returns the product of the lists with the labels concatenated. + return [ # pylint: disable=g-complex-comprehension + (''.join(p[0] + for p in elt), *sum((p[1:] + for p in elt), ())) + for elt in itertools.product(*lists) + ] + + +def reset_dtensor(): + """Resets the singleton DTensor Device. + + This behavior is not generally exposed and only meant to be used in tests. + """ + api._reset() # pylint: disable=protected-access + + +__all__ = [ + 'DEFAULT_TOL', + 'DTensorTestUtilBackend', + 'DTENSOR_TEST_UTIL_BACKEND', + 'create_device_ids_array', + 'create_device_array', + 'create_device_list', + 'reset_context', + 'reset_logical_devices', + 'list_local_logical_devices', + 'is_tfrt_enabled', + 'FLAGS', + 'DTensorBaseTest', + 'product', + 'reset_dtensor', + 'is_tpu_present', + 'is_gpu_present', + 'use_multi_device_mode', +] diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/tests/test_util_ops.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/tests/test_util_ops.py new file mode 100644 index 0000000000000000000000000000000000000000..89513cff54022136003753c64b3d16a3188e7ecf --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/tests/test_util_ops.py @@ -0,0 +1,658 @@ +# Copyright 2022 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. +# ============================================================================== +"""Utility methods for DTensor testing.""" +from tensorflow.python.framework import constant_op +from tensorflow.python.framework import dtypes +from tensorflow.python.ops import array_ops +from tensorflow.python.ops import clip_ops +from tensorflow.python.ops import gen_array_ops +from tensorflow.python.ops import gen_bitwise_ops +from tensorflow.python.ops import gen_math_ops +from tensorflow.python.ops import gen_nn_ops +from tensorflow.python.ops import gen_spectral_ops +from tensorflow.python.ops import gen_stateless_random_ops +from tensorflow.python.ops import gen_stateless_random_ops_v2 +from tensorflow.python.ops import math_ops +from tensorflow.python.ops import nn_ops +from tensorflow.python.ops import special_math_ops + + +def expand_test_config(op_list, test_configs): + """Returns a list of test case args that covers ops and test_configs. + + The list is a Cartesian product between op_list and test_configs. + + Args: + op_list: A list of dicts, with items keyed by 'testcase_name' and 'op'. + Available lists are defined later in this module. + test_configs: A list of dicts, additional kwargs to be appended for each + test parameters. + + Returns: + test_configurations: a list of test parameters that covers all + provided ops in op_list and args in test_configs. + """ + test_configurations = [] + for op_info in op_list: + test_index = 0 + for added_test_config in test_configs: + test_config = op_info.copy() + test_config.update(added_test_config) + test_config['testcase_name'] = op_info['testcase_name'] + '_' + str( + test_index) + test_index += 1 + test_configurations.append(test_config) + return test_configurations + + +# Disable pyformat for this block to force compact style. +# pyformat: disable +# +# Disable g-long-lambda to make the unit test suits compact (avoid def new func) +# pylint: disable=g-long-lambda +UNARY_OPS = [ + { + 'testcase_name': 'Identity', + 'op': array_ops.identity + }, + { + 'testcase_name': 'ZerosLike', + 'op': array_ops.zeros_like_v2 + }, + { + 'testcase_name': 'Abs', + 'op': math_ops.abs + }, + { + 'testcase_name': 'Negative', + 'op': gen_math_ops.neg + }, + { + 'testcase_name': 'Cast', + 'op': lambda x: math_ops.cast(x, dtypes.int32) + }, + { + 'testcase_name': 'ErfOp', + 'op': gen_math_ops.erf + }, + { + 'testcase_name': 'Softmax', + 'op': nn_ops.softmax_v2 + }, + { + 'testcase_name': 'LogSoftmax', + 'op': nn_ops.log_softmax_v2 + }, + { + 'testcase_name': 'StopGradient', + 'op': array_ops.stop_gradient + }, + { + 'testcase_name': 'Exp', + 'op': math_ops.exp + }, + { + 'testcase_name': 'Sqrt', + 'op': math_ops.sqrt + }, + { + 'testcase_name': 'Rsqrt', + 'op': math_ops.rsqrt + }, + { + 'testcase_name': 'Reciprocal', + 'op': gen_math_ops.reciprocal + }, + { + 'testcase_name': 'Relu', + 'op': gen_nn_ops.relu + }, + { + 'testcase_name': 'Square', + 'op': gen_math_ops.square + }, + { + 'testcase_name': 'Tanh', + 'op': gen_math_ops.tanh + }, + { + 'testcase_name': 'Cos', + 'op': gen_math_ops.cos + }, + { + 'testcase_name': 'Sigmoid', + 'op': math_ops.sigmoid + }, + { + 'testcase_name': 'Acos', + 'op': math_ops.acos + }, + { + 'testcase_name': 'Acosh', + 'op': gen_math_ops.acosh + }, + { + 'testcase_name': 'Angle', + 'op': math_ops.angle + }, + { + 'testcase_name': 'Asin', + 'op': gen_math_ops.asin + }, + { + 'testcase_name': 'Asinh', + 'op': gen_math_ops.asinh + }, + { + 'testcase_name': 'Atan', + 'op': gen_math_ops.atan + }, + { + 'testcase_name': 'Bessel0e', + 'op': special_math_ops.bessel_i0e + }, + { + 'testcase_name': 'Bessel1e', + 'op': special_math_ops.bessel_i1e + }, + { + 'testcase_name': 'Bitcast', + 'op': lambda x: gen_array_ops.bitcast(x, type=dtypes.int32) + }, + { + 'testcase_name': 'Ceil', + 'op': math_ops.ceil + }, + { + 'testcase_name': 'CheckNumbers', + 'op': (lambda x: gen_array_ops.check_numerics(x, message='bug')) + }, + { + 'testcase_name': 'ClipByValue', + 'op': (lambda x: clip_ops.clip_by_value(x, 1.5, 2.5)) + }, + { + 'testcase_name': 'Conj', + 'op': math_ops.conj + }, + { + 'testcase_name': 'Cosh', + 'op': gen_math_ops.cosh + }, + { + 'testcase_name': 'Digamma', + 'op': gen_math_ops.digamma + }, + { + 'testcase_name': + 'ComplexAbs', + 'op': + lambda x: gen_math_ops.complex_abs( + x=math_ops.cast(x, dtypes.complex64), Tout=float, name='raw') + }, + { + 'testcase_name': 'Sign', + 'op': math_ops.sign + }, + { + 'testcase_name': 'Elu', + 'op': gen_nn_ops.elu + }, + { + 'testcase_name': 'Erfc', + 'op': gen_math_ops.erfc + }, + { + 'testcase_name': 'Expm1', + 'op': gen_math_ops.expm1 + }, + { + 'testcase_name': 'Floor', + 'op': math_ops.floor + }, + { + 'testcase_name': 'Imag', + 'op': math_ops.imag + }, + { + 'testcase_name': 'Inv', + 'op': (lambda x: gen_math_ops.inv(x=x, name='Inv')) + }, + { + 'testcase_name': 'IsInf', + 'op': gen_math_ops.is_inf + }, + { + 'testcase_name': 'IsNan', + 'op': gen_math_ops.is_nan + }, + { + 'testcase_name': 'LeakyRelu', + 'op': (lambda x: nn_ops.leaky_relu((x - 2), alpha=0.3)), + }, + { + 'testcase_name': 'Lgamma', + 'op': gen_math_ops.lgamma, + }, + { + 'testcase_name': 'Log1p', + 'op': gen_math_ops.log1p, + }, + { + 'testcase_name': 'Ndtri', + 'op': (lambda x: math_ops.ndtri(x / 100)), + }, + { + 'testcase_name': 'Selu', + 'op': gen_nn_ops.selu, + }, + { + 'testcase_name': 'Sin', + 'op': gen_math_ops.sin, + }, + { + 'testcase_name': 'Sinh', + 'op': gen_math_ops.sinh, + }, + { + 'testcase_name': 'Softplus', + 'op': math_ops.softplus, + }, + { + 'testcase_name': 'Softsign', + 'op': gen_nn_ops.softsign, + }, + { + 'testcase_name': 'Tan', + 'op': gen_math_ops.tan, + }, + { + 'testcase_name': 'Round', + 'op': math_ops.round, + }, + { + 'testcase_name': 'Rint', + 'op': gen_math_ops.rint, + }, + { + 'testcase_name': 'Relu6', + 'op': nn_ops.relu6, + }, + { + 'testcase_name': 'Real', + 'op': math_ops.real, + }, + { + 'testcase_name': 'PreventGradient', + 'op': lambda x: gen_array_ops.prevent_gradient(input=x), + }, +] + +BINARY_ANY_TYPE_OPS_WITH_BROADCASTING_SUPPORT = [ + { + 'testcase_name': 'Add', + 'op': math_ops.add + }, + { + 'testcase_name': 'Subtract', + 'op': math_ops.subtract + }, + { + 'testcase_name': 'Multiply', + 'op': math_ops.multiply + }, + { + 'testcase_name': 'Maximum', + 'op': gen_math_ops.maximum + }, + { + 'testcase_name': 'Minimum', + 'op': gen_math_ops.minimum + }, + { + 'testcase_name': 'Squared_Difference', + 'op': gen_math_ops.squared_difference + }, + { + 'testcase_name': 'GreaterEqual', + 'op': gen_math_ops.greater_equal + }, + { + 'testcase_name': 'Equal', + 'op': math_ops.equal + }, + { + 'testcase_name': 'NotEqual', + 'op': math_ops.not_equal + }, + { + 'testcase_name': 'LessEqual', + 'op': gen_math_ops.less_equal + }, + { + 'testcase_name': 'Less', + 'op': gen_math_ops.less + }, + { + 'testcase_name': 'Pow', + 'op': math_ops.pow + }, +] + +BINARY_FLOAT_OPS_WITH_BROADCASTING_SUPPORT = [ + { + 'testcase_name': 'Real_Divide', + 'op': math_ops.divide + }, + { + 'testcase_name': 'DivNoNan', + 'op': math_ops.div_no_nan + }, +] + BINARY_ANY_TYPE_OPS_WITH_BROADCASTING_SUPPORT + +BINARY_INT_OPS_WITH_BROADCASTING_SUPPORT = [ + { + 'testcase_name': 'LeftShift', + 'op': gen_bitwise_ops.left_shift + }, + { + 'testcase_name': 'RightShift', + 'op': gen_bitwise_ops.right_shift + }, + { + 'testcase_name': 'BitwiseOr', + 'op': gen_bitwise_ops.bitwise_or + }, + { + 'testcase_name': 'BitwiseAnd', + 'op': gen_bitwise_ops.bitwise_and + }, + { + 'testcase_name': 'BitwiseXor', + 'op': gen_bitwise_ops.bitwise_xor + }, + { + 'testcase_name': 'TruncateDiv', + 'op': gen_math_ops.truncate_div + }, + { + 'testcase_name': 'TruncateMod', + 'op': gen_math_ops.truncate_mod + }, +] + BINARY_ANY_TYPE_OPS_WITH_BROADCASTING_SUPPORT + +BINARY_BOOL_OPS = [{ + 'testcase_name': 'LogicalOr', + 'op': gen_math_ops.logical_or +}] + +BINARY_FLOAT_OPS = [ + { + 'testcase_name': 'RsqrtGrad', + 'op': lambda y, dy: gen_math_ops.rsqrt_grad(y=y, dy=dy) + }, + { + 'testcase_name': 'SqrtGrad', + 'op': lambda y, dy: gen_math_ops.sqrt_grad(y=y, dy=dy) + }, + { + 'testcase_name': 'Atan2', + 'op': gen_math_ops.atan2 + }, + { + 'testcase_name': 'Betainc', + 'op': lambda a, b: gen_math_ops.betainc(a, b, 1.0) + }, + { + 'testcase_name': 'Complex', + 'op': math_ops.complex + }, + { + 'testcase_name': + 'EluGrad', + 'op': (lambda x, y: gen_nn_ops.elu_grad( + gradients=x, outputs=y, name='op_elugrad')) + }, + { + 'testcase_name': 'Igamma', + 'op': gen_math_ops.igamma + }, + { + 'testcase_name': + 'IgammaGradA', + 'op': (lambda a, x: gen_math_ops.igamma_grad_a( + a=a, x=x, name='IgammaGradA')) + }, + { + 'testcase_name': + 'LeakyReluGrad', + 'op': + (lambda x, y: gen_nn_ops.leaky_relu_grad(gradients=x, features=y)), + }, + { + 'testcase_name': 'MulNoNan', + 'op': (lambda x, y: gen_math_ops.mul_no_nan(x=x, y=y)), + }, + { + 'testcase_name': 'NextAfter', + 'op': gen_math_ops.next_after, + }, + { + 'testcase_name': 'PolyGamma', + 'op': gen_math_ops.polygamma, + }, + { + 'testcase_name': 'SeluGrad', + 'op': (lambda x, y: gen_nn_ops.selu_grad(gradients=x, outputs=y)), + }, + { + 'testcase_name': 'Relu6Grad', + 'op': (lambda x, y: gen_nn_ops.relu6_grad(gradients=x, features=y)), + }, + { + 'testcase_name': 'ReciprocalGrad', + 'op': (lambda x, y: gen_math_ops.reciprocal_grad(y=x, dy=y)), + }, + { + 'testcase_name': 'Xdivy', + 'op': math_ops.xdivy, + }, + { + 'testcase_name': 'Xlog1py', + 'op': math_ops.xlog1py, + }, + { + 'testcase_name': 'Xlogy', + 'op': gen_math_ops.xlogy, + }, + { + 'testcase_name': 'Zeta', + 'op': gen_math_ops.zeta, + }, +] + BINARY_FLOAT_OPS_WITH_BROADCASTING_SUPPORT + +BINARY_INT_OPS = [] + BINARY_INT_OPS_WITH_BROADCASTING_SUPPORT + +REDUCTION_OPS = [ + { + 'testcase_name': 'Sum', + 'op': math_ops.reduce_sum + }, + { + 'testcase_name': 'Mean', + 'op': math_ops.reduce_mean + }, + { + 'testcase_name': 'Prod', + 'op': math_ops.reduce_prod + }, + { + 'testcase_name': 'Max', + 'op': math_ops.reduce_max + }, + { + 'testcase_name': 'Min', + 'op': math_ops.reduce_min + }, +] + +# TODO(b/171746536): added v2 rng ops here once supported. +RANDOM_OPS = [{ + 'testcase_name': 'StatelessNorm', + 'op': gen_stateless_random_ops.stateless_random_normal, + 'dtype': dtypes.float32, + 'op_version': 'V1' +}, { + 'testcase_name': 'StatelessTruncatedNorm', + 'op': gen_stateless_random_ops.stateless_truncated_normal, + 'dtype': dtypes.float32, + 'op_version': 'V1' +}, { + 'testcase_name': 'StatelessUniform', + 'op': gen_stateless_random_ops.stateless_random_uniform, + 'dtype': dtypes.float32, + 'op_version': 'V1' +}, { + 'testcase_name': 'StatelessUniformFullInt', + 'op': gen_stateless_random_ops.stateless_random_uniform_full_int, + 'dtype': dtypes.int32, + 'op_version': 'V1' +}, { + 'testcase_name': 'StatelessRandomUniformFullIntV2', + 'op': gen_stateless_random_ops_v2.stateless_random_uniform_full_int_v2, + 'dtype': dtypes.int32, + 'op_version': 'V2' +}, { + 'testcase_name': 'StatelessRandomNormalV2', + 'op': gen_stateless_random_ops_v2.stateless_random_normal_v2, + 'dtype': dtypes.float32, + 'op_version': 'V2' +}, { + 'testcase_name': 'StatelessTruncatedNormalV2', + 'op': gen_stateless_random_ops_v2.stateless_truncated_normal_v2, + 'dtype': dtypes.float32, + 'op_version': 'V2' +}, { + 'testcase_name': 'StatelessRandomUniformV2', + 'op': gen_stateless_random_ops_v2.stateless_random_uniform_v2, + 'dtype': dtypes.float32, + 'op_version': 'V2' +}, { + 'testcase_name': 'StatelessRandomUniformIntV2', + 'op': gen_stateless_random_ops_v2.stateless_random_uniform_int_v2, + 'dtype': dtypes.int32, + 'op_version': 'V2_RANGE' +}] + +# op(inputs()) is expected to return an NxM tensor (N, M both even) with a +# flexible output sharding, depending on the context `op` runs in. +EXPANSION_OPS = [ + dict( + testcase_name='TileFrom1x1Array', + inputs=lambda: (constant_op.constant([[1.]]), [4, 4]), + op=gen_array_ops.tile), + dict( + testcase_name='TileFrom2x2Array', + inputs=lambda: (constant_op.constant([[1., 2.], [3., 4.]]), [2, 4]), + op=gen_array_ops.tile), + dict( + testcase_name='Fill', + inputs=lambda: ([2, 4], constant_op.constant(1.)), + op=array_ops.fill), +] + +BATCH_PARALLEL_2D_WINDOW_OPS = [( + 'AvgPool', + nn_ops.avg_pool_v2, +)] + +BATCH_PARALLEL_3D_WINDOW_OPS = [( + 'MaxPool3D', + nn_ops.max_pool3d, +), ( + 'AvgPool3D', + nn_ops.avg_pool3d, +)] + +FFT_OPS = [( + 'FFT', + gen_spectral_ops.fft, + 1, +), ( + 'FFT2D', + gen_spectral_ops.fft2d, + 2, +), ( + 'FFT3D', + gen_spectral_ops.fft3d, + 3, +), ( + 'IFFT', + gen_spectral_ops.ifft, + 1, +), ( + 'IFFT2D', + gen_spectral_ops.ifft2d, + 2, +), ( + 'IFFT3D', + gen_spectral_ops.ifft3d, + 3, +)] + +RFFT_OPS = [( + 'IRFFT', + gen_spectral_ops.irfft, + 1, + dtypes.complex64, +), ( + 'IRFFT2D', + gen_spectral_ops.irfft2d, + 2, + dtypes.complex64, +), ( + 'IRFFT3D', + gen_spectral_ops.irfft3d, + 3, + dtypes.complex64, +), ( + 'RFFT', + gen_spectral_ops.rfft, + 1, + dtypes.float32, +), ( + 'RFFT2D', + gen_spectral_ops.rfft2d, + 2, + dtypes.float32, +), ( + 'RFFT3D', + gen_spectral_ops.rfft3d, + 3, + dtypes.float32, +)] + +PADDINGS = [ + { + 'testcase_name': 'SamePadding', + 'padding': 'SAME' + }, + { + 'testcase_name': 'ValidPadding', + 'padding': 'VALID' + }, +] +# pylint: enable=g-long-lambda +# pyformat: enable diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/tpu_util.py b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/tpu_util.py new file mode 100644 index 0000000000000000000000000000000000000000..317d49e37ab59bc9edad8f551f0e0468540b39f0 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/dtensor/python/tpu_util.py @@ -0,0 +1,805 @@ +# Copyright 2022 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. +# ============================================================================== +"""TPU-specific utilities for DTensor.""" + +import functools +import time +from typing import List, Optional, Dict + +import numpy as np + +from tensorflow.dtensor.python import config +from tensorflow.dtensor.python import dtensor_device +from tensorflow.dtensor.python import gen_dtensor_ops +from tensorflow.dtensor.python import layout as layout_lib +from tensorflow.python.eager import context +from tensorflow.python.eager import def_function +from tensorflow.python.framework import constant_op +from tensorflow.python.framework import errors +from tensorflow.python.framework import ops +from tensorflow.python.ops import array_ops +from tensorflow.python.ops import math_ops +from tensorflow.python.platform import tf_logging as logging +from tensorflow.python.tpu import topology +from tensorflow.python.util.tf_export import tf_export + + +_MESH_DIM_X = "x" +_TPU_DEVICE_TYPE = "TPU" + +# A dedicated, hidden device used to make C++ API calls. +_dtensor_device = None + +# `_topology._mesh_shape` contains the TPU hardware slice size. +# `_topology.device_coordinates` maps TF task-device ordinals to TPU core IDs. +_tpu_topology = None + +# Cache core ID <-> location mappings so we need not make repeated C++ calls. +# Both are indexed by TF task-device ordinals. +_all_core_ids = None +_all_core_locations = None + + +class _CoreLocation: + """Represents a TPU core's location in the mesh.""" + + def __init__(self, x: int = 0, y: int = 0, z: int = 0, core: int = 0): + self.x = x + self.y = y + self.z = z + self.core = core + + def __eq__(self, other): + if not isinstance(other, _CoreLocation): + return False + return self.x == other.x and self.y == other.y and self.z == other.z and self.core == other.core + + def __ne__(self, other): + if not isinstance(other, _CoreLocation): + return True + return not self == other + + def __hash__(self): + return hash((self.x, self.y, self.z, self.core)) + + def __repr__(self): + return f"{type(self).__name__}(x={self.x}, y={self.y}, z={self.z}, core={self.core})" + + def to_list(self): + return [self.x, self.y, self.z, self.core] + + +def _create_device_array(shape, device_type, host_id, local_device_ids=None): + """Returns ID and device lists that can be used to create a mesh.""" + num_global_devices = config.num_global_devices(device_type) + global_device_ids = np.arange(num_global_devices).reshape(shape) + local_device_list = config.local_devices(device_type) + + # User can specify local_device_ids or use default list for multi host. + num_local_devices = len(local_device_list) + local_device_ids = [ + x + host_id * num_local_devices for x in range(num_local_devices) + ] if not local_device_ids else local_device_ids + + return global_device_ids, local_device_ids, local_device_list + + +def _create_tpu_topology(core_locations: List[_CoreLocation], num_tasks: int, + num_devices_per_task: int) -> topology.Topology: + """Returns a Topology object build from a _CoreLocation list. + + Args: + core_locations: A list of _CoreLocation objects sorted first by TF task ID + and then by per-task device ordinals. + num_tasks: The number of TF tasks in the cluster. + num_devices_per_task: The number of TPU devices local to each task. + """ + + assert min([l.x for l in core_locations]) == 0 + assert min([l.y for l in core_locations]) == 0 + assert min([l.z for l in core_locations]) == 0 + assert min([l.core for l in core_locations]) == 0 + x_max = max([l.x for l in core_locations]) + y_max = max([l.y for l in core_locations]) + z_max = max([l.z for l in core_locations]) + core_max = max([l.core for l in core_locations]) + mesh_shape = [x_max + 1, y_max + 1, z_max + 1, core_max + 1] + + device_coordinates = [[l.x, l.y, l.z, l.core] for l in core_locations] + device_coordinates = np.asarray(device_coordinates).reshape( + num_tasks, num_devices_per_task, 4) + + return topology.Topology( + mesh_shape=mesh_shape, device_coordinates=device_coordinates) + + +def shutdown_tpu_system(): + """Shuts down the TPU system.""" + + @def_function.function + def _shutdown_tpu_system(): + return gen_dtensor_ops.shutdown_tpu_system() + + success = _shutdown_tpu_system() if context.is_tfrt_enabled() else True + if success: + logging.info("TPU system shut down.") + else: + logging.warning("TPU system fails to shut down.") + + +def tpu_system_init_helper(task_id, + num_tasks, + num_devices, + use_tfrt_host_runtime=True): + """A helper function to initialize multi-client tpu system.""" + + @def_function.function + def _tpu_init_fn(): + return gen_dtensor_ops.configure_and_initialize_global_tpu( + use_tfrt_host_runtime=use_tfrt_host_runtime) + + @def_function.function + def _set_global_tpu_array_fn(topology_proto): + gen_dtensor_ops.d_tensor_set_global_tpu_array(topology_proto) + + with ops.device("/job:" + config.full_job_name() + "/device:TPU_SYSTEM:0"): # pylint: disable=protected-access + my_core_ids = _tpu_init_fn() + logging.info("TPU core IDs: %s", my_core_ids) + + # `my_core_ids` contains the IDs of TPU cores attached to this host. + # + # To generate correct and efficient XLA AllReduce group assignment, we must + # merge these arrays from all hosts and broadcast the result back to all + # hosts, so all hosts can use these mappings in their MLIR passes. + # + # This is essentially doing what WaitForDistributedTpuOp and + # SetGlobalTPUArrayOp do, in our multi-client environment. + num_devices_per_task = int(num_devices / num_tasks) + + # Create a one-time use mesh and layout just for merging core IDs. + mesh = layout_lib.Mesh([_MESH_DIM_X], + *_create_device_array((num_devices,), _TPU_DEVICE_TYPE, + config.client_id())) + layout = layout_lib.Layout([_MESH_DIM_X, layout_lib.UNSHARDED], mesh) + device = dtensor_device.DTensorDevice(meshes=[mesh]) + logging.info("TPU core locations: %s", + device.tpu_core_ids_to_locations(my_core_ids)) + + # At this point, we don't know which cores are attached to other hosts. + # The core ID mappings in the runtime haven't been set yet. + # + # The core ID merging AllReduce below is carefully written so it works + # without needing correct core mappings to be set in the runtime. We will + # use this AllReduce's result to set the core ID mappings, and all future + # user-initiated AllReduces will use the mappings. + # + # The runtime is hard-coded to ignore core ID mappings on this AllReduce. + all_core_ids = np.zeros([num_devices], dtype=np.int32) + for i in range(len(my_core_ids)): + all_core_ids[task_id * num_devices_per_task + i] = my_core_ids[i] + + # Only one local device gets a valid input. To give an example, assume we have + # 2 tasks and each of them has 8 local devices, then `all_core_ids` in task 0 + # will have 8 tensors, where 1 of them may have its value as + # [0,1,2,3,4,5,6,7,0,0,0,0,0,0,0,0] and the other tensors are all zeros. For + # task 1, the case may be one with [0,0,0,0,0,0,0,0,8,9,10,11,12,13,14,15] + # and other 7 are all zeros. + all_core_ids = constant_op.constant([all_core_ids]) + zeros = array_ops.zeros_like(all_core_ids) + all_core_ids = [all_core_ids] + [zeros] * (num_devices_per_task - 1) + + # All devices on all hosts participate in one AllReduce, whose result will be + # core IDs arranged by task-device ordinals. For the above example, the result + # will be [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]. + with ops.device(device.name): + all_core_ids = device.pack(all_core_ids, layout) + all_core_ids = math_ops.reduce_sum(all_core_ids, axis=[0]) + unpacked_all_tpu_ids = device.unpack(all_core_ids) + + all_core_ids = list(unpacked_all_tpu_ids[0].numpy()) + logging.info("All TPU core IDs: %s", all_core_ids) + + # Set the default core ID mappings in the runtime for legacy code and tests. + # + # Legacy code and tests create TPU meshes directly without using the + # `create_tpu_mesh` function below. Those meshes have global device IDs + # equal to TF task-device ordinals. The `all_core_ids` array happens to + # arrange core IDs by TF task-device ordinals. Using this array on those + # meshes guarantee correct although inefficient results. + device.set_tpu_core_ids("", all_core_ids) + + # Remember enough global, immutable information to be able to build any ring + # we want prescribed by `create_tpu_mesh` in the future. + global _all_core_ids + _all_core_ids = all_core_ids + + all_core_locations = device.tpu_core_ids_to_locations(all_core_ids) + all_core_locations = [ + _CoreLocation(l[0], l[1], l[2], l[3]) for l in all_core_locations + ] + global _all_core_locations + _all_core_locations = all_core_locations + logging.info("All TPU core locations: %s", all_core_locations) + + tpu_topology = _create_tpu_topology(all_core_locations, num_tasks, + num_devices_per_task) + + _set_global_tpu_array_fn(tpu_topology.serialized()) + return tpu_topology, device + + +def initialize_tpu_system(): + """Initializes the TPU system.""" + + # Make sure the server change is fully propagated before attempting to run + # the core ID merging logic below. + context.ensure_initialized() + context.async_wait() + context.context()._clear_caches() # pylint: disable=protected-access + + use_tfrt_host_runtime = context.context().use_tfrt + logging.info("Using TFRT host runtime is set to %s", use_tfrt_host_runtime) + try: + task_id = config.client_id() + num_tasks = config.num_clients() + num_devices = config.num_global_devices(_TPU_DEVICE_TYPE) + + tpu_topology, device = tpu_system_init_helper( + task_id, + num_tasks, + num_devices, + use_tfrt_host_runtime=use_tfrt_host_runtime) + global _tpu_topology + _tpu_topology = tpu_topology + logging.vlog(1, "TPU Topology: %s, %s", tpu_topology.mesh_shape, + tpu_topology.device_coordinates) + + global _dtensor_device + _dtensor_device = device + + context.async_wait() + + except errors.InvalidArgumentError as e: + raise errors.NotFoundError( + None, None, + "Initialization failed, no valid TPUs found. " + str(e)) from e + + except errors.InternalError as e: + logging.error("Hit internal error during TPU system initialization. " + + "It is likely hardware failure. \nPlease check the error " + + "messages above to see whether that's the case. \nIf so, " + + "consider to restart the job or try another machine.") + raise e + + # Clear out the eager context caches since the memory is invalid now. + logging.info("Clearing out eager caches") + context.context()._clear_caches() # pylint: disable=protected-access + + +def _enumerate_cores(bounds: List[int], ring_bounds: List[int], + ring_sizes: List[int], host_bounds: List[int], + host_sizes: List[int]) -> List[List[int]]: + """Enumerates cores within `bounds` from fatest to slowest varying axes. + + Args: + bounds: Upper bounds of axes, from fastest to slowest varying. + ring_bounds: Upper bounds of ring size per axis in the same axis order. + ring_sizes: Number consecutive cores in the ring built so far, cumulatively. + host_bounds: Number of axis values per host in the same axis order. + host_sizes: Number consecutive cores on one host, cumulatively. + + Returns: + Cores represented as a list of 4 integers in the same axis order. + """ + if not bounds: + return [[]] + + # Recursively enumerate cores under all but the slowest varying axis. + partials = _enumerate_cores(bounds[:-1], ring_bounds[:-1], ring_sizes[:-1], + host_bounds[:-1], host_sizes[:-1]) + + # Append the slowest varying axis to the end of all partial results. + # From ring_i|j to host_i|j to core_i|j, use progressively smaller or equal + # iteration groupings until every one of the bounds[-1] * len(partials) + # combinations is iterated on. + # Despite the six levels of nested loops below, the total time complexity for + # this invocation is O(N), where N is the number of cores in the topology. + results = [] + for ring_i in range(0, bounds[-1], ring_bounds[-1]): + for ring_j in range(0, len(partials), ring_sizes[-1]): + for host_i in range(ring_i, ring_i + ring_bounds[-1], host_bounds[-1]): + for host_j in range(ring_j, ring_j + ring_sizes[-1], host_sizes[-1]): + for i in range(host_i, host_i + host_bounds[-1]): + for j in range(host_j, host_j + host_sizes[-1]): + results.append(partials[j] + [i]) + return results + + +def _enumerate_core_locations(bounds: List[int], ring_bounds: List[int], + axes: List[str], + can_split_host_across_rings: bool, + ring_size: int) -> List[_CoreLocation]: + """Enumerates all possible core locations under the axis iteration order. + + Args: + bounds: A list of 4 positive integers, upper bound values for x, y, z, core. + ring_bounds: A list of 4 positive integers, upper bound values for ring size + in x, y, z, core axes. + axes: A permutation of ["x", "y", "z", "core"], the axis iteration order. + can_split_host_across_rings: If true, devices attached to the same host may + get assigned to different rings. + ring_size: Number of devices in a ring, only for argument validation. + + Returns: + A list of all CoreLocation objects defined in a TPU slice of shape `bounds`, + sorted by axis iteration order specified by `axes`. + + For example, given bounds=[2, 2, 1, 2] and axes=["core", "z", "y", "x"], + return 8 core locations expressed in (x, y, z, core) format but iterated in + core -> z -> y -> x order (fatest to slowest varying): + + [_CoreLocation(0, 0, 0, 0), + _CoreLocation(0, 0, 0, 1), + _CoreLocation(0, 1, 0, 0), + _CoreLocation(0, 1, 0, 1), + _CoreLocation(1, 0, 0, 0), + _CoreLocation(1, 0, 0, 1), + _CoreLocation(1, 1, 0, 0), + _CoreLocation(1, 1, 0, 1)] + + Raises: + ValueError: If ring_size cannot be fulfilled without splitting hosts. + """ + + num_cores_per_chip = bounds[3] + if num_cores_per_chip != 1 and num_cores_per_chip != 2: + raise ValueError("Unsupported TPU slice size: %s" % bounds) + + # Translate `axes` from string to integer format. + axes = [{"x": 0, "y": 1, "z": 2, "core": 3}[axis] for axis in axes] + # Reorder bounds from fastest to slowest varying axes. + bounds = [bounds[i] for i in axes] + + # Set and validate host_bounds. + if can_split_host_across_rings: + # If we can split hosts, shrink every host to effectively contain 1 device. + host_bounds = [1, 1, 1, 1] + elif np.prod(bounds) <= 2: + # We must be running on 1x1 or 1x1x1 Forge. + host_bounds = [[1, 1, 1, num_cores_per_chip][i] for i in axes] + else: + # Other cases including 2x2 Forge and Borg must use a full donut. + host_bounds = [[2, 2, 1, num_cores_per_chip][i] for i in axes] + # host_sizes is the cumulative products of host_bounts. + host_sizes = [1] + for host_bound in host_bounds: + host_sizes.append(host_sizes[-1] * host_bound) + host_size = host_sizes.pop() + # When can_split_host_across_rings is false, a ring must contain at least as + # many devices as a host has. + if ring_size < host_size: + assert not can_split_host_across_rings + raise ValueError( + "Rings too small for can_split_host_across_rings = False: %d" % + ring_size) + + # Reorder ring_bounds and validate it's element-wise >= host_bounds. + ring_bounds = [ring_bounds[i] for i in axes] + if ring_bounds < host_bounds: + raise ValueError("ring_bounds %s should be >= host_bounds %s" % + (ring_bounds, host_bounds)) + ring_sizes = [1] + # ring_sizes is the cumulative products of ring_bounds. + for ring_bound in ring_bounds: + ring_sizes.append(ring_sizes[-1] * ring_bound) + ring_sizes.pop() + + # Enumerate cores in the given iteration order. Each core is represented as a + # list of int, which are offsets from fatest to slowest varying axes. + cores = _enumerate_cores(bounds, ring_bounds, ring_sizes, host_bounds, + host_sizes) + # Reorder offsets of each core back to the x, y, z, core order. + core_locations = [] + for core in cores: + core = [core[axes.index(i)] for i in range(4)] + core_locations.append(_CoreLocation(core[0], core[1], core[2], core[3])) + return core_locations + + +def _build_all_reduce_ring(core_locations: List[_CoreLocation], + rotate: bool = False) -> List[int]: + """Reorders a list of TPU cores to optimize for AllReduce performance. + + This is ported from the C++ tensorflow::BuildAllReduceRing function, + mixed with some logic from TF TPU's device_assignment._ring_3d. + + Args: + core_locations: A list of core locations expressed as [x, y, z, core]. + rotate: If true, scan the cores in a column-major order. False by default. + + Returns: + A permutation of the input list such that neighbors in the sequence are + nearby in the TPU topology. + """ + + permutation = list(range(len(core_locations))) + if not permutation: + return permutation + logging.vlog(2, "Core locations in: %s", core_locations) + + first_column = min([l.x for l in core_locations]) + first_row = min([l.y for l in core_locations]) + same_z = (len(set([l.z for l in core_locations])) == 1) + logging.vlog(2, "first_column: %d", first_column) + logging.vlog(2, "first_row: %d", first_row) + logging.vlog(2, "same_z: %s", same_z) + + def _cmp_2d(ia: int, ib: int) -> int: + if not rotate: + a = core_locations[ia] + b = core_locations[ib] + + # Order the first column last in the sequence, except for the first row. + a_first = (a.x == first_column and a.y != first_row) + b_first = (b.x == first_column and b.y != first_row) + if a_first != b_first: + return -1 if b_first else 1 + + # Order rows in increasing order, unless in the first column. + if a.y != b.y: + return b.y - a.y if a_first else a.y - b.y + + # Order even rows left to right, odd rows right to left. + if a.x != b.x: + return a.x - b.x if a.y % 2 == 0 else b.x - a.x + + # Order cores in increasing order. + return a.core - b.core + else: + a = core_locations[ia] + b = core_locations[ib] + + # Order the first row last in the sequence, except for the first column. + a_first = (a.y == first_row and a.x != first_column) + b_first = (b.y == first_row and b.x != first_column) + if a_first != b_first: + return -1 if b_first else 1 + + # Order columns in increasing order, unless in the first row. + if a.x != b.x: + return b.x - a.x if a_first else a.x - b.x + + # Order even columns top down, odd columns bottom up. + if a.y != b.y: + return a.y - b.y if a.x % 2 == 0 else b.y - a.y + + # Order cores in increasing order. + return a.core - b.core + + def _cmp_3d(ia: int, ib: int) -> int: + a = core_locations[ia] + b = core_locations[ib] + + a_corner = (a.x == first_column and a.y == first_row) + b_corner = (b.x == first_column and b.y == first_row) + + # If both are in the corner, order in reverse z then core order. + if a_corner and b_corner: + return b.z - a.z if a.z != b.z else a.core - b.core + + # Corner cores always go after non-corner cores. + if a_corner != b_corner: + return -1 if b_corner else 1 + + # Both non-corner cores are on the same z-plane. Reverse odd z-planes. + if a.z == b.z: + return _cmp_2d(ia, ib) if a.z % 2 == 0 else -_cmp_2d(ia, ib) + + # Both non-corner cores are on different z-planes. Smaller z goes first. + return a.z - b.z + + # If all cores are on the same z-plane, order as usual. Otherwise, order + # neighbor z-planes in opposite orders. Stack all z-planes along the z axis + # and connect them in one corner. + if same_z: + permutation.sort(key=functools.cmp_to_key(_cmp_2d)) + else: + permutation.sort(key=functools.cmp_to_key(_cmp_3d)) + logging.vlog(2, "Permutation out: %s", permutation) + return permutation + + +def _build_orthogonal_rings( + core_locations: List[_CoreLocation], ring_size: int, + rotate_ring_across_rings: bool) -> List[_CoreLocation]: + """Build two all-reduce rings orthogonal to each other. + + One ring includes every `ring_size` consecutive core locations. It is usually + applied to the model-parallel dimension of a mesh to achieve best 1D + all-reduce performance. The other ring includes core locations separated by + a stride of `ring_size`. It is usually applied to the data-parallel dimension + of a mesh to get predictable strided all-reduce performance. + + Args: + core_locations: A list of core locations expressed as [x, y, z, core]. + ring_size: The number of core locations in the consecutive ring. + rotate_ring_across_rings: Build column-major secondary rings. + + Returns: + A permutation of the input list forming the described rings. + """ + # Build a ring for the first `ring_size` cores, and apply that permutation to + # every group of `ring_size` cores. + num_cores = len(core_locations) + permutation = _build_all_reduce_ring(core_locations[:ring_size]) + for r in range(0, num_cores, ring_size): + core_locations[r:r + ring_size] = [ + core_locations[r + permutation[i]] for i in range(ring_size) + ] + logging.vlog(1, "Permutated core locations: %s", core_locations) + + # Build a "ring" for the collection of devices consisting of the 0th device + # from every group, and apply that permutation to every i-th device group. + # This is achieved by transposing the list and back. + transposed = [] + for i in range(ring_size): + transposed += [ + core_locations[g + i] for g in range(0, num_cores, ring_size) + ] + + num_rings = int(num_cores / ring_size) + permutation = _build_all_reduce_ring( + transposed[:num_rings], rotate=rotate_ring_across_rings) + for r in range(0, num_cores, num_rings): + transposed[r:r + num_rings] = [ + transposed[r + permutation[i]] for i in range(num_rings) + ] + + untransposed = [] + for i in range(num_rings): + untransposed += [transposed[g + i] for g in range(0, num_cores, num_rings)] + logging.vlog(1, "Stride-permutated core locations: %s", untransposed) + + return untransposed + + +@tf_export("experimental.dtensor.create_tpu_mesh", v1=[]) +def create_tpu_mesh( + mesh_dim_names: List[str], + mesh_shape: List[int], + mesh_name: str, + ring_dims: Optional[int] = None, + ring_axes: Optional[List[str]] = None, + ring_bounds: Optional[List[int]] = None, + can_split_host_across_rings: bool = True, + build_ring_across_rings: bool = False, + rotate_ring_across_rings: bool = False, + use_xla_spmd: bool = layout_lib.USE_XLA_SPMD) -> layout_lib.Mesh: + """Returns a distributed TPU mesh optimized for AllReduce ring reductions. + + Only as many as leading axes specified by `ring_axes` as necessary will be + used to build rings, as long as the subslice formed by these axes have enough + cores to contain a ring of the required size. The leftover axes in `ring_axes` + won't affect results. + + This function always uses all TPU devices, and offers more customization than + `tf.experimental.dtensor.create_distributed_mesh`. + + Args: + mesh_dim_names: List of mesh dimension names. + mesh_shape: Shape of the mesh. + mesh_name: A unique name for the mesh. If empty, internally generate one. + ring_dims: Optional; The number of leading (ring_dims > 0) or trailing + (ring_dims < 0) mesh dimensions to build rings for. If unspecified, build + rings for all but the first dimension. + ring_axes: Optional; A permutation of ["x", "y", "z", "core"], specifying + the order of TPU topology axes to build rings in. If unspecified, default + to ["core", "x", "y", "z"]. + ring_bounds: Optional; The maximum number of devices on each axis, in the x, + y, z, core order. If unspecified, default to physical topology limits. + can_split_host_across_rings: Optional; If true, devices attached to the same + host (i.e., DTensor client) may get assigned to different rings. Setting + it to false may cause some combinations of arguments to be infeasible; see + DeviceAssignmentTest.testCreateMesh[No]SplittingHosts* for examples. + build_ring_across_rings: Optional; If true, also build a data-parallel ring + across model-parallel rings. This ring could be strided. + rotate_ring_across_rings: Optional; If true, build the data-parallel ring in + column-major instead of row-major order. + use_xla_spmd: Boolean when True, will use XLA SPMD instead of + DTensor SPMD. + """ + + logging.info("Building a TPU mesh %s of shape %s", mesh_name, mesh_shape) + logging.info("Requested ring_dims: %s", ring_dims) + logging.info("Requested ring_axes: %s", ring_axes) + logging.info("Requested ring_bounds: %s", ring_bounds) + logging.info("Requested can_split_host_across_rings: %s", + can_split_host_across_rings) + if not mesh_name: + mesh_name = "mesh_%f" % time.time() + logging.info("Requested mesh_name: %s", mesh_name) + + # By default, build rings for all but the first (usually batch) dimension. + if ring_dims is None: + ring_dims = 1 - len(mesh_shape) + elif ring_dims < -len(mesh_shape) or ring_dims > len(mesh_shape): + raise ValueError("Invalid ring_dims value: %d" % ring_dims) + logging.info("Actual ring_dims: %s", ring_dims) + + # By default, vary axes in the core -> x -> y -> z order. + if ring_axes is None: + ring_axes = ["core", "x", "y", "z"] + elif len(ring_axes) != 4: + raise ValueError("Expected 4 elements in ring_axes, got %s" % ring_axes) + elif sorted(ring_axes) != ["core", "x", "y", "z"]: + raise ValueError("Invalid ring_axes value: %s" % ring_axes) + logging.info("Actual ring_axes: %s", ring_axes) + + # Validate ring_bounds values. + if _tpu_topology is None: + raise ValueError( + "Invalid TPU topology, run dtensor.initialize_tpu_system() first") + topology_shape = list(_tpu_topology.mesh_shape) + if ring_bounds is None: + ring_bounds = topology_shape + elif len(ring_bounds) != 4: + raise ValueError("Expected 4 elements in ring_bounds, got %s" % ring_bounds) + elif ring_bounds > topology_shape: + raise ValueError("ring_bounds %s should be <= topology sizes %s" % + (ring_bounds, topology_shape)) + logging.info("Actual ring_bounds: %s", ring_bounds) + + # Compute ring_size, the number of cores in a ring. + if ring_dims > 0: + ring_size = np.prod(mesh_shape[:ring_dims]) + elif ring_dims < 0: + ring_size = np.prod(mesh_shape[ring_dims:]) + else: + ring_size = 1 # single-core rings + logging.info("Actual ring_size: %d", ring_size) + + # Rearrange all cores according to the axis iteration order. + global_core_locations = _enumerate_core_locations( + topology_shape, ring_bounds, ring_axes, can_split_host_across_rings, + ring_size) + logging.vlog(1, "Enumerated core locations: %s", global_core_locations) + num_cores = len(global_core_locations) + + # The mesh to be created must use all TPU cores in the system. + mesh_size = np.prod(mesh_shape) + if mesh_size != num_cores: + raise ValueError( + "Invalid mesh size: mesh shape %s cannot 1:1 map to %d TPU cores" % + (mesh_shape, num_cores)) + + # Build a ring for the `ring_size` dimension and, if required, a strided ring + # for the orthogonal dimension. + if build_ring_across_rings: + global_core_locations = _build_orthogonal_rings(global_core_locations, + ring_size, + rotate_ring_across_rings) + else: + permutation = _build_all_reduce_ring(global_core_locations[:ring_size]) + for r in range(0, num_cores, ring_size): + global_core_locations[r:r + ring_size] = [ + global_core_locations[r + permutation[i]] for i in range(ring_size) + ] + logging.vlog(1, "Permutated core locations: %s", global_core_locations) + + # For this point on, change from List[CoreLocation] to List[List[int]] for + # easier interaction with the C++ API. + global_core_locations = [l.to_list() for l in global_core_locations] + if _dtensor_device is None: + raise ValueError("Invalid system device, " + "run dtensor.initialize_accelerator_system() first") + global_core_ids = _dtensor_device.tpu_core_locations_to_ids( + global_core_locations) + + # Store a per-mesh mapping in the runtime. + _dtensor_device.set_tpu_core_ids(mesh_name, global_core_ids) + + # Create the mesh by manually specifying local_device_ids. + local_core_locations = _tpu_topology.device_coordinates[config.client_id()] + indexes = [ + global_core_locations.index(list(local_core_location)) + for local_core_location in local_core_locations + ] + global_device_ids, local_device_ids, local_device_list = _create_device_array( + mesh_shape, _TPU_DEVICE_TYPE, None, local_device_ids=indexes) + return layout_lib.Mesh( + mesh_dim_names, + global_device_ids, + local_device_ids, + local_device_list, + mesh_name, + use_xla_spmd=use_xla_spmd, + ) + + +def get_device_ids(mesh: layout_lib.Mesh, + client_id: Optional[int] = None) -> List[int]: + """Returns the device IDs of all TPU cores local to the given client. + + A device ID is a non-negative integer that uniquely identifies a device in the + mesh. For example, for a 2x2 mesh ('x', 'y'), this function returns a + permutation of [0, 1, 2, 3]. + + Note that device IDs and device locations are equivalent. The former is a + linearization of the latter along mesh dimensions. + + Args: + mesh: A TPU mesh. + client_id: Optional; A DTensor client ID. If empty, query this client. + """ + + if mesh.device_type() != _TPU_DEVICE_TYPE: + raise ValueError("The mesh must be a TPU mesh") + + if client_id is None or client_id == config.client_id(): + return mesh.local_device_ids() + + # It's not clear we should ever allow a client to query other clients for + # their device IDs. + raise NotImplementedError( + "Looking up other clients' device IDs is not supported") + + +def get_device_locations( + mesh: layout_lib.Mesh, + client_id: Optional[int] = None) -> List[Dict[str, int]]: + """Returns the device locations of all TPU cores local to the given client. + + A device location is a dictionary from dimension names to indices on those + dimensions. For example, for a 2x2 mesh ('x', 'y'), this function returns a + permutation of this list: + + [{'x': 0, 'y': 0}, + {'x': 0, 'y': 1}, + {'x': 1, 'y': 0}, + {'x': 1, 'y': 1}]. + + Note that device IDs and device locations are equivalent. The former is a + linearization of the latter along mesh dimensions. + + Args: + mesh: A TPU mesh. + client_id: Optional; A DTensor client ID. If empty, query this client. + """ + + if mesh.device_type() != _TPU_DEVICE_TYPE: + raise ValueError("The mesh must be a TPU mesh") + + if client_id is None or client_id == config.client_id(): + return mesh.local_device_locations() + + # It's not clear we should ever allow a client to query other clients for + # their device locations. + raise NotImplementedError( + "Looking up other clients' device locations is not supported") + + +# TODO(b/245589661): Remove dtensor_initialize_tpu_system() and +# dtensor_shutdown_tpu_system() after users stopped using them. +def dtensor_initialize_tpu_system(enable_coordination_service=False): + """Deprecated way to initialize the TPU system.""" + from . import accelerator_util # pylint: disable=g-import-not-at-top + accelerator_util.initialize_accelerator_system( + "TPU", enable_coordination_service=enable_coordination_service) + + +def dtensor_shutdown_tpu_system(): + """Deprecated way to shutodwn the TPU system.""" + from . import accelerator_util # pylint: disable=g-import-not-at-top + accelerator_util.shutdown_accelerator_system() diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/AccelerateSupport b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/AccelerateSupport new file mode 100644 index 0000000000000000000000000000000000000000..e16f36b9e507ac46dc4c5707d365739fccc18ca6 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/AccelerateSupport @@ -0,0 +1,52 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_ACCELERATESUPPORT_MODULE_H +#define EIGEN_ACCELERATESUPPORT_MODULE_H + +#include "SparseCore" + +#include "src/Core/util/DisableStupidWarnings.h" + +/** \ingroup Support_modules + * \defgroup AccelerateSupport_Module AccelerateSupport module + * + * This module provides an interface to the Apple Accelerate library. + * It provides the seven following main factorization classes: + * - class AccelerateLLT: a Cholesky (LL^T) factorization. + * - class AccelerateLDLT: the default LDL^T factorization. + * - class AccelerateLDLTUnpivoted: a Cholesky-like LDL^T factorization with only 1x1 pivots and no pivoting + * - class AccelerateLDLTSBK: an LDL^T factorization with Supernode Bunch-Kaufman and static pivoting + * - class AccelerateLDLTTPP: an LDL^T factorization with full threshold partial pivoting + * - class AccelerateQR: a QR factorization + * - class AccelerateCholeskyAtA: a QR factorization without storing Q (equivalent to A^TA = R^T R) + * + * \code + * #include + * \endcode + * + * In order to use this module, the Accelerate headers must be accessible from + * the include paths, and your binary must be linked to the Accelerate framework. + * The Accelerate library is only available on Apple hardware. + * + * Note that many of the algorithms can be influenced by the UpLo template + * argument. All matrices are assumed to be symmetric. For example, the following + * creates an LDLT factorization where your matrix is symmetric (implicit) and + * uses the lower triangle: + * + * \code + * AccelerateLDLT, Lower> ldlt; + * \endcode + */ + +// IWYU pragma: begin_exports +#include "src/AccelerateSupport/AccelerateSupport.h" +// IWYU pragma: end_exports + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif // EIGEN_ACCELERATESUPPORT_MODULE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/Cholesky b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/Cholesky new file mode 100644 index 0000000000000000000000000000000000000000..4211151d458d9adcb7f9299c45e50cc19f61f32f --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/Cholesky @@ -0,0 +1,43 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_CHOLESKY_MODULE_H +#define EIGEN_CHOLESKY_MODULE_H + +#include "Core" +#include "Jacobi" + +#include "src/Core/util/DisableStupidWarnings.h" + +/** \defgroup Cholesky_Module Cholesky module + * + * + * + * This module provides two variants of the Cholesky decomposition for selfadjoint (hermitian) matrices. + * Those decompositions are also accessible via the following methods: + * - MatrixBase::llt() + * - MatrixBase::ldlt() + * - SelfAdjointView::llt() + * - SelfAdjointView::ldlt() + * + * \code + * #include + * \endcode + */ + +// IWYU pragma: begin_exports +#include "src/Cholesky/LLT.h" +#include "src/Cholesky/LDLT.h" +#ifdef EIGEN_USE_LAPACKE +#include "src/misc/lapacke_helpers.h" +#include "src/Cholesky/LLT_LAPACKE.h" +#endif +// IWYU pragma: end_exports + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif // EIGEN_CHOLESKY_MODULE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/CholmodSupport b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/CholmodSupport new file mode 100644 index 0000000000000000000000000000000000000000..2ccb21143a4f56aa943797309159277343fed954 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/CholmodSupport @@ -0,0 +1,50 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_CHOLMODSUPPORT_MODULE_H +#define EIGEN_CHOLMODSUPPORT_MODULE_H + +#include "SparseCore" + +#include "src/Core/util/DisableStupidWarnings.h" + +extern "C" { + #include +} + +/** \ingroup Support_modules + * \defgroup CholmodSupport_Module CholmodSupport module + * + * This module provides an interface to the Cholmod library which is part of the suitesparse package. + * It provides the two following main factorization classes: + * - class CholmodSupernodalLLT: a supernodal LLT Cholesky factorization. + * - class CholmodDecomposition: a general L(D)LT Cholesky factorization with automatic or explicit runtime selection of the underlying factorization method (supernodal or simplicial). + * + * For the sake of completeness, this module also propose the two following classes: + * - class CholmodSimplicialLLT + * - class CholmodSimplicialLDLT + * Note that these classes does not bring any particular advantage compared to the built-in + * SimplicialLLT and SimplicialLDLT factorization classes. + * + * \code + * #include + * \endcode + * + * In order to use this module, the cholmod headers must be accessible from the include paths, and your binary must be linked to the cholmod library and its dependencies. + * The dependencies depend on how cholmod has been compiled. + * For a cmake based project, you can use our FindCholmod.cmake module to help you in this task. + * + */ + +// IWYU pragma: begin_exports +#include "src/CholmodSupport/CholmodSupport.h" +// IWYU pragma: end_exports + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif // EIGEN_CHOLMODSUPPORT_MODULE_H + diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/Core b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/Core new file mode 100644 index 0000000000000000000000000000000000000000..93d47890a38bf83f64da6a48d6cbfb95de7f84c9 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/Core @@ -0,0 +1,413 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008 Gael Guennebaud +// Copyright (C) 2007-2011 Benoit Jacob +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_CORE_MODULE_H +#define EIGEN_CORE_MODULE_H + +// first thing Eigen does: stop the compiler from reporting useless warnings. +#include "src/Core/util/DisableStupidWarnings.h" + +// then include this file where all our macros are defined. It's really important to do it first because +// it's where we do all the compiler/OS/arch detections and define most defaults. +#include "src/Core/util/Macros.h" + +// This detects SSE/AVX/NEON/etc. and configure alignment settings +#include "src/Core/util/ConfigureVectorization.h" + +// We need cuda_runtime.h/hip_runtime.h to ensure that +// the EIGEN_USING_STD macro works properly on the device side +#if defined(EIGEN_CUDACC) + #include +#elif defined(EIGEN_HIPCC) + #include +#endif + + +#ifdef EIGEN_EXCEPTIONS + #include +#endif + +// Disable the ipa-cp-clone optimization flag with MinGW 6.x or older (enabled by default with -O3) +// See http://eigen.tuxfamily.org/bz/show_bug.cgi?id=556 for details. +#if EIGEN_COMP_MINGW && EIGEN_GNUC_STRICT_LESS_THAN(6,0,0) + #pragma GCC optimize ("-fno-ipa-cp-clone") +#endif + +// Prevent ICC from specializing std::complex operators that silently fail +// on device. This allows us to use our own device-compatible specializations +// instead. +#if EIGEN_COMP_ICC && defined(EIGEN_GPU_COMPILE_PHASE) \ + && !defined(_OVERRIDE_COMPLEX_SPECIALIZATION_) +#define _OVERRIDE_COMPLEX_SPECIALIZATION_ 1 +#endif +#include + +// this include file manages BLAS and MKL related macros +// and inclusion of their respective header files +#include "src/Core/util/MKL_support.h" + + +#if defined(EIGEN_HAS_CUDA_FP16) || defined(EIGEN_HAS_HIP_FP16) + #define EIGEN_HAS_GPU_FP16 +#endif + +#if defined(EIGEN_HAS_CUDA_BF16) || defined(EIGEN_HAS_HIP_BF16) + #define EIGEN_HAS_GPU_BF16 +#endif + +#if (defined _OPENMP) && (!defined EIGEN_DONT_PARALLELIZE) + #define EIGEN_HAS_OPENMP +#endif + +#ifdef EIGEN_HAS_OPENMP +#include +#include +#endif + +// MSVC for windows mobile does not have the errno.h file +#if !(EIGEN_COMP_MSVC && EIGEN_OS_WINCE) && !EIGEN_COMP_ARM +#define EIGEN_HAS_ERRNO +#endif + +#ifdef EIGEN_HAS_ERRNO +#include +#endif +#include +#include +#include +#include +#ifndef EIGEN_NO_IO + #include + #include +#endif +#include +#include +#include +#include // for CHAR_BIT +// for min/max: +#include + +#include +#include + +// for std::is_nothrow_move_assignable +#include + +// for outputting debug info +#ifdef EIGEN_DEBUG_ASSIGN +#include +#endif + +// required for __cpuid, needs to be included after cmath +// also required for _BitScanReverse on Windows on ARM +#if EIGEN_COMP_MSVC && (EIGEN_ARCH_i386_OR_x86_64 || EIGEN_ARCH_ARM64) && !EIGEN_OS_WINCE + #include +#endif + +#if defined(EIGEN_USE_SYCL) + #undef min + #undef max + #undef isnan + #undef isinf + #undef isfinite + #include + #include + #include + #include + #include + #ifndef EIGEN_SYCL_LOCAL_THREAD_DIM0 + #define EIGEN_SYCL_LOCAL_THREAD_DIM0 16 + #endif + #ifndef EIGEN_SYCL_LOCAL_THREAD_DIM1 + #define EIGEN_SYCL_LOCAL_THREAD_DIM1 16 + #endif +#endif + + +#if defined EIGEN2_SUPPORT_STAGE40_FULL_EIGEN3_STRICTNESS || defined EIGEN2_SUPPORT_STAGE30_FULL_EIGEN3_API || defined EIGEN2_SUPPORT_STAGE20_RESOLVE_API_CONFLICTS || defined EIGEN2_SUPPORT_STAGE10_FULL_EIGEN2_API || defined EIGEN2_SUPPORT +// This will generate an error message: +#error Eigen2-support is only available up to version 3.2. Please go to "http://eigen.tuxfamily.org/index.php?title=Eigen2" for further information +#endif + +namespace Eigen { + +// we use size_t frequently and we'll never remember to prepend it with std:: every time just to +// ensure QNX/QCC support +using std::size_t; +// gcc 4.6.0 wants std:: for ptrdiff_t +using std::ptrdiff_t; + +} + +/** \defgroup Core_Module Core module + * This is the main module of Eigen providing dense matrix and vector support + * (both fixed and dynamic size) with all the features corresponding to a BLAS library + * and much more... + * + * \code + * #include + * \endcode + */ + +#ifdef EIGEN_USE_LAPACKE + #ifdef EIGEN_USE_MKL + #include "mkl_lapacke.h" + #else + #include "src/misc/lapacke.h" + #endif +#endif + +// IWYU pragma: begin_exports +#include "src/Core/util/Constants.h" +#include "src/Core/util/Meta.h" +#include "src/Core/util/Assert.h" +#include "src/Core/util/ForwardDeclarations.h" +#include "src/Core/util/StaticAssert.h" +#include "src/Core/util/XprHelper.h" +#include "src/Core/util/Memory.h" +#include "src/Core/util/IntegralConstant.h" +#include "src/Core/util/Serializer.h" +#include "src/Core/util/SymbolicIndex.h" +#include "src/Core/util/EmulateArray.h" +#include "src/Core/util/MoreMeta.h" + +#include "src/Core/NumTraits.h" +#include "src/Core/MathFunctions.h" +#include "src/Core/GenericPacketMath.h" +#include "src/Core/MathFunctionsImpl.h" +#include "src/Core/arch/Default/ConjHelper.h" +// Generic half float support +#include "src/Core/arch/Default/Half.h" +#include "src/Core/arch/Default/BFloat16.h" +#include "src/Core/arch/Default/GenericPacketMathFunctionsFwd.h" + +#if defined EIGEN_VECTORIZE_AVX512 + #if defined EIGEN_VECTORIZE_AVX512FP16 + #include "src/Core/arch/AVX512/PacketMathFP16.h" + #endif + #include "src/Core/arch/SSE/PacketMath.h" + #include "src/Core/arch/SSE/TypeCasting.h" + #include "src/Core/arch/SSE/Complex.h" + #include "src/Core/arch/AVX/PacketMath.h" + #include "src/Core/arch/AVX/TypeCasting.h" + #include "src/Core/arch/AVX/Complex.h" + #include "src/Core/arch/AVX512/PacketMath.h" + #include "src/Core/arch/AVX512/TypeCasting.h" + #include "src/Core/arch/AVX512/Complex.h" + #include "src/Core/arch/SSE/MathFunctions.h" + #include "src/Core/arch/AVX/MathFunctions.h" + #include "src/Core/arch/AVX512/MathFunctions.h" + #include "src/Core/arch/AVX512/TrsmKernel.h" +#elif defined EIGEN_VECTORIZE_AVX + // Use AVX for floats and doubles, SSE for integers + #include "src/Core/arch/SSE/PacketMath.h" + #include "src/Core/arch/SSE/TypeCasting.h" + #include "src/Core/arch/SSE/Complex.h" + #include "src/Core/arch/AVX/PacketMath.h" + #include "src/Core/arch/AVX/TypeCasting.h" + #include "src/Core/arch/AVX/Complex.h" + #include "src/Core/arch/SSE/MathFunctions.h" + #include "src/Core/arch/AVX/MathFunctions.h" +#elif defined EIGEN_VECTORIZE_SSE + #include "src/Core/arch/SSE/PacketMath.h" + #include "src/Core/arch/SSE/TypeCasting.h" + #include "src/Core/arch/SSE/MathFunctions.h" + #include "src/Core/arch/SSE/Complex.h" +#elif defined(EIGEN_VECTORIZE_ALTIVEC) || defined(EIGEN_VECTORIZE_VSX) + #include "src/Core/arch/AltiVec/PacketMath.h" + #include "src/Core/arch/AltiVec/TypeCasting.h" + #include "src/Core/arch/AltiVec/MathFunctions.h" + #include "src/Core/arch/AltiVec/Complex.h" +#elif defined EIGEN_VECTORIZE_NEON + #include "src/Core/arch/NEON/PacketMath.h" + #include "src/Core/arch/NEON/TypeCasting.h" + #include "src/Core/arch/NEON/MathFunctions.h" + #include "src/Core/arch/NEON/Complex.h" +#elif defined EIGEN_VECTORIZE_SVE + #include "src/Core/arch/SVE/PacketMath.h" + #include "src/Core/arch/SVE/TypeCasting.h" + #include "src/Core/arch/SVE/MathFunctions.h" +#elif defined EIGEN_VECTORIZE_ZVECTOR + #include "src/Core/arch/ZVector/PacketMath.h" + #include "src/Core/arch/ZVector/MathFunctions.h" + #include "src/Core/arch/ZVector/Complex.h" +#elif defined EIGEN_VECTORIZE_MSA + #include "src/Core/arch/MSA/PacketMath.h" + #include "src/Core/arch/MSA/MathFunctions.h" + #include "src/Core/arch/MSA/Complex.h" +#elif defined EIGEN_VECTORIZE_HVX + #include "src/Core/arch/HVX/PacketMath.h" +#endif + +#if defined EIGEN_VECTORIZE_GPU + #include "src/Core/arch/GPU/PacketMath.h" + #include "src/Core/arch/GPU/MathFunctions.h" + #include "src/Core/arch/GPU/TypeCasting.h" +#endif + +#if defined(EIGEN_USE_SYCL) + #include "src/Core/arch/SYCL/InteropHeaders.h" +#if !defined(EIGEN_DONT_VECTORIZE_SYCL) + #include "src/Core/arch/SYCL/PacketMath.h" + #include "src/Core/arch/SYCL/MathFunctions.h" + #include "src/Core/arch/SYCL/TypeCasting.h" +#endif +#endif + +#include "src/Core/arch/Default/Settings.h" +// This file provides generic implementations valid for scalar as well +#include "src/Core/arch/Default/GenericPacketMathFunctions.h" + +#include "src/Core/functors/TernaryFunctors.h" +#include "src/Core/functors/BinaryFunctors.h" +#include "src/Core/functors/UnaryFunctors.h" +#include "src/Core/functors/NullaryFunctors.h" +#include "src/Core/functors/StlFunctors.h" +#include "src/Core/functors/AssignmentFunctors.h" + +// Specialized functors for GPU. +#ifdef EIGEN_GPUCC +#include "src/Core/arch/GPU/Complex.h" +#endif + +// Specializations of vectorized activation functions for NEON. +#ifdef EIGEN_VECTORIZE_NEON +#include "src/Core/arch/NEON/UnaryFunctors.h" +#endif + +#include "src/Core/util/IndexedViewHelper.h" +#include "src/Core/util/ReshapedHelper.h" +#include "src/Core/ArithmeticSequence.h" +#ifndef EIGEN_NO_IO + #include "src/Core/IO.h" +#endif +#include "src/Core/DenseCoeffsBase.h" +#include "src/Core/DenseBase.h" +#include "src/Core/MatrixBase.h" +#include "src/Core/EigenBase.h" + +#include "src/Core/Product.h" +#include "src/Core/CoreEvaluators.h" +#include "src/Core/AssignEvaluator.h" + +#ifndef EIGEN_PARSED_BY_DOXYGEN // work around Doxygen bug triggered by Assign.h r814874 + // at least confirmed with Doxygen 1.5.5 and 1.5.6 + #include "src/Core/Assign.h" +#endif + +#include "src/Core/ArrayBase.h" +#include "src/Core/util/BlasUtil.h" +#include "src/Core/DenseStorage.h" +#include "src/Core/NestByValue.h" + +// #include "src/Core/ForceAlignedAccess.h" + +#include "src/Core/ReturnByValue.h" +#include "src/Core/NoAlias.h" +#include "src/Core/PlainObjectBase.h" +#include "src/Core/Matrix.h" +#include "src/Core/Array.h" +#include "src/Core/CwiseTernaryOp.h" +#include "src/Core/CwiseBinaryOp.h" +#include "src/Core/CwiseUnaryOp.h" +#include "src/Core/CwiseNullaryOp.h" +#include "src/Core/CwiseUnaryView.h" +#include "src/Core/SelfCwiseBinaryOp.h" +#include "src/Core/Dot.h" +#include "src/Core/StableNorm.h" +#include "src/Core/Stride.h" +#include "src/Core/MapBase.h" +#include "src/Core/Map.h" +#include "src/Core/Ref.h" +#include "src/Core/Block.h" +#include "src/Core/VectorBlock.h" +#include "src/Core/IndexedView.h" +#include "src/Core/Reshaped.h" +#include "src/Core/Transpose.h" +#include "src/Core/DiagonalMatrix.h" +#include "src/Core/Diagonal.h" +#include "src/Core/DiagonalProduct.h" +#include "src/Core/SkewSymmetricMatrix3.h" +#include "src/Core/Redux.h" +#include "src/Core/Visitor.h" +#include "src/Core/Fuzzy.h" +#include "src/Core/Swap.h" +#include "src/Core/CommaInitializer.h" +#include "src/Core/GeneralProduct.h" +#include "src/Core/Solve.h" +#include "src/Core/Inverse.h" +#include "src/Core/SolverBase.h" +#include "src/Core/PermutationMatrix.h" +#include "src/Core/Transpositions.h" +#include "src/Core/TriangularMatrix.h" +#include "src/Core/SelfAdjointView.h" +#include "src/Core/products/GeneralBlockPanelKernel.h" +#include "src/Core/products/Parallelizer.h" +#include "src/Core/ProductEvaluators.h" +#include "src/Core/products/GeneralMatrixVector.h" +#include "src/Core/products/GeneralMatrixMatrix.h" +#include "src/Core/SolveTriangular.h" +#include "src/Core/products/GeneralMatrixMatrixTriangular.h" +#include "src/Core/products/SelfadjointMatrixVector.h" +#include "src/Core/products/SelfadjointMatrixMatrix.h" +#include "src/Core/products/SelfadjointProduct.h" +#include "src/Core/products/SelfadjointRank2Update.h" +#include "src/Core/products/TriangularMatrixVector.h" +#include "src/Core/products/TriangularMatrixMatrix.h" +#include "src/Core/products/TriangularSolverMatrix.h" +#include "src/Core/products/TriangularSolverVector.h" +#include "src/Core/BandMatrix.h" +#include "src/Core/CoreIterators.h" +#include "src/Core/ConditionEstimator.h" + +#if defined(EIGEN_VECTORIZE_VSX) + #include "src/Core/arch/AltiVec/MatrixProduct.h" +#elif defined EIGEN_VECTORIZE_NEON + #include "src/Core/arch/NEON/GeneralBlockPanelKernel.h" +#endif + +#if defined(EIGEN_VECTORIZE_AVX512) + #include "src/Core/arch/AVX512/GemmKernel.h" +#endif + +#if defined(EIGEN_VECTORIZE_HVX) + #include "src/Core/arch/HVX/GeneralBlockPanelKernel.h" +#endif + +#include "src/Core/Select.h" +#include "src/Core/VectorwiseOp.h" +#include "src/Core/PartialReduxEvaluator.h" +#include "src/Core/Random.h" +#include "src/Core/Replicate.h" +#include "src/Core/Reverse.h" +#include "src/Core/ArrayWrapper.h" +#include "src/Core/StlIterators.h" + +#ifdef EIGEN_USE_BLAS +#include "src/Core/products/GeneralMatrixMatrix_BLAS.h" +#include "src/Core/products/GeneralMatrixVector_BLAS.h" +#include "src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h" +#include "src/Core/products/SelfadjointMatrixMatrix_BLAS.h" +#include "src/Core/products/SelfadjointMatrixVector_BLAS.h" +#include "src/Core/products/TriangularMatrixMatrix_BLAS.h" +#include "src/Core/products/TriangularMatrixVector_BLAS.h" +#include "src/Core/products/TriangularSolverMatrix_BLAS.h" +#endif // EIGEN_USE_BLAS + +#ifdef EIGEN_USE_MKL_VML +#include "src/Core/Assign_MKL.h" +#endif + +#include "src/Core/GlobalFunctions.h" +// IWYU pragma: end_exports + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif // EIGEN_CORE_MODULE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/Dense b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/Dense new file mode 100644 index 0000000000000000000000000000000000000000..5768910bd88c43f0761f2f345c6f0e3b46a4d8ec --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/Dense @@ -0,0 +1,7 @@ +#include "Core" +#include "LU" +#include "Cholesky" +#include "QR" +#include "SVD" +#include "Geometry" +#include "Eigenvalues" diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/Eigen b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/Eigen new file mode 100644 index 0000000000000000000000000000000000000000..654c8dc6380f7bb21d3ba1a9ce916006043552aa --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/Eigen @@ -0,0 +1,2 @@ +#include "Dense" +#include "Sparse" diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/Eigenvalues b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/Eigenvalues new file mode 100644 index 0000000000000000000000000000000000000000..97c526d91b37f5011e64b1f15dcc5c3cb8ab6ad6 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/Eigenvalues @@ -0,0 +1,63 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_EIGENVALUES_MODULE_H +#define EIGEN_EIGENVALUES_MODULE_H + +#include "Core" + +#include "Cholesky" +#include "Jacobi" +#include "Householder" +#include "LU" +#include "Geometry" + +#include "src/Core/util/DisableStupidWarnings.h" + +/** \defgroup Eigenvalues_Module Eigenvalues module + * + * + * + * This module mainly provides various eigenvalue solvers. + * This module also provides some MatrixBase methods, including: + * - MatrixBase::eigenvalues(), + * - MatrixBase::operatorNorm() + * + * \code + * #include + * \endcode + */ + +#include "src/misc/RealSvd2x2.h" + +// IWYU pragma: begin_exports +#include "src/Eigenvalues/Tridiagonalization.h" +#include "src/Eigenvalues/RealSchur.h" +#include "src/Eigenvalues/EigenSolver.h" +#include "src/Eigenvalues/SelfAdjointEigenSolver.h" +#include "src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h" +#include "src/Eigenvalues/HessenbergDecomposition.h" +#include "src/Eigenvalues/ComplexSchur.h" +#include "src/Eigenvalues/ComplexEigenSolver.h" +#include "src/Eigenvalues/RealQZ.h" +#include "src/Eigenvalues/GeneralizedEigenSolver.h" +#include "src/Eigenvalues/MatrixBaseEigenvalues.h" +#ifdef EIGEN_USE_LAPACKE +#ifdef EIGEN_USE_MKL +#include "mkl_lapacke.h" +#else +#include "src/misc/lapacke.h" +#endif +#include "src/Eigenvalues/RealSchur_LAPACKE.h" +#include "src/Eigenvalues/ComplexSchur_LAPACKE.h" +#include "src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h" +#endif +// IWYU pragma: end_exports + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif // EIGEN_EIGENVALUES_MODULE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/Geometry b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/Geometry new file mode 100644 index 0000000000000000000000000000000000000000..0a733c5ecbc3111552098bf9db74274b9f15ca0a --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/Geometry @@ -0,0 +1,60 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_GEOMETRY_MODULE_H +#define EIGEN_GEOMETRY_MODULE_H + +#include "Core" + +#include "SVD" +#include "LU" +#include + +#include "src/Core/util/DisableStupidWarnings.h" + +/** \defgroup Geometry_Module Geometry module + * + * This module provides support for: + * - fixed-size homogeneous transformations + * - translation, scaling, 2D and 3D rotations + * - \link Quaternion quaternions \endlink + * - cross products (\ref MatrixBase::cross, \ref MatrixBase::cross3) + * - orthognal vector generation (\ref MatrixBase::unitOrthogonal) + * - some linear components: \link ParametrizedLine parametrized-lines \endlink and \link Hyperplane hyperplanes \endlink + * - \link AlignedBox axis aligned bounding boxes \endlink + * - \link umeyama least-square transformation fitting \endlink + * + * \code + * #include + * \endcode + */ + +// IWYU pragma: begin_exports +#include "src/Geometry/OrthoMethods.h" +#include "src/Geometry/EulerAngles.h" +#include "src/Geometry/Homogeneous.h" +#include "src/Geometry/RotationBase.h" +#include "src/Geometry/Rotation2D.h" +#include "src/Geometry/Quaternion.h" +#include "src/Geometry/AngleAxis.h" +#include "src/Geometry/Transform.h" +#include "src/Geometry/Translation.h" +#include "src/Geometry/Scaling.h" +#include "src/Geometry/Hyperplane.h" +#include "src/Geometry/ParametrizedLine.h" +#include "src/Geometry/AlignedBox.h" +#include "src/Geometry/Umeyama.h" + +// Use the SSE optimized version whenever possible. +#if (defined EIGEN_VECTORIZE_SSE) || (defined EIGEN_VECTORIZE_NEON) +#include "src/Geometry/arch/Geometry_SIMD.h" +#endif +// IWYU pragma: end_exports + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif // EIGEN_GEOMETRY_MODULE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/Householder b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/Householder new file mode 100644 index 0000000000000000000000000000000000000000..0f7f9b3d33e7541c6a57423fbdc759e99ecb41f4 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/Householder @@ -0,0 +1,31 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_HOUSEHOLDER_MODULE_H +#define EIGEN_HOUSEHOLDER_MODULE_H + +#include "Core" + +#include "src/Core/util/DisableStupidWarnings.h" + +/** \defgroup Householder_Module Householder module + * This module provides Householder transformations. + * + * \code + * #include + * \endcode + */ + +// IWYU pragma: begin_exports +#include "src/Householder/Householder.h" +#include "src/Householder/HouseholderSequence.h" +#include "src/Householder/BlockHouseholder.h" +// IWYU pragma: end_exports + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif // EIGEN_HOUSEHOLDER_MODULE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/IterativeLinearSolvers b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/IterativeLinearSolvers new file mode 100644 index 0000000000000000000000000000000000000000..833189b132df7d1840c54b711ff3af11336b198e --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/IterativeLinearSolvers @@ -0,0 +1,50 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_ITERATIVELINEARSOLVERS_MODULE_H +#define EIGEN_ITERATIVELINEARSOLVERS_MODULE_H + +#include "SparseCore" +#include "OrderingMethods" + +#include "src/Core/util/DisableStupidWarnings.h" + +/** + * \defgroup IterativeLinearSolvers_Module IterativeLinearSolvers module + * + * This module currently provides iterative methods to solve problems of the form \c A \c x = \c b, where \c A is a squared matrix, usually very large and sparse. + * Those solvers are accessible via the following classes: + * - ConjugateGradient for selfadjoint (hermitian) matrices, + * - LeastSquaresConjugateGradient for rectangular least-square problems, + * - BiCGSTAB for general square matrices. + * + * These iterative solvers are associated with some preconditioners: + * - IdentityPreconditioner - not really useful + * - DiagonalPreconditioner - also called Jacobi preconditioner, work very well on diagonal dominant matrices. + * - IncompleteLUT - incomplete LU factorization with dual thresholding + * + * Such problems can also be solved using the direct sparse decomposition modules: SparseCholesky, CholmodSupport, UmfPackSupport, SuperLUSupport, AccelerateSupport. + * + \code + #include + \endcode + */ + +// IWYU pragma: begin_exports +#include "src/IterativeLinearSolvers/SolveWithGuess.h" +#include "src/IterativeLinearSolvers/IterativeSolverBase.h" +#include "src/IterativeLinearSolvers/BasicPreconditioners.h" +#include "src/IterativeLinearSolvers/ConjugateGradient.h" +#include "src/IterativeLinearSolvers/LeastSquareConjugateGradient.h" +#include "src/IterativeLinearSolvers/BiCGSTAB.h" +#include "src/IterativeLinearSolvers/IncompleteLUT.h" +#include "src/IterativeLinearSolvers/IncompleteCholesky.h" +// IWYU pragma: end_exports + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif // EIGEN_ITERATIVELINEARSOLVERS_MODULE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/Jacobi b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/Jacobi new file mode 100644 index 0000000000000000000000000000000000000000..490a6a8c57e12613b08e3411e677451df669659e --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/Jacobi @@ -0,0 +1,34 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_JACOBI_MODULE_H +#define EIGEN_JACOBI_MODULE_H + +#include "Core" + +#include "src/Core/util/DisableStupidWarnings.h" + +/** \defgroup Jacobi_Module Jacobi module + * This module provides Jacobi and Givens rotations. + * + * \code + * #include + * \endcode + * + * In addition to listed classes, it defines the two following MatrixBase methods to apply a Jacobi or Givens rotation: + * - MatrixBase::applyOnTheLeft() + * - MatrixBase::applyOnTheRight(). + */ + +// IWYU pragma: begin_exports +#include "src/Jacobi/Jacobi.h" +// IWYU pragma: end_exports + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif // EIGEN_JACOBI_MODULE_H + diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/KLUSupport b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/KLUSupport new file mode 100644 index 0000000000000000000000000000000000000000..5c8f8a34c43fc77de8d50a6a22287c49d8d079e7 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/KLUSupport @@ -0,0 +1,43 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_KLUSUPPORT_MODULE_H +#define EIGEN_KLUSUPPORT_MODULE_H + +#include "SparseCore" + +#include "src/Core/util/DisableStupidWarnings.h" + +extern "C" { +#include +#include + } + +/** \ingroup Support_modules + * \defgroup KLUSupport_Module KLUSupport module + * + * This module provides an interface to the KLU library which is part of the suitesparse package. + * It provides the following factorization class: + * - class KLU: a sparse LU factorization, well-suited for circuit simulation. + * + * \code + * #include + * \endcode + * + * In order to use this module, the klu and btf headers must be accessible from the include paths, and your binary must be linked to the klu library and its dependencies. + * The dependencies depend on how umfpack has been compiled. + * For a cmake based project, you can use our FindKLU.cmake module to help you in this task. + * + */ + +// IWYU pragma: begin_exports +#include "src/KLUSupport/KLUSupport.h" +// IWYU pragma: end_exports + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif // EIGEN_KLUSUPPORT_MODULE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/LU b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/LU new file mode 100644 index 0000000000000000000000000000000000000000..49d7b91fe051bca6fdb210bddb6b5fb9183e4d66 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/LU @@ -0,0 +1,46 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_LU_MODULE_H +#define EIGEN_LU_MODULE_H + +#include "Core" + +#include "src/Core/util/DisableStupidWarnings.h" + +/** \defgroup LU_Module LU module + * This module includes %LU decomposition and related notions such as matrix inversion and determinant. + * This module defines the following MatrixBase methods: + * - MatrixBase::inverse() + * - MatrixBase::determinant() + * + * \code + * #include + * \endcode + */ + +#include "src/misc/Kernel.h" +#include "src/misc/Image.h" + +// IWYU pragma: begin_exports +#include "src/LU/FullPivLU.h" +#include "src/LU/PartialPivLU.h" +#ifdef EIGEN_USE_LAPACKE +#include "src/misc/lapacke_helpers.h" +#include "src/LU/PartialPivLU_LAPACKE.h" +#endif +#include "src/LU/Determinant.h" +#include "src/LU/InverseImpl.h" + +#if defined EIGEN_VECTORIZE_SSE || defined EIGEN_VECTORIZE_NEON + #include "src/LU/arch/InverseSize4.h" +#endif +// IWYU pragma: end_exports + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif // EIGEN_LU_MODULE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/MetisSupport b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/MetisSupport new file mode 100644 index 0000000000000000000000000000000000000000..e74c3bb6ad7398217000ba43823697040711a96c --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/MetisSupport @@ -0,0 +1,36 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_METISSUPPORT_MODULE_H +#define EIGEN_METISSUPPORT_MODULE_H + +#include "SparseCore" + +#include "src/Core/util/DisableStupidWarnings.h" + +extern "C" { +#include +} + + +/** \ingroup Support_modules + * \defgroup MetisSupport_Module MetisSupport module + * + * \code + * #include + * \endcode + * This module defines an interface to the METIS reordering package (http://glaros.dtc.umn.edu/gkhome/views/metis). + * It can be used just as any other built-in method as explained in \link OrderingMethods_Module here. \endlink + */ + +// IWYU pragma: begin_exports +#include "src/MetisSupport/MetisSupport.h" +// IWYU pragma: end_exports + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif // EIGEN_METISSUPPORT_MODULE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/OrderingMethods b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/OrderingMethods new file mode 100644 index 0000000000000000000000000000000000000000..5031de7a520be1b50d4e3afec97f787388b9a532 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/OrderingMethods @@ -0,0 +1,73 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_ORDERINGMETHODS_MODULE_H +#define EIGEN_ORDERINGMETHODS_MODULE_H + +#include "SparseCore" + +#include "src/Core/util/DisableStupidWarnings.h" + +/** + * \defgroup OrderingMethods_Module OrderingMethods module + * + * This module is currently for internal use only + * + * It defines various built-in and external ordering methods for sparse matrices. + * They are typically used to reduce the number of elements during + * the sparse matrix decomposition (LLT, LU, QR). + * Precisely, in a preprocessing step, a permutation matrix P is computed using + * those ordering methods and applied to the columns of the matrix. + * Using for instance the sparse Cholesky decomposition, it is expected that + * the nonzeros elements in LLT(A*P) will be much smaller than that in LLT(A). + * + * + * Usage : + * \code + * #include + * \endcode + * + * A simple usage is as a template parameter in the sparse decomposition classes : + * + * \code + * SparseLU > solver; + * \endcode + * + * \code + * SparseQR > solver; + * \endcode + * + * It is possible as well to call directly a particular ordering method for your own purpose, + * \code + * AMDOrdering ordering; + * PermutationMatrix perm; + * SparseMatrix A; + * //Fill the matrix ... + * + * ordering(A, perm); // Call AMD + * \endcode + * + * \note Some of these methods (like AMD or METIS), need the sparsity pattern + * of the input matrix to be symmetric. When the matrix is structurally unsymmetric, + * Eigen computes internally the pattern of \f$A^T*A\f$ before calling the method. + * If your matrix is already symmetric (at leat in structure), you can avoid that + * by calling the method with a SelfAdjointView type. + * + * \code + * // Call the ordering on the pattern of the lower triangular matrix A + * ordering(A.selfadjointView(), perm); + * \endcode + */ + +// IWYU pragma: begin_exports +#include "src/OrderingMethods/Amd.h" +#include "src/OrderingMethods/Ordering.h" +// IWYU pragma: end_exports + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif // EIGEN_ORDERINGMETHODS_MODULE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/PaStiXSupport b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/PaStiXSupport new file mode 100644 index 0000000000000000000000000000000000000000..5d3cb38fdf3e198099bb572a0a8373b425d4bf33 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/PaStiXSupport @@ -0,0 +1,51 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_PASTIXSUPPORT_MODULE_H +#define EIGEN_PASTIXSUPPORT_MODULE_H + +#include "SparseCore" + +#include "src/Core/util/DisableStupidWarnings.h" + +extern "C" { +#include +#include +} + +#ifdef complex +#undef complex +#endif + +/** \ingroup Support_modules + * \defgroup PaStiXSupport_Module PaStiXSupport module + * + * This module provides an interface to the PaSTiX library. + * PaSTiX is a general \b supernodal, \b parallel and \b opensource sparse solver. + * It provides the two following main factorization classes: + * - class PastixLLT : a supernodal, parallel LLt Cholesky factorization. + * - class PastixLDLT: a supernodal, parallel LDLt Cholesky factorization. + * - class PastixLU : a supernodal, parallel LU factorization (optimized for a symmetric pattern). + * + * \code + * #include + * \endcode + * + * In order to use this module, the PaSTiX headers must be accessible from the include paths, and your binary must be linked to the PaSTiX library and its dependencies. + * This wrapper resuires PaStiX version 5.x compiled without MPI support. + * The dependencies depend on how PaSTiX has been compiled. + * For a cmake based project, you can use our FindPaSTiX.cmake module to help you in this task. + * + */ + +// IWYU pragma: begin_exports +#include "src/PaStiXSupport/PaStiXSupport.h" +// IWYU pragma: end_exports + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif // EIGEN_PASTIXSUPPORT_MODULE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/PardisoSupport b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/PardisoSupport new file mode 100644 index 0000000000000000000000000000000000000000..c022ce1fb3bd2ad903a504dc1b549587d2fcf01f --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/PardisoSupport @@ -0,0 +1,37 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_PARDISOSUPPORT_MODULE_H +#define EIGEN_PARDISOSUPPORT_MODULE_H + +#include "SparseCore" + +#include "src/Core/util/DisableStupidWarnings.h" + +#include + +/** \ingroup Support_modules + * \defgroup PardisoSupport_Module PardisoSupport module + * + * This module brings support for the Intel(R) MKL PARDISO direct sparse solvers. + * + * \code + * #include + * \endcode + * + * In order to use this module, the MKL headers must be accessible from the include paths, and your binary must be linked to the MKL library and its dependencies. + * See this \ref TopicUsingIntelMKL "page" for more information on MKL-Eigen integration. + * + */ + +// IWYU pragma: begin_exports +#include "src/PardisoSupport/PardisoSupport.h" +// IWYU pragma: end_exports + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif // EIGEN_PARDISOSUPPORT_MODULE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/QR b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/QR new file mode 100644 index 0000000000000000000000000000000000000000..2f57a602bc9bca54f359c6650a6b6d8fd2ba4e52 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/QR @@ -0,0 +1,48 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_QR_MODULE_H +#define EIGEN_QR_MODULE_H + +#include "Core" + +#include "Cholesky" +#include "Jacobi" +#include "Householder" + +#include "src/Core/util/DisableStupidWarnings.h" + +/** \defgroup QR_Module QR module + * + * + * + * This module provides various QR decompositions + * This module also provides some MatrixBase methods, including: + * - MatrixBase::householderQr() + * - MatrixBase::colPivHouseholderQr() + * - MatrixBase::fullPivHouseholderQr() + * + * \code + * #include + * \endcode + */ + +// IWYU pragma: begin_exports +#include "src/QR/HouseholderQR.h" +#include "src/QR/FullPivHouseholderQR.h" +#include "src/QR/ColPivHouseholderQR.h" +#include "src/QR/CompleteOrthogonalDecomposition.h" +#ifdef EIGEN_USE_LAPACKE +#include "src/misc/lapacke_helpers.h" +#include "src/QR/HouseholderQR_LAPACKE.h" +#include "src/QR/ColPivHouseholderQR_LAPACKE.h" +#endif +// IWYU pragma: end_exports + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif // EIGEN_QR_MODULE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/QtAlignedMalloc b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/QtAlignedMalloc new file mode 100644 index 0000000000000000000000000000000000000000..6fe82374a5ebdb0dbc17fa6e0119b1a399f126e3 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/QtAlignedMalloc @@ -0,0 +1,39 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_QTMALLOC_MODULE_H +#define EIGEN_QTMALLOC_MODULE_H + +#include "Core" + +#if (!EIGEN_MALLOC_ALREADY_ALIGNED) + +#include "src/Core/util/DisableStupidWarnings.h" + +void *qMalloc(std::size_t size) +{ + return Eigen::internal::aligned_malloc(size); +} + +void qFree(void *ptr) +{ + Eigen::internal::aligned_free(ptr); +} + +void *qRealloc(void *ptr, std::size_t size) +{ + void* newPtr = Eigen::internal::aligned_malloc(size); + std::memcpy(newPtr, ptr, size); + Eigen::internal::aligned_free(ptr); + return newPtr; +} + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif + +#endif // EIGEN_QTMALLOC_MODULE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/SPQRSupport b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/SPQRSupport new file mode 100644 index 0000000000000000000000000000000000000000..a25f5ef9f0137ed1c541e3c7d1e4c433b81376eb --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/SPQRSupport @@ -0,0 +1,39 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_SPQRSUPPORT_MODULE_H +#define EIGEN_SPQRSUPPORT_MODULE_H + +#include "SparseCore" + +#include "src/Core/util/DisableStupidWarnings.h" + +#include "SuiteSparseQR.hpp" + +/** \ingroup Support_modules + * \defgroup SPQRSupport_Module SuiteSparseQR module + * + * This module provides an interface to the SPQR library, which is part of the suitesparse package. + * + * \code + * #include + * \endcode + * + * In order to use this module, the SPQR headers must be accessible from the include paths, and your binary must be linked to the SPQR library and its dependencies (Cholmod, AMD, COLAMD,...). + * For a cmake based project, you can use our FindSPQR.cmake and FindCholmod.Cmake modules + * + */ + +#include "CholmodSupport" + +// IWYU pragma: begin_exports +#include "src/SPQRSupport/SuiteSparseQRSupport.h" +// IWYU pragma: end_exports + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/SVD b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/SVD new file mode 100644 index 0000000000000000000000000000000000000000..b13ec2fb1caef34127ff2dc9dcf6fed5e35a5121 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/SVD @@ -0,0 +1,55 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_SVD_MODULE_H +#define EIGEN_SVD_MODULE_H + +#include "QR" +#include "Householder" +#include "Jacobi" + +#include "src/Core/util/DisableStupidWarnings.h" + +/** \defgroup SVD_Module SVD module + * + * + * + * This module provides SVD decomposition for matrices (both real and complex). + * Two decomposition algorithms are provided: + * - JacobiSVD implementing two-sided Jacobi iterations is numerically very accurate, fast for small matrices, but very slow for larger ones. + * - BDCSVD implementing a recursive divide & conquer strategy on top of an upper-bidiagonalization which remains fast for large problems. + * These decompositions are accessible via the respective classes and following MatrixBase methods: + * - MatrixBase::jacobiSvd() + * - MatrixBase::bdcSvd() + * + * \code + * #include + * \endcode + */ + +// IWYU pragma: begin_exports +#include "src/misc/RealSvd2x2.h" +#include "src/SVD/UpperBidiagonalization.h" +#include "src/SVD/SVDBase.h" +#include "src/SVD/JacobiSVD.h" +#include "src/SVD/BDCSVD.h" +#ifdef EIGEN_USE_LAPACKE +#ifdef EIGEN_USE_MKL +#include "mkl_lapacke.h" +#else +#include "src/misc/lapacke.h" +#endif +#ifndef EIGEN_USE_LAPACKE_STRICT +#include "src/SVD/JacobiSVD_LAPACKE.h" +#endif +#include "src/SVD/BDCSVD_LAPACKE.h" +#endif +// IWYU pragma: end_exports + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif // EIGEN_SVD_MODULE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/Sparse b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/Sparse new file mode 100644 index 0000000000000000000000000000000000000000..a2ef7a66526812617c782f76dea260f04593ea58 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/Sparse @@ -0,0 +1,34 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_SPARSE_MODULE_H +#define EIGEN_SPARSE_MODULE_H + +/** \defgroup Sparse_Module Sparse meta-module + * + * Meta-module including all related modules: + * - \ref SparseCore_Module + * - \ref OrderingMethods_Module + * - \ref SparseCholesky_Module + * - \ref SparseLU_Module + * - \ref SparseQR_Module + * - \ref IterativeLinearSolvers_Module + * + \code + #include + \endcode + */ + +#include "SparseCore" +#include "OrderingMethods" +#include "SparseCholesky" +#include "SparseLU" +#include "SparseQR" +#include "IterativeLinearSolvers" + +#endif // EIGEN_SPARSE_MODULE_H + diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/SparseCholesky b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/SparseCholesky new file mode 100644 index 0000000000000000000000000000000000000000..967196f049e60b901d83e2aaaf76d135338ec9bf --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/SparseCholesky @@ -0,0 +1,40 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008-2013 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_SPARSECHOLESKY_MODULE_H +#define EIGEN_SPARSECHOLESKY_MODULE_H + +#include "SparseCore" +#include "OrderingMethods" + +#include "src/Core/util/DisableStupidWarnings.h" + +/** + * \defgroup SparseCholesky_Module SparseCholesky module + * + * This module currently provides two variants of the direct sparse Cholesky decomposition for selfadjoint (hermitian) matrices. + * Those decompositions are accessible via the following classes: + * - SimplicialLLt, + * - SimplicialLDLt + * + * Such problems can also be solved using the ConjugateGradient solver from the IterativeLinearSolvers module. + * + * \code + * #include + * \endcode + */ + +// IWYU pragma: begin_exports +#include "src/SparseCholesky/SimplicialCholesky.h" +#include "src/SparseCholesky/SimplicialCholesky_impl.h" +// IWYU pragma: end_exports + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif // EIGEN_SPARSECHOLESKY_MODULE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/SparseCore b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/SparseCore new file mode 100644 index 0000000000000000000000000000000000000000..292b08910299db137b7e88e51390cc8dde3aae14 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/SparseCore @@ -0,0 +1,71 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_SPARSECORE_MODULE_H +#define EIGEN_SPARSECORE_MODULE_H + +#include "Core" + +#include "src/Core/util/DisableStupidWarnings.h" + +#include +#include +#include +#include +#include +#include + +/** + * \defgroup SparseCore_Module SparseCore module + * + * This module provides a sparse matrix representation, and basic associated matrix manipulations + * and operations. + * + * See the \ref TutorialSparse "Sparse tutorial" + * + * \code + * #include + * \endcode + * + * This module depends on: Core. + */ + +// IWYU pragma: begin_exports +#include "src/SparseCore/SparseUtil.h" +#include "src/SparseCore/SparseMatrixBase.h" +#include "src/SparseCore/SparseAssign.h" +#include "src/SparseCore/CompressedStorage.h" +#include "src/SparseCore/AmbiVector.h" +#include "src/SparseCore/SparseCompressedBase.h" +#include "src/SparseCore/SparseMatrix.h" +#include "src/SparseCore/SparseMap.h" +#include "src/SparseCore/SparseVector.h" +#include "src/SparseCore/SparseRef.h" +#include "src/SparseCore/SparseCwiseUnaryOp.h" +#include "src/SparseCore/SparseCwiseBinaryOp.h" +#include "src/SparseCore/SparseTranspose.h" +#include "src/SparseCore/SparseBlock.h" +#include "src/SparseCore/SparseDot.h" +#include "src/SparseCore/SparseRedux.h" +#include "src/SparseCore/SparseView.h" +#include "src/SparseCore/SparseDiagonalProduct.h" +#include "src/SparseCore/ConservativeSparseSparseProduct.h" +#include "src/SparseCore/SparseSparseProductWithPruning.h" +#include "src/SparseCore/SparseProduct.h" +#include "src/SparseCore/SparseDenseProduct.h" +#include "src/SparseCore/SparseSelfAdjointView.h" +#include "src/SparseCore/SparseTriangularView.h" +#include "src/SparseCore/TriangularSolver.h" +#include "src/SparseCore/SparsePermutation.h" +#include "src/SparseCore/SparseFuzzy.h" +#include "src/SparseCore/SparseSolverBase.h" +// IWYU pragma: end_exports + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif // EIGEN_SPARSECORE_MODULE_H + diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/SparseLU b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/SparseLU new file mode 100644 index 0000000000000000000000000000000000000000..9ec6ac73571cbaf9cb5fe0113a45b8fd5b8922b3 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/SparseLU @@ -0,0 +1,50 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2012 Désiré Nuentsa-Wakam +// Copyright (C) 2012 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_SPARSELU_MODULE_H +#define EIGEN_SPARSELU_MODULE_H + +#include "SparseCore" + +/** + * \defgroup SparseLU_Module SparseLU module + * This module defines a supernodal factorization of general sparse matrices. + * The code is fully optimized for supernode-panel updates with specialized kernels. + * Please, see the documentation of the SparseLU class for more details. + */ + +// Ordering interface +#include "OrderingMethods" + +#include "src/Core/util/DisableStupidWarnings.h" + +// IWYU pragma: begin_exports +#include "src/SparseLU/SparseLU_Structs.h" +#include "src/SparseLU/SparseLU_SupernodalMatrix.h" +#include "src/SparseLU/SparseLUImpl.h" +#include "src/SparseCore/SparseColEtree.h" +#include "src/SparseLU/SparseLU_Memory.h" +#include "src/SparseLU/SparseLU_heap_relax_snode.h" +#include "src/SparseLU/SparseLU_relax_snode.h" +#include "src/SparseLU/SparseLU_pivotL.h" +#include "src/SparseLU/SparseLU_panel_dfs.h" +#include "src/SparseLU/SparseLU_kernel_bmod.h" +#include "src/SparseLU/SparseLU_panel_bmod.h" +#include "src/SparseLU/SparseLU_column_dfs.h" +#include "src/SparseLU/SparseLU_column_bmod.h" +#include "src/SparseLU/SparseLU_copy_to_ucol.h" +#include "src/SparseLU/SparseLU_pruneL.h" +#include "src/SparseLU/SparseLU_Utils.h" +#include "src/SparseLU/SparseLU.h" +// IWYU pragma: end_exports + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif // EIGEN_SPARSELU_MODULE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/SparseQR b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/SparseQR new file mode 100644 index 0000000000000000000000000000000000000000..4bc144ccdae50d0ee15e85a98da9037fda3d872f --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/SparseQR @@ -0,0 +1,38 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_SPARSEQR_MODULE_H +#define EIGEN_SPARSEQR_MODULE_H + +#include "SparseCore" +#include "OrderingMethods" +#include "src/Core/util/DisableStupidWarnings.h" + +/** \defgroup SparseQR_Module SparseQR module + * \brief Provides QR decomposition for sparse matrices + * + * This module provides a simplicial version of the left-looking Sparse QR decomposition. + * The columns of the input matrix should be reordered to limit the fill-in during the + * decomposition. Built-in methods (COLAMD, AMD) or external methods (METIS) can be used to this end. + * See the \link OrderingMethods_Module OrderingMethods\endlink module for the list + * of built-in and external ordering methods. + * + * \code + * #include + * \endcode + * + * + */ + +// IWYU pragma: begin_exports +#include "src/SparseCore/SparseColEtree.h" +#include "src/SparseQR/SparseQR.h" +// IWYU pragma: end_exports + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/StdDeque b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/StdDeque new file mode 100644 index 0000000000000000000000000000000000000000..29550e2a72c8038bb84903b2c85a57bf020f6ed5 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/StdDeque @@ -0,0 +1,29 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2009 Gael Guennebaud +// Copyright (C) 2009 Hauke Heibel +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_STDDEQUE_MODULE_H +#define EIGEN_STDDEQUE_MODULE_H + +#include "Core" +#include + +#if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */ + +#define EIGEN_DEFINE_STL_DEQUE_SPECIALIZATION(...) + +#else + +// IWYU pragma: begin_exports +#include "src/StlSupport/StdDeque.h" +// IWYU pragma: end_exports + +#endif + +#endif // EIGEN_STDDEQUE_MODULE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/StdList b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/StdList new file mode 100644 index 0000000000000000000000000000000000000000..8a22fc8f1069fbceb9b17dcd463bf9178c332faf --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/StdList @@ -0,0 +1,28 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2009 Hauke Heibel +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_STDLIST_MODULE_H +#define EIGEN_STDLIST_MODULE_H + +#include "Core" +#include + +#if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */ + +#define EIGEN_DEFINE_STL_LIST_SPECIALIZATION(...) + +#else + +// IWYU pragma: begin_exports +#include "src/StlSupport/StdList.h" +// IWYU pragma: end_exports + +#endif + +#endif // EIGEN_STDLIST_MODULE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/StdVector b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/StdVector new file mode 100644 index 0000000000000000000000000000000000000000..e68f6b5b8ac585ae9ae58074b9f20c55d30c56b1 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/StdVector @@ -0,0 +1,29 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2009 Gael Guennebaud +// Copyright (C) 2009 Hauke Heibel +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_STDVECTOR_MODULE_H +#define EIGEN_STDVECTOR_MODULE_H + +#include "Core" +#include + +#if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */ + +#define EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(...) + +#else + +// IWYU pragma: begin_exports +#include "src/StlSupport/StdVector.h" +// IWYU pragma: end_exports + +#endif + +#endif // EIGEN_STDVECTOR_MODULE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/SuperLUSupport b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/SuperLUSupport new file mode 100644 index 0000000000000000000000000000000000000000..33997fa503674b580bd8844cda9277f90ccec903 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/SuperLUSupport @@ -0,0 +1,66 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_SUPERLUSUPPORT_MODULE_H +#define EIGEN_SUPERLUSUPPORT_MODULE_H + +#include "SparseCore" + +#include "src/Core/util/DisableStupidWarnings.h" + +#ifdef EMPTY +#define EIGEN_EMPTY_WAS_ALREADY_DEFINED +#endif + +typedef int int_t; +#include +#include +#include + +// slu_util.h defines a preprocessor token named EMPTY which is really polluting, +// so we remove it in favor of a SUPERLU_EMPTY token. +// If EMPTY was already defined then we don't undef it. + +#if defined(EIGEN_EMPTY_WAS_ALREADY_DEFINED) +# undef EIGEN_EMPTY_WAS_ALREADY_DEFINED +#elif defined(EMPTY) +# undef EMPTY +#endif + +#define SUPERLU_EMPTY (-1) + +namespace Eigen { struct SluMatrix; } + +/** \ingroup Support_modules + * \defgroup SuperLUSupport_Module SuperLUSupport module + * + * This module provides an interface to the SuperLU library. + * It provides the following factorization class: + * - class SuperLU: a supernodal sequential LU factorization. + * - class SuperILU: a supernodal sequential incomplete LU factorization (to be used as a preconditioner for iterative methods). + * + * \warning This wrapper requires at least versions 4.0 of SuperLU. The 3.x versions are not supported. + * + * \warning When including this module, you have to use SUPERLU_EMPTY instead of EMPTY which is no longer defined because it is too polluting. + * + * \code + * #include + * \endcode + * + * In order to use this module, the superlu headers must be accessible from the include paths, and your binary must be linked to the superlu library and its dependencies. + * The dependencies depend on how superlu has been compiled. + * For a cmake based project, you can use our FindSuperLU.cmake module to help you in this task. + * + */ + +// IWYU pragma: begin_exports +#include "src/SuperLUSupport/SuperLUSupport.h" +// IWYU pragma: end_exports + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif // EIGEN_SUPERLUSUPPORT_MODULE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/ThreadPool b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/ThreadPool new file mode 100644 index 0000000000000000000000000000000000000000..9be594f8a6453a610872eef151fd5262e6b5a6fe --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/ThreadPool @@ -0,0 +1,78 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2016 Benoit Steiner +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_THREADPOOL_MODULE_H +#define EIGEN_THREADPOOL_MODULE_H + +#include "Core" + +#include "src/Core/util/DisableStupidWarnings.h" + +/** \defgroup ThreadPool_Module ThreadPool Module + * + * This module provides 2 threadpool implementations + * - a simple reference implementation + * - a faster non blocking implementation + * + * \code + * #include + * \endcode + */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// There are non-parenthesized calls to "max" in the header, +// which trigger a check in test/main.h causing compilation to fail. +// We work around the check here by removing the check for max in +// the case where we have to emulate thread_local. +#ifdef max +#undef max +#endif +#include + +#include "src/Core/util/Meta.h" +#include "src/Core/util/MaxSizeVector.h" + +#ifndef EIGEN_MUTEX +#define EIGEN_MUTEX std::mutex +#endif +#ifndef EIGEN_MUTEX_LOCK +#define EIGEN_MUTEX_LOCK std::unique_lock +#endif +#ifndef EIGEN_CONDVAR +#define EIGEN_CONDVAR std::condition_variable +#endif + +// IWYU pragma: begin_exports +#include "src/ThreadPool/ThreadLocal.h" +#include "src/ThreadPool/ThreadYield.h" +#include "src/ThreadPool/ThreadCancel.h" +#include "src/ThreadPool/EventCount.h" +#include "src/ThreadPool/RunQueue.h" +#include "src/ThreadPool/ThreadPoolInterface.h" +#include "src/ThreadPool/ThreadEnvironment.h" +#include "src/ThreadPool/Barrier.h" +#include "src/ThreadPool/NonBlockingThreadPool.h" +// IWYU pragma: end_exports + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif // EIGEN_CXX11_THREADPOOL_MODULE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/UmfPackSupport b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/UmfPackSupport new file mode 100644 index 0000000000000000000000000000000000000000..eea150eedcbf662911e7547577f64e47fceeca8a --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/UmfPackSupport @@ -0,0 +1,42 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_UMFPACKSUPPORT_MODULE_H +#define EIGEN_UMFPACKSUPPORT_MODULE_H + +#include "SparseCore" + +#include "src/Core/util/DisableStupidWarnings.h" + +extern "C" { +#include +} + +/** \ingroup Support_modules + * \defgroup UmfPackSupport_Module UmfPackSupport module + * + * This module provides an interface to the UmfPack library which is part of the suitesparse package. + * It provides the following factorization class: + * - class UmfPackLU: a multifrontal sequential LU factorization. + * + * \code + * #include + * \endcode + * + * In order to use this module, the umfpack headers must be accessible from the include paths, and your binary must be linked to the umfpack library and its dependencies. + * The dependencies depend on how umfpack has been compiled. + * For a cmake based project, you can use our FindUmfPack.cmake module to help you in this task. + * + */ + +// IWYU pragma: begin_exports +#include "src/UmfPackSupport/UmfPackSupport.h" +// IWYU pragma: endexports + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif // EIGEN_UMFPACKSUPPORT_MODULE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/AccelerateSupport/AccelerateSupport.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/AccelerateSupport/AccelerateSupport.h new file mode 100644 index 0000000000000000000000000000000000000000..0417688b0c04c8f7c7df1e58cb04495ac11e60f8 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/AccelerateSupport/AccelerateSupport.h @@ -0,0 +1,421 @@ +#ifndef EIGEN_ACCELERATESUPPORT_H +#define EIGEN_ACCELERATESUPPORT_H + +#include + +#include + +namespace Eigen { + +template +class AccelerateImpl; + +/** \ingroup AccelerateSupport_Module + * \class AccelerateLLT + * \brief A direct Cholesky (LLT) factorization and solver based on Accelerate + * + * \warning Only single and double precision real scalar types are supported by Accelerate + * + * \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<> + * \tparam UpLo_ additional information about the matrix structure. Default is Lower. + * + * \sa \ref TutorialSparseSolverConcept, class AccelerateLLT + */ +template +using AccelerateLLT = AccelerateImpl; + +/** \ingroup AccelerateSupport_Module + * \class AccelerateLDLT + * \brief The default Cholesky (LDLT) factorization and solver based on Accelerate + * + * \warning Only single and double precision real scalar types are supported by Accelerate + * + * \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<> + * \tparam UpLo_ additional information about the matrix structure. Default is Lower. + * + * \sa \ref TutorialSparseSolverConcept, class AccelerateLDLT + */ +template +using AccelerateLDLT = AccelerateImpl; + +/** \ingroup AccelerateSupport_Module + * \class AccelerateLDLTUnpivoted + * \brief A direct Cholesky-like LDL^T factorization and solver based on Accelerate with only 1x1 pivots and no pivoting + * + * \warning Only single and double precision real scalar types are supported by Accelerate + * + * \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<> + * \tparam UpLo_ additional information about the matrix structure. Default is Lower. + * + * \sa \ref TutorialSparseSolverConcept, class AccelerateLDLTUnpivoted + */ +template +using AccelerateLDLTUnpivoted = AccelerateImpl; + +/** \ingroup AccelerateSupport_Module + * \class AccelerateLDLTSBK + * \brief A direct Cholesky (LDLT) factorization and solver based on Accelerate with Supernode Bunch-Kaufman and static pivoting + * + * \warning Only single and double precision real scalar types are supported by Accelerate + * + * \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<> + * \tparam UpLo_ additional information about the matrix structure. Default is Lower. + * + * \sa \ref TutorialSparseSolverConcept, class AccelerateLDLTSBK + */ +template +using AccelerateLDLTSBK = AccelerateImpl; + +/** \ingroup AccelerateSupport_Module + * \class AccelerateLDLTTPP + * \brief A direct Cholesky (LDLT) factorization and solver based on Accelerate with full threshold partial pivoting + * + * \warning Only single and double precision real scalar types are supported by Accelerate + * + * \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<> + * \tparam UpLo_ additional information about the matrix structure. Default is Lower. + * + * \sa \ref TutorialSparseSolverConcept, class AccelerateLDLTTPP + */ +template +using AccelerateLDLTTPP = AccelerateImpl; + +/** \ingroup AccelerateSupport_Module + * \class AccelerateQR + * \brief A QR factorization and solver based on Accelerate + * + * \warning Only single and double precision real scalar types are supported by Accelerate + * + * \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<> + * + * \sa \ref TutorialSparseSolverConcept, class AccelerateQR + */ +template +using AccelerateQR = AccelerateImpl; + +/** \ingroup AccelerateSupport_Module + * \class AccelerateCholeskyAtA + * \brief A QR factorization and solver based on Accelerate without storing Q (equivalent to A^TA = R^T R) + * + * \warning Only single and double precision real scalar types are supported by Accelerate + * + * \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<> + * + * \sa \ref TutorialSparseSolverConcept, class AccelerateCholeskyAtA + */ +template +using AccelerateCholeskyAtA = AccelerateImpl; + +namespace internal { +template +struct AccelFactorizationDeleter { + void operator()(T* sym) { + if (sym) { + SparseCleanup(*sym); + delete sym; + sym = nullptr; + } + } +}; + +template +struct SparseTypesTraitBase { + typedef DenseVecT AccelDenseVector; + typedef DenseMatT AccelDenseMatrix; + typedef SparseMatT AccelSparseMatrix; + + typedef SparseOpaqueSymbolicFactorization SymbolicFactorization; + typedef NumFactT NumericFactorization; + + typedef AccelFactorizationDeleter SymbolicFactorizationDeleter; + typedef AccelFactorizationDeleter NumericFactorizationDeleter; +}; + +template +struct SparseTypesTrait {}; + +template <> +struct SparseTypesTrait : SparseTypesTraitBase {}; + +template <> +struct SparseTypesTrait + : SparseTypesTraitBase { +}; + +} // end namespace internal + +template +class AccelerateImpl : public SparseSolverBase > { + protected: + using Base = SparseSolverBase; + using Base::derived; + using Base::m_isInitialized; + + public: + using Base::_solve_impl; + + typedef MatrixType_ MatrixType; + typedef typename MatrixType::Scalar Scalar; + typedef typename MatrixType::StorageIndex StorageIndex; + enum { ColsAtCompileTime = Dynamic, MaxColsAtCompileTime = Dynamic }; + enum { UpLo = UpLo_ }; + + using AccelDenseVector = typename internal::SparseTypesTrait::AccelDenseVector; + using AccelDenseMatrix = typename internal::SparseTypesTrait::AccelDenseMatrix; + using AccelSparseMatrix = typename internal::SparseTypesTrait::AccelSparseMatrix; + using SymbolicFactorization = typename internal::SparseTypesTrait::SymbolicFactorization; + using NumericFactorization = typename internal::SparseTypesTrait::NumericFactorization; + using SymbolicFactorizationDeleter = typename internal::SparseTypesTrait::SymbolicFactorizationDeleter; + using NumericFactorizationDeleter = typename internal::SparseTypesTrait::NumericFactorizationDeleter; + + AccelerateImpl() { + m_isInitialized = false; + + auto check_flag_set = [](int value, int flag) { return ((value & flag) == flag); }; + + if (check_flag_set(UpLo_, Symmetric)) { + m_sparseKind = SparseSymmetric; + m_triType = (UpLo_ & Lower) ? SparseLowerTriangle : SparseUpperTriangle; + } else if (check_flag_set(UpLo_, UnitLower)) { + m_sparseKind = SparseUnitTriangular; + m_triType = SparseLowerTriangle; + } else if (check_flag_set(UpLo_, UnitUpper)) { + m_sparseKind = SparseUnitTriangular; + m_triType = SparseUpperTriangle; + } else if (check_flag_set(UpLo_, StrictlyLower)) { + m_sparseKind = SparseTriangular; + m_triType = SparseLowerTriangle; + } else if (check_flag_set(UpLo_, StrictlyUpper)) { + m_sparseKind = SparseTriangular; + m_triType = SparseUpperTriangle; + } else if (check_flag_set(UpLo_, Lower)) { + m_sparseKind = SparseTriangular; + m_triType = SparseLowerTriangle; + } else if (check_flag_set(UpLo_, Upper)) { + m_sparseKind = SparseTriangular; + m_triType = SparseUpperTriangle; + } else { + m_sparseKind = SparseOrdinary; + m_triType = (UpLo_ & Lower) ? SparseLowerTriangle : SparseUpperTriangle; + } + + m_order = SparseOrderDefault; + } + + explicit AccelerateImpl(const MatrixType& matrix) : AccelerateImpl() { compute(matrix); } + + ~AccelerateImpl() {} + + inline Index cols() const { return m_nCols; } + inline Index rows() const { return m_nRows; } + + ComputationInfo info() const { + eigen_assert(m_isInitialized && "Decomposition is not initialized."); + return m_info; + } + + void analyzePattern(const MatrixType& matrix); + + void factorize(const MatrixType& matrix); + + void compute(const MatrixType& matrix); + + template + void _solve_impl(const MatrixBase& b, MatrixBase& dest) const; + + /** Sets the ordering algorithm to use. */ + void setOrder(SparseOrder_t order) { m_order = order; } + + private: + template + void buildAccelSparseMatrix(const SparseMatrix& a, AccelSparseMatrix& A, std::vector& columnStarts) { + const Index nColumnsStarts = a.cols() + 1; + + columnStarts.resize(nColumnsStarts); + + for (Index i = 0; i < nColumnsStarts; i++) columnStarts[i] = a.outerIndexPtr()[i]; + + SparseAttributes_t attributes{}; + attributes.transpose = false; + attributes.triangle = m_triType; + attributes.kind = m_sparseKind; + + SparseMatrixStructure structure{}; + structure.attributes = attributes; + structure.rowCount = static_cast(a.rows()); + structure.columnCount = static_cast(a.cols()); + structure.blockSize = 1; + structure.columnStarts = columnStarts.data(); + structure.rowIndices = const_cast(a.innerIndexPtr()); + + A.structure = structure; + A.data = const_cast(a.valuePtr()); + } + + void doAnalysis(AccelSparseMatrix& A) { + m_numericFactorization.reset(nullptr); + + SparseSymbolicFactorOptions opts{}; + opts.control = SparseDefaultControl; + opts.orderMethod = m_order; + opts.order = nullptr; + opts.ignoreRowsAndColumns = nullptr; + opts.malloc = malloc; + opts.free = free; + opts.reportError = nullptr; + + m_symbolicFactorization.reset(new SymbolicFactorization(SparseFactor(Solver_, A.structure, opts))); + + SparseStatus_t status = m_symbolicFactorization->status; + + updateInfoStatus(status); + + if (status != SparseStatusOK) m_symbolicFactorization.reset(nullptr); + } + + void doFactorization(AccelSparseMatrix& A) { + SparseStatus_t status = SparseStatusReleased; + + if (m_symbolicFactorization) { + m_numericFactorization.reset(new NumericFactorization(SparseFactor(*m_symbolicFactorization, A))); + + status = m_numericFactorization->status; + + if (status != SparseStatusOK) m_numericFactorization.reset(nullptr); + } + + updateInfoStatus(status); + } + + protected: + void updateInfoStatus(SparseStatus_t status) const { + switch (status) { + case SparseStatusOK: + m_info = Success; + break; + case SparseFactorizationFailed: + case SparseMatrixIsSingular: + m_info = NumericalIssue; + break; + case SparseInternalError: + case SparseParameterError: + case SparseStatusReleased: + default: + m_info = InvalidInput; + break; + } + } + + mutable ComputationInfo m_info; + Index m_nRows, m_nCols; + std::unique_ptr m_symbolicFactorization; + std::unique_ptr m_numericFactorization; + SparseKind_t m_sparseKind; + SparseTriangle_t m_triType; + SparseOrder_t m_order; +}; + +/** Computes the symbolic and numeric decomposition of matrix \a a */ +template +void AccelerateImpl::compute(const MatrixType& a) { + if (EnforceSquare_) eigen_assert(a.rows() == a.cols()); + + m_nRows = a.rows(); + m_nCols = a.cols(); + + AccelSparseMatrix A{}; + std::vector columnStarts; + + buildAccelSparseMatrix(a, A, columnStarts); + + doAnalysis(A); + + if (m_symbolicFactorization) doFactorization(A); + + m_isInitialized = true; +} + +/** Performs a symbolic decomposition on the sparsity pattern of matrix \a a. + * + * This function is particularly useful when solving for several problems having the same structure. + * + * \sa factorize() + */ +template +void AccelerateImpl::analyzePattern(const MatrixType& a) { + if (EnforceSquare_) eigen_assert(a.rows() == a.cols()); + + m_nRows = a.rows(); + m_nCols = a.cols(); + + AccelSparseMatrix A{}; + std::vector columnStarts; + + buildAccelSparseMatrix(a, A, columnStarts); + + doAnalysis(A); + + m_isInitialized = true; +} + +/** Performs a numeric decomposition of matrix \a a. + * + * The given matrix must have the same sparsity pattern as the matrix on which the symbolic decomposition has been performed. + * + * \sa analyzePattern() + */ +template +void AccelerateImpl::factorize(const MatrixType& a) { + eigen_assert(m_symbolicFactorization && "You must first call analyzePattern()"); + eigen_assert(m_nRows == a.rows() && m_nCols == a.cols()); + + if (EnforceSquare_) eigen_assert(a.rows() == a.cols()); + + AccelSparseMatrix A{}; + std::vector columnStarts; + + buildAccelSparseMatrix(a, A, columnStarts); + + doFactorization(A); +} + +template +template +void AccelerateImpl::_solve_impl(const MatrixBase& b, + MatrixBase& x) const { + if (!m_numericFactorization) { + m_info = InvalidInput; + return; + } + + eigen_assert(m_nRows == b.rows()); + eigen_assert(((b.cols() == 1) || b.outerStride() == b.rows())); + + SparseStatus_t status = SparseStatusOK; + + Scalar* b_ptr = const_cast(b.derived().data()); + Scalar* x_ptr = const_cast(x.derived().data()); + + AccelDenseMatrix xmat{}; + xmat.attributes = SparseAttributes_t(); + xmat.columnCount = static_cast(x.cols()); + xmat.rowCount = static_cast(x.rows()); + xmat.columnStride = xmat.rowCount; + xmat.data = x_ptr; + + AccelDenseMatrix bmat{}; + bmat.attributes = SparseAttributes_t(); + bmat.columnCount = static_cast(b.cols()); + bmat.rowCount = static_cast(b.rows()); + bmat.columnStride = bmat.rowCount; + bmat.data = b_ptr; + + SparseSolve(*m_numericFactorization, bmat, xmat); + + updateInfoStatus(status); +} + +} // end namespace Eigen + +#endif // EIGEN_ACCELERATESUPPORT_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/AccelerateSupport/InternalHeaderCheck.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/AccelerateSupport/InternalHeaderCheck.h new file mode 100644 index 0000000000000000000000000000000000000000..69bcff50a65b7d856a69b859ba9c23a36771be27 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/AccelerateSupport/InternalHeaderCheck.h @@ -0,0 +1,3 @@ +#ifndef EIGEN_ACCELERATESUPPORT_MODULE_H +#error "Please include Eigen/AccelerateSupport instead of including headers inside the src directory directly." +#endif diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Cholesky/InternalHeaderCheck.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Cholesky/InternalHeaderCheck.h new file mode 100644 index 0000000000000000000000000000000000000000..5de2b219b3f66eaa59773f6d05212c930143856a --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Cholesky/InternalHeaderCheck.h @@ -0,0 +1,3 @@ +#ifndef EIGEN_CHOLESKY_MODULE_H +#error "Please include Eigen/Cholesky instead of including headers inside the src directory directly." +#endif diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Cholesky/LDLT.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Cholesky/LDLT.h new file mode 100644 index 0000000000000000000000000000000000000000..1d0369b65e40c2422b85119eded4f076161416c8 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Cholesky/LDLT.h @@ -0,0 +1,685 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008-2011 Gael Guennebaud +// Copyright (C) 2009 Keir Mierle +// Copyright (C) 2009 Benoit Jacob +// Copyright (C) 2011 Timothy E. Holy +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_LDLT_H +#define EIGEN_LDLT_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { + template struct traits > + : traits + { + typedef MatrixXpr XprKind; + typedef SolverStorage StorageKind; + typedef int StorageIndex; + enum { Flags = 0 }; + }; + + template struct LDLT_Traits; + + // PositiveSemiDef means positive semi-definite and non-zero; same for NegativeSemiDef + enum SignMatrix { PositiveSemiDef, NegativeSemiDef, ZeroSign, Indefinite }; +} + +/** \ingroup Cholesky_Module + * + * \class LDLT + * + * \brief Robust Cholesky decomposition of a matrix with pivoting + * + * \tparam MatrixType_ the type of the matrix of which to compute the LDL^T Cholesky decomposition + * \tparam UpLo_ the triangular part that will be used for the decomposition: Lower (default) or Upper. + * The other triangular part won't be read. + * + * Perform a robust Cholesky decomposition of a positive semidefinite or negative semidefinite + * matrix \f$ A \f$ such that \f$ A = P^TLDL^*P \f$, where P is a permutation matrix, L + * is lower triangular with a unit diagonal and D is a diagonal matrix. + * + * The decomposition uses pivoting to ensure stability, so that D will have + * zeros in the bottom right rank(A) - n submatrix. Avoiding the square root + * on D also stabilizes the computation. + * + * Remember that Cholesky decompositions are not rank-revealing. Also, do not use a Cholesky + * decomposition to determine whether a system of equations has a solution. + * + * This class supports the \link InplaceDecomposition inplace decomposition \endlink mechanism. + * + * \sa MatrixBase::ldlt(), SelfAdjointView::ldlt(), class LLT + */ +template class LDLT + : public SolverBase > +{ + public: + typedef MatrixType_ MatrixType; + typedef SolverBase Base; + friend class SolverBase; + + EIGEN_GENERIC_PUBLIC_INTERFACE(LDLT) + enum { + MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime, + MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime, + UpLo = UpLo_ + }; + typedef Matrix TmpMatrixType; + + typedef Transpositions TranspositionType; + typedef PermutationMatrix PermutationType; + + typedef internal::LDLT_Traits Traits; + + /** \brief Default Constructor. + * + * The default constructor is useful in cases in which the user intends to + * perform decompositions via LDLT::compute(const MatrixType&). + */ + LDLT() + : m_matrix(), + m_transpositions(), + m_sign(internal::ZeroSign), + m_isInitialized(false) + {} + + /** \brief Default Constructor with memory preallocation + * + * Like the default constructor but with preallocation of the internal data + * according to the specified problem \a size. + * \sa LDLT() + */ + explicit LDLT(Index size) + : m_matrix(size, size), + m_transpositions(size), + m_temporary(size), + m_sign(internal::ZeroSign), + m_isInitialized(false) + {} + + /** \brief Constructor with decomposition + * + * This calculates the decomposition for the input \a matrix. + * + * \sa LDLT(Index size) + */ + template + explicit LDLT(const EigenBase& matrix) + : m_matrix(matrix.rows(), matrix.cols()), + m_transpositions(matrix.rows()), + m_temporary(matrix.rows()), + m_sign(internal::ZeroSign), + m_isInitialized(false) + { + compute(matrix.derived()); + } + + /** \brief Constructs a LDLT factorization from a given matrix + * + * This overloaded constructor is provided for \link InplaceDecomposition inplace decomposition \endlink when \c MatrixType is a Eigen::Ref. + * + * \sa LDLT(const EigenBase&) + */ + template + explicit LDLT(EigenBase& matrix) + : m_matrix(matrix.derived()), + m_transpositions(matrix.rows()), + m_temporary(matrix.rows()), + m_sign(internal::ZeroSign), + m_isInitialized(false) + { + compute(matrix.derived()); + } + + /** Clear any existing decomposition + * \sa rankUpdate(w,sigma) + */ + void setZero() + { + m_isInitialized = false; + } + + /** \returns a view of the upper triangular matrix U */ + inline typename Traits::MatrixU matrixU() const + { + eigen_assert(m_isInitialized && "LDLT is not initialized."); + return Traits::getU(m_matrix); + } + + /** \returns a view of the lower triangular matrix L */ + inline typename Traits::MatrixL matrixL() const + { + eigen_assert(m_isInitialized && "LDLT is not initialized."); + return Traits::getL(m_matrix); + } + + /** \returns the permutation matrix P as a transposition sequence. + */ + inline const TranspositionType& transpositionsP() const + { + eigen_assert(m_isInitialized && "LDLT is not initialized."); + return m_transpositions; + } + + /** \returns the coefficients of the diagonal matrix D */ + inline Diagonal vectorD() const + { + eigen_assert(m_isInitialized && "LDLT is not initialized."); + return m_matrix.diagonal(); + } + + /** \returns true if the matrix is positive (semidefinite) */ + inline bool isPositive() const + { + eigen_assert(m_isInitialized && "LDLT is not initialized."); + return m_sign == internal::PositiveSemiDef || m_sign == internal::ZeroSign; + } + + /** \returns true if the matrix is negative (semidefinite) */ + inline bool isNegative(void) const + { + eigen_assert(m_isInitialized && "LDLT is not initialized."); + return m_sign == internal::NegativeSemiDef || m_sign == internal::ZeroSign; + } + + #ifdef EIGEN_PARSED_BY_DOXYGEN + /** \returns a solution x of \f$ A x = b \f$ using the current decomposition of A. + * + * This function also supports in-place solves using the syntax x = decompositionObject.solve(x) . + * + * \note_about_checking_solutions + * + * More precisely, this method solves \f$ A x = b \f$ using the decomposition \f$ A = P^T L D L^* P \f$ + * by solving the systems \f$ P^T y_1 = b \f$, \f$ L y_2 = y_1 \f$, \f$ D y_3 = y_2 \f$, + * \f$ L^* y_4 = y_3 \f$ and \f$ P x = y_4 \f$ in succession. If the matrix \f$ A \f$ is singular, then + * \f$ D \f$ will also be singular (all the other matrices are invertible). In that case, the + * least-square solution of \f$ D y_3 = y_2 \f$ is computed. This does not mean that this function + * computes the least-square solution of \f$ A x = b \f$ if \f$ A \f$ is singular. + * + * \sa MatrixBase::ldlt(), SelfAdjointView::ldlt() + */ + template + inline const Solve + solve(const MatrixBase& b) const; + #endif + + template + bool solveInPlace(MatrixBase &bAndX) const; + + template + LDLT& compute(const EigenBase& matrix); + + /** \returns an estimate of the reciprocal condition number of the matrix of + * which \c *this is the LDLT decomposition. + */ + RealScalar rcond() const + { + eigen_assert(m_isInitialized && "LDLT is not initialized."); + return internal::rcond_estimate_helper(m_l1_norm, *this); + } + + template + LDLT& rankUpdate(const MatrixBase& w, const RealScalar& alpha=1); + + /** \returns the internal LDLT decomposition matrix + * + * TODO: document the storage layout + */ + inline const MatrixType& matrixLDLT() const + { + eigen_assert(m_isInitialized && "LDLT is not initialized."); + return m_matrix; + } + + MatrixType reconstructedMatrix() const; + + /** \returns the adjoint of \c *this, that is, a const reference to the decomposition itself as the underlying matrix is self-adjoint. + * + * This method is provided for compatibility with other matrix decompositions, thus enabling generic code such as: + * \code x = decomposition.adjoint().solve(b) \endcode + */ + const LDLT& adjoint() const { return *this; } + + EIGEN_DEVICE_FUNC inline EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); } + EIGEN_DEVICE_FUNC inline EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); } + + /** \brief Reports whether previous computation was successful. + * + * \returns \c Success if computation was successful, + * \c NumericalIssue if the factorization failed because of a zero pivot. + */ + ComputationInfo info() const + { + eigen_assert(m_isInitialized && "LDLT is not initialized."); + return m_info; + } + + #ifndef EIGEN_PARSED_BY_DOXYGEN + template + void _solve_impl(const RhsType &rhs, DstType &dst) const; + + template + void _solve_impl_transposed(const RhsType &rhs, DstType &dst) const; + #endif + + protected: + + EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar) + + /** \internal + * Used to compute and store the Cholesky decomposition A = L D L^* = U^* D U. + * The strict upper part is used during the decomposition, the strict lower + * part correspond to the coefficients of L (its diagonal is equal to 1 and + * is not stored), and the diagonal entries correspond to D. + */ + MatrixType m_matrix; + RealScalar m_l1_norm; + TranspositionType m_transpositions; + TmpMatrixType m_temporary; + internal::SignMatrix m_sign; + bool m_isInitialized; + ComputationInfo m_info; +}; + +namespace internal { + +template struct ldlt_inplace; + +template<> struct ldlt_inplace +{ + template + static bool unblocked(MatrixType& mat, TranspositionType& transpositions, Workspace& temp, SignMatrix& sign) + { + using std::abs; + typedef typename MatrixType::Scalar Scalar; + typedef typename MatrixType::RealScalar RealScalar; + typedef typename TranspositionType::StorageIndex IndexType; + eigen_assert(mat.rows()==mat.cols()); + const Index size = mat.rows(); + bool found_zero_pivot = false; + bool ret = true; + + if (size <= 1) + { + transpositions.setIdentity(); + if(size==0) sign = ZeroSign; + else if (numext::real(mat.coeff(0,0)) > static_cast(0) ) sign = PositiveSemiDef; + else if (numext::real(mat.coeff(0,0)) < static_cast(0)) sign = NegativeSemiDef; + else sign = ZeroSign; + return true; + } + + for (Index k = 0; k < size; ++k) + { + // Find largest diagonal element + Index index_of_biggest_in_corner; + mat.diagonal().tail(size-k).cwiseAbs().maxCoeff(&index_of_biggest_in_corner); + index_of_biggest_in_corner += k; + + transpositions.coeffRef(k) = IndexType(index_of_biggest_in_corner); + if(k != index_of_biggest_in_corner) + { + // apply the transposition while taking care to consider only + // the lower triangular part + Index s = size-index_of_biggest_in_corner-1; // trailing size after the biggest element + mat.row(k).head(k).swap(mat.row(index_of_biggest_in_corner).head(k)); + mat.col(k).tail(s).swap(mat.col(index_of_biggest_in_corner).tail(s)); + std::swap(mat.coeffRef(k,k),mat.coeffRef(index_of_biggest_in_corner,index_of_biggest_in_corner)); + for(Index i=k+1;i::IsComplex) + mat.coeffRef(index_of_biggest_in_corner,k) = numext::conj(mat.coeff(index_of_biggest_in_corner,k)); + } + + // partition the matrix: + // A00 | - | - + // lu = A10 | A11 | - + // A20 | A21 | A22 + Index rs = size - k - 1; + Block A21(mat,k+1,k,rs,1); + Block A10(mat,k,0,1,k); + Block A20(mat,k+1,0,rs,k); + + if(k>0) + { + temp.head(k) = mat.diagonal().real().head(k).asDiagonal() * A10.adjoint(); + mat.coeffRef(k,k) -= (A10 * temp.head(k)).value(); + if(rs>0) + A21.noalias() -= A20 * temp.head(k); + } + + // In some previous versions of Eigen (e.g., 3.2.1), the scaling was omitted if the pivot + // was smaller than the cutoff value. However, since LDLT is not rank-revealing + // we should only make sure that we do not introduce INF or NaN values. + // Remark that LAPACK also uses 0 as the cutoff value. + RealScalar realAkk = numext::real(mat.coeffRef(k,k)); + bool pivot_is_valid = (abs(realAkk) > RealScalar(0)); + + if(k==0 && !pivot_is_valid) + { + // The entire diagonal is zero, there is nothing more to do + // except filling the transpositions, and checking whether the matrix is zero. + sign = ZeroSign; + for(Index j = 0; j0) && pivot_is_valid) + A21 /= realAkk; + else if(rs>0) + ret = ret && (A21.array()==Scalar(0)).all(); + + if(found_zero_pivot && pivot_is_valid) ret = false; // factorization failed + else if(!pivot_is_valid) found_zero_pivot = true; + + if (sign == PositiveSemiDef) { + if (realAkk < static_cast(0)) sign = Indefinite; + } else if (sign == NegativeSemiDef) { + if (realAkk > static_cast(0)) sign = Indefinite; + } else if (sign == ZeroSign) { + if (realAkk > static_cast(0)) sign = PositiveSemiDef; + else if (realAkk < static_cast(0)) sign = NegativeSemiDef; + } + } + + return ret; + } + + // Reference for the algorithm: Davis and Hager, "Multiple Rank + // Modifications of a Sparse Cholesky Factorization" (Algorithm 1) + // Trivial rearrangements of their computations (Timothy E. Holy) + // allow their algorithm to work for rank-1 updates even if the + // original matrix is not of full rank. + // Here only rank-1 updates are implemented, to reduce the + // requirement for intermediate storage and improve accuracy + template + static bool updateInPlace(MatrixType& mat, MatrixBase& w, const typename MatrixType::RealScalar& sigma=1) + { + using numext::isfinite; + typedef typename MatrixType::Scalar Scalar; + typedef typename MatrixType::RealScalar RealScalar; + + const Index size = mat.rows(); + eigen_assert(mat.cols() == size && w.size()==size); + + RealScalar alpha = 1; + + // Apply the update + for (Index j = 0; j < size; j++) + { + // Check for termination due to an original decomposition of low-rank + if (!(isfinite)(alpha)) + break; + + // Update the diagonal terms + RealScalar dj = numext::real(mat.coeff(j,j)); + Scalar wj = w.coeff(j); + RealScalar swj2 = sigma*numext::abs2(wj); + RealScalar gamma = dj*alpha + swj2; + + mat.coeffRef(j,j) += swj2/alpha; + alpha += swj2/dj; + + + // Update the terms of L + Index rs = size-j-1; + w.tail(rs) -= wj * mat.col(j).tail(rs); + if(!numext::is_exactly_zero(gamma)) + mat.col(j).tail(rs) += (sigma*numext::conj(wj)/gamma)*w.tail(rs); + } + return true; + } + + template + static bool update(MatrixType& mat, const TranspositionType& transpositions, Workspace& tmp, const WType& w, const typename MatrixType::RealScalar& sigma=1) + { + // Apply the permutation to the input w + tmp = transpositions * w; + + return ldlt_inplace::updateInPlace(mat,tmp,sigma); + } +}; + +template<> struct ldlt_inplace +{ + template + static EIGEN_STRONG_INLINE bool unblocked(MatrixType& mat, TranspositionType& transpositions, Workspace& temp, SignMatrix& sign) + { + Transpose matt(mat); + return ldlt_inplace::unblocked(matt, transpositions, temp, sign); + } + + template + static EIGEN_STRONG_INLINE bool update(MatrixType& mat, TranspositionType& transpositions, Workspace& tmp, WType& w, const typename MatrixType::RealScalar& sigma=1) + { + Transpose matt(mat); + return ldlt_inplace::update(matt, transpositions, tmp, w.conjugate(), sigma); + } +}; + +template struct LDLT_Traits +{ + typedef const TriangularView MatrixL; + typedef const TriangularView MatrixU; + static inline MatrixL getL(const MatrixType& m) { return MatrixL(m); } + static inline MatrixU getU(const MatrixType& m) { return MatrixU(m.adjoint()); } +}; + +template struct LDLT_Traits +{ + typedef const TriangularView MatrixL; + typedef const TriangularView MatrixU; + static inline MatrixL getL(const MatrixType& m) { return MatrixL(m.adjoint()); } + static inline MatrixU getU(const MatrixType& m) { return MatrixU(m); } +}; + +} // end namespace internal + +/** Compute / recompute the LDLT decomposition A = L D L^* = U^* D U of \a matrix + */ +template +template +LDLT& LDLT::compute(const EigenBase& a) +{ + eigen_assert(a.rows()==a.cols()); + const Index size = a.rows(); + + m_matrix = a.derived(); + + // Compute matrix L1 norm = max abs column sum. + m_l1_norm = RealScalar(0); + // TODO move this code to SelfAdjointView + for (Index col = 0; col < size; ++col) { + RealScalar abs_col_sum; + if (UpLo_ == Lower) + abs_col_sum = m_matrix.col(col).tail(size - col).template lpNorm<1>() + m_matrix.row(col).head(col).template lpNorm<1>(); + else + abs_col_sum = m_matrix.col(col).head(col).template lpNorm<1>() + m_matrix.row(col).tail(size - col).template lpNorm<1>(); + if (abs_col_sum > m_l1_norm) + m_l1_norm = abs_col_sum; + } + + m_transpositions.resize(size); + m_isInitialized = false; + m_temporary.resize(size); + m_sign = internal::ZeroSign; + + m_info = internal::ldlt_inplace::unblocked(m_matrix, m_transpositions, m_temporary, m_sign) ? Success : NumericalIssue; + + m_isInitialized = true; + return *this; +} + +/** Update the LDLT decomposition: given A = L D L^T, efficiently compute the decomposition of A + sigma w w^T. + * \param w a vector to be incorporated into the decomposition. + * \param sigma a scalar, +1 for updates and -1 for "downdates," which correspond to removing previously-added column vectors. Optional; default value is +1. + * \sa setZero() + */ +template +template +LDLT& LDLT::rankUpdate(const MatrixBase& w, const typename LDLT::RealScalar& sigma) +{ + typedef typename TranspositionType::StorageIndex IndexType; + const Index size = w.rows(); + if (m_isInitialized) + { + eigen_assert(m_matrix.rows()==size); + } + else + { + m_matrix.resize(size,size); + m_matrix.setZero(); + m_transpositions.resize(size); + for (Index i = 0; i < size; i++) + m_transpositions.coeffRef(i) = IndexType(i); + m_temporary.resize(size); + m_sign = sigma>=0 ? internal::PositiveSemiDef : internal::NegativeSemiDef; + m_isInitialized = true; + } + + internal::ldlt_inplace::update(m_matrix, m_transpositions, m_temporary, w, sigma); + + return *this; +} + +#ifndef EIGEN_PARSED_BY_DOXYGEN +template +template +void LDLT::_solve_impl(const RhsType &rhs, DstType &dst) const +{ + _solve_impl_transposed(rhs, dst); +} + +template +template +void LDLT::_solve_impl_transposed(const RhsType &rhs, DstType &dst) const +{ + // dst = P b + dst = m_transpositions * rhs; + + // dst = L^-1 (P b) + // dst = L^-*T (P b) + matrixL().template conjugateIf().solveInPlace(dst); + + // dst = D^-* (L^-1 P b) + // dst = D^-1 (L^-*T P b) + // more precisely, use pseudo-inverse of D (see bug 241) + using std::abs; + const typename Diagonal::RealReturnType vecD(vectorD()); + // In some previous versions, tolerance was set to the max of 1/highest (or rather numeric_limits::min()) + // and the maximal diagonal entry * epsilon as motivated by LAPACK's xGELSS: + // RealScalar tolerance = numext::maxi(vecD.array().abs().maxCoeff() * NumTraits::epsilon(),RealScalar(1) / NumTraits::highest()); + // However, LDLT is not rank revealing, and so adjusting the tolerance wrt to the highest + // diagonal element is not well justified and leads to numerical issues in some cases. + // Moreover, Lapack's xSYTRS routines use 0 for the tolerance. + // Using numeric_limits::min() gives us more robustness to denormals. + RealScalar tolerance = (std::numeric_limits::min)(); + for (Index i = 0; i < vecD.size(); ++i) + { + if(abs(vecD(i)) > tolerance) + dst.row(i) /= vecD(i); + else + dst.row(i).setZero(); + } + + // dst = L^-* (D^-* L^-1 P b) + // dst = L^-T (D^-1 L^-*T P b) + matrixL().transpose().template conjugateIf().solveInPlace(dst); + + // dst = P^T (L^-* D^-* L^-1 P b) = A^-1 b + // dst = P^-T (L^-T D^-1 L^-*T P b) = A^-1 b + dst = m_transpositions.transpose() * dst; +} +#endif + +/** \internal use x = ldlt_object.solve(x); + * + * This is the \em in-place version of solve(). + * + * \param bAndX represents both the right-hand side matrix b and result x. + * + * \returns true always! If you need to check for existence of solutions, use another decomposition like LU, QR, or SVD. + * + * This version avoids a copy when the right hand side matrix b is not + * needed anymore. + * + * \sa LDLT::solve(), MatrixBase::ldlt() + */ +template +template +bool LDLT::solveInPlace(MatrixBase &bAndX) const +{ + eigen_assert(m_isInitialized && "LDLT is not initialized."); + eigen_assert(m_matrix.rows() == bAndX.rows()); + + bAndX = this->solve(bAndX); + + return true; +} + +/** \returns the matrix represented by the decomposition, + * i.e., it returns the product: P^T L D L^* P. + * This function is provided for debug purpose. */ +template +MatrixType LDLT::reconstructedMatrix() const +{ + eigen_assert(m_isInitialized && "LDLT is not initialized."); + const Index size = m_matrix.rows(); + MatrixType res(size,size); + + // P + res.setIdentity(); + res = transpositionsP() * res; + // L^* P + res = matrixU() * res; + // D(L^*P) + res = vectorD().real().asDiagonal() * res; + // L(DL^*P) + res = matrixL() * res; + // P^T (LDL^*P) + res = transpositionsP().transpose() * res; + + return res; +} + +/** \cholesky_module + * \returns the Cholesky decomposition with full pivoting without square root of \c *this + * \sa MatrixBase::ldlt() + */ +template +inline const LDLT::PlainObject, UpLo> +SelfAdjointView::ldlt() const +{ + return LDLT(m_matrix); +} + +/** \cholesky_module + * \returns the Cholesky decomposition with full pivoting without square root of \c *this + * \sa SelfAdjointView::ldlt() + */ +template +inline const LDLT::PlainObject> +MatrixBase::ldlt() const +{ + return LDLT(derived()); +} + +} // end namespace Eigen + +#endif // EIGEN_LDLT_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Cholesky/LLT.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Cholesky/LLT.h new file mode 100644 index 0000000000000000000000000000000000000000..1443eac17e718ac81631407bb3b002d2c2d0e197 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Cholesky/LLT.h @@ -0,0 +1,555 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_LLT_H +#define EIGEN_LLT_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal{ + +template struct traits > + : traits +{ + typedef MatrixXpr XprKind; + typedef SolverStorage StorageKind; + typedef int StorageIndex; + enum { Flags = 0 }; +}; + +template struct LLT_Traits; +} + +/** \ingroup Cholesky_Module + * + * \class LLT + * + * \brief Standard Cholesky decomposition (LL^T) of a matrix and associated features + * + * \tparam MatrixType_ the type of the matrix of which we are computing the LL^T Cholesky decomposition + * \tparam UpLo_ the triangular part that will be used for the decomposition: Lower (default) or Upper. + * The other triangular part won't be read. + * + * This class performs a LL^T Cholesky decomposition of a symmetric, positive definite + * matrix A such that A = LL^* = U^*U, where L is lower triangular. + * + * While the Cholesky decomposition is particularly useful to solve selfadjoint problems like D^*D x = b, + * for that purpose, we recommend the Cholesky decomposition without square root which is more stable + * and even faster. Nevertheless, this standard Cholesky decomposition remains useful in many other + * situations like generalised eigen problems with hermitian matrices. + * + * Remember that Cholesky decompositions are not rank-revealing. This LLT decomposition is only stable on positive definite matrices, + * use LDLT instead for the semidefinite case. Also, do not use a Cholesky decomposition to determine whether a system of equations + * has a solution. + * + * Example: \include LLT_example.cpp + * Output: \verbinclude LLT_example.out + * + * \b Performance: for best performance, it is recommended to use a column-major storage format + * with the Lower triangular part (the default), or, equivalently, a row-major storage format + * with the Upper triangular part. Otherwise, you might get a 20% slowdown for the full factorization + * step, and rank-updates can be up to 3 times slower. + * + * This class supports the \link InplaceDecomposition inplace decomposition \endlink mechanism. + * + * Note that during the decomposition, only the lower (or upper, as defined by UpLo_) triangular part of A is considered. + * Therefore, the strict lower part does not have to store correct values. + * + * \sa MatrixBase::llt(), SelfAdjointView::llt(), class LDLT + */ +template class LLT + : public SolverBase > +{ + public: + typedef MatrixType_ MatrixType; + typedef SolverBase Base; + friend class SolverBase; + + EIGEN_GENERIC_PUBLIC_INTERFACE(LLT) + enum { + MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime + }; + + enum { + PacketSize = internal::packet_traits::size, + AlignmentMask = int(PacketSize)-1, + UpLo = UpLo_ + }; + + typedef internal::LLT_Traits Traits; + + /** + * \brief Default Constructor. + * + * The default constructor is useful in cases in which the user intends to + * perform decompositions via LLT::compute(const MatrixType&). + */ + LLT() : m_matrix(), m_isInitialized(false) {} + + /** \brief Default Constructor with memory preallocation + * + * Like the default constructor but with preallocation of the internal data + * according to the specified problem \a size. + * \sa LLT() + */ + explicit LLT(Index size) : m_matrix(size, size), + m_isInitialized(false) {} + + template + explicit LLT(const EigenBase& matrix) + : m_matrix(matrix.rows(), matrix.cols()), + m_isInitialized(false) + { + compute(matrix.derived()); + } + + /** \brief Constructs a LLT factorization from a given matrix + * + * This overloaded constructor is provided for \link InplaceDecomposition inplace decomposition \endlink when + * \c MatrixType is a Eigen::Ref. + * + * \sa LLT(const EigenBase&) + */ + template + explicit LLT(EigenBase& matrix) + : m_matrix(matrix.derived()), + m_isInitialized(false) + { + compute(matrix.derived()); + } + + /** \returns a view of the upper triangular matrix U */ + inline typename Traits::MatrixU matrixU() const + { + eigen_assert(m_isInitialized && "LLT is not initialized."); + return Traits::getU(m_matrix); + } + + /** \returns a view of the lower triangular matrix L */ + inline typename Traits::MatrixL matrixL() const + { + eigen_assert(m_isInitialized && "LLT is not initialized."); + return Traits::getL(m_matrix); + } + + #ifdef EIGEN_PARSED_BY_DOXYGEN + /** \returns the solution x of \f$ A x = b \f$ using the current decomposition of A. + * + * Since this LLT class assumes anyway that the matrix A is invertible, the solution + * theoretically exists and is unique regardless of b. + * + * Example: \include LLT_solve.cpp + * Output: \verbinclude LLT_solve.out + * + * \sa solveInPlace(), MatrixBase::llt(), SelfAdjointView::llt() + */ + template + inline const Solve + solve(const MatrixBase& b) const; + #endif + + template + void solveInPlace(const MatrixBase &bAndX) const; + + template + LLT& compute(const EigenBase& matrix); + + /** \returns an estimate of the reciprocal condition number of the matrix of + * which \c *this is the Cholesky decomposition. + */ + RealScalar rcond() const + { + eigen_assert(m_isInitialized && "LLT is not initialized."); + eigen_assert(m_info == Success && "LLT failed because matrix appears to be negative"); + return internal::rcond_estimate_helper(m_l1_norm, *this); + } + + /** \returns the LLT decomposition matrix + * + * TODO: document the storage layout + */ + inline const MatrixType& matrixLLT() const + { + eigen_assert(m_isInitialized && "LLT is not initialized."); + return m_matrix; + } + + MatrixType reconstructedMatrix() const; + + + /** \brief Reports whether previous computation was successful. + * + * \returns \c Success if computation was successful, + * \c NumericalIssue if the matrix.appears not to be positive definite. + */ + ComputationInfo info() const + { + eigen_assert(m_isInitialized && "LLT is not initialized."); + return m_info; + } + + /** \returns the adjoint of \c *this, that is, a const reference to the decomposition itself as the underlying matrix is self-adjoint. + * + * This method is provided for compatibility with other matrix decompositions, thus enabling generic code such as: + * \code x = decomposition.adjoint().solve(b) \endcode + */ + const LLT& adjoint() const EIGEN_NOEXCEPT { return *this; } + + inline EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); } + inline EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); } + + template + LLT & rankUpdate(const VectorType& vec, const RealScalar& sigma = 1); + + #ifndef EIGEN_PARSED_BY_DOXYGEN + template + void _solve_impl(const RhsType &rhs, DstType &dst) const; + + template + void _solve_impl_transposed(const RhsType &rhs, DstType &dst) const; + #endif + + protected: + + EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar) + + /** \internal + * Used to compute and store L + * The strict upper part is not used and even not initialized. + */ + MatrixType m_matrix; + RealScalar m_l1_norm; + bool m_isInitialized; + ComputationInfo m_info; +}; + +namespace internal { + +template struct llt_inplace; + +template +static Index llt_rank_update_lower(MatrixType& mat, const VectorType& vec, const typename MatrixType::RealScalar& sigma) +{ + using std::sqrt; + typedef typename MatrixType::Scalar Scalar; + typedef typename MatrixType::RealScalar RealScalar; + typedef typename MatrixType::ColXpr ColXpr; + typedef internal::remove_all_t ColXprCleaned; + typedef typename ColXprCleaned::SegmentReturnType ColXprSegment; + typedef Matrix TempVectorType; + typedef typename TempVectorType::SegmentReturnType TempVecSegment; + + Index n = mat.cols(); + eigen_assert(mat.rows()==n && vec.size()==n); + + TempVectorType temp; + + if(sigma>0) + { + // This version is based on Givens rotations. + // It is faster than the other one below, but only works for updates, + // i.e., for sigma > 0 + temp = sqrt(sigma) * vec; + + for(Index i=0; i g; + g.makeGivens(mat(i,i), -temp(i), &mat(i,i)); + + Index rs = n-i-1; + if(rs>0) + { + ColXprSegment x(mat.col(i).tail(rs)); + TempVecSegment y(temp.tail(rs)); + apply_rotation_in_the_plane(x, y, g); + } + } + } + else + { + temp = vec; + RealScalar beta = 1; + for(Index j=0; j struct llt_inplace +{ + typedef typename NumTraits::Real RealScalar; + template + static Index unblocked(MatrixType& mat) + { + using std::sqrt; + + eigen_assert(mat.rows()==mat.cols()); + const Index size = mat.rows(); + for(Index k = 0; k < size; ++k) + { + Index rs = size-k-1; // remaining size + + Block A21(mat,k+1,k,rs,1); + Block A10(mat,k,0,1,k); + Block A20(mat,k+1,0,rs,k); + + RealScalar x = numext::real(mat.coeff(k,k)); + if (k>0) x -= A10.squaredNorm(); + if (x<=RealScalar(0)) + return k; + mat.coeffRef(k,k) = x = sqrt(x); + if (k>0 && rs>0) A21.noalias() -= A20 * A10.adjoint(); + if (rs>0) A21 /= x; + } + return -1; + } + + template + static Index blocked(MatrixType& m) + { + eigen_assert(m.rows()==m.cols()); + Index size = m.rows(); + if(size<32) + return unblocked(m); + + Index blockSize = size/8; + blockSize = (blockSize/16)*16; + blockSize = (std::min)((std::max)(blockSize,Index(8)), Index(128)); + + for (Index k=0; k A11(m,k, k, bs,bs); + Block A21(m,k+bs,k, rs,bs); + Block A22(m,k+bs,k+bs,rs,rs); + + Index ret; + if((ret=unblocked(A11))>=0) return k+ret; + if(rs>0) A11.adjoint().template triangularView().template solveInPlace(A21); + if(rs>0) A22.template selfadjointView().rankUpdate(A21,typename NumTraits::Literal(-1)); // bottleneck + } + return -1; + } + + template + static Index rankUpdate(MatrixType& mat, const VectorType& vec, const RealScalar& sigma) + { + return Eigen::internal::llt_rank_update_lower(mat, vec, sigma); + } +}; + +template struct llt_inplace +{ + typedef typename NumTraits::Real RealScalar; + + template + static EIGEN_STRONG_INLINE Index unblocked(MatrixType& mat) + { + Transpose matt(mat); + return llt_inplace::unblocked(matt); + } + template + static EIGEN_STRONG_INLINE Index blocked(MatrixType& mat) + { + Transpose matt(mat); + return llt_inplace::blocked(matt); + } + template + static Index rankUpdate(MatrixType& mat, const VectorType& vec, const RealScalar& sigma) + { + Transpose matt(mat); + return llt_inplace::rankUpdate(matt, vec.conjugate(), sigma); + } +}; + +template struct LLT_Traits +{ + typedef const TriangularView MatrixL; + typedef const TriangularView MatrixU; + static inline MatrixL getL(const MatrixType& m) { return MatrixL(m); } + static inline MatrixU getU(const MatrixType& m) { return MatrixU(m.adjoint()); } + static bool inplace_decomposition(MatrixType& m) + { return llt_inplace::blocked(m)==-1; } +}; + +template struct LLT_Traits +{ + typedef const TriangularView MatrixL; + typedef const TriangularView MatrixU; + static inline MatrixL getL(const MatrixType& m) { return MatrixL(m.adjoint()); } + static inline MatrixU getU(const MatrixType& m) { return MatrixU(m); } + static bool inplace_decomposition(MatrixType& m) + { return llt_inplace::blocked(m)==-1; } +}; + +} // end namespace internal + +/** Computes / recomputes the Cholesky decomposition A = LL^* = U^*U of \a matrix + * + * \returns a reference to *this + * + * Example: \include TutorialLinAlgComputeTwice.cpp + * Output: \verbinclude TutorialLinAlgComputeTwice.out + */ +template +template +LLT& LLT::compute(const EigenBase& a) +{ + eigen_assert(a.rows()==a.cols()); + const Index size = a.rows(); + m_matrix.resize(size, size); + if (!internal::is_same_dense(m_matrix, a.derived())) + m_matrix = a.derived(); + + // Compute matrix L1 norm = max abs column sum. + m_l1_norm = RealScalar(0); + // TODO move this code to SelfAdjointView + for (Index col = 0; col < size; ++col) { + RealScalar abs_col_sum; + if (UpLo_ == Lower) + abs_col_sum = m_matrix.col(col).tail(size - col).template lpNorm<1>() + m_matrix.row(col).head(col).template lpNorm<1>(); + else + abs_col_sum = m_matrix.col(col).head(col).template lpNorm<1>() + m_matrix.row(col).tail(size - col).template lpNorm<1>(); + if (abs_col_sum > m_l1_norm) + m_l1_norm = abs_col_sum; + } + + m_isInitialized = true; + bool ok = Traits::inplace_decomposition(m_matrix); + m_info = ok ? Success : NumericalIssue; + + return *this; +} + +/** Performs a rank one update (or dowdate) of the current decomposition. + * If A = LL^* before the rank one update, + * then after it we have LL^* = A + sigma * v v^* where \a v must be a vector + * of same dimension. + */ +template +template +LLT & LLT::rankUpdate(const VectorType& v, const RealScalar& sigma) +{ + EIGEN_STATIC_ASSERT_VECTOR_ONLY(VectorType); + eigen_assert(v.size()==m_matrix.cols()); + eigen_assert(m_isInitialized); + if(internal::llt_inplace::rankUpdate(m_matrix,v,sigma)>=0) + m_info = NumericalIssue; + else + m_info = Success; + + return *this; +} + +#ifndef EIGEN_PARSED_BY_DOXYGEN +template +template +void LLT::_solve_impl(const RhsType &rhs, DstType &dst) const +{ + _solve_impl_transposed(rhs, dst); +} + +template +template +void LLT::_solve_impl_transposed(const RhsType &rhs, DstType &dst) const +{ + dst = rhs; + + matrixL().template conjugateIf().solveInPlace(dst); + matrixU().template conjugateIf().solveInPlace(dst); +} +#endif + +/** \internal use x = llt_object.solve(x); + * + * This is the \em in-place version of solve(). + * + * \param bAndX represents both the right-hand side matrix b and result x. + * + * This version avoids a copy when the right hand side matrix b is not needed anymore. + * + * \warning The parameter is only marked 'const' to make the C++ compiler accept a temporary expression here. + * This function will const_cast it, so constness isn't honored here. + * + * \sa LLT::solve(), MatrixBase::llt() + */ +template +template +void LLT::solveInPlace(const MatrixBase &bAndX) const +{ + eigen_assert(m_isInitialized && "LLT is not initialized."); + eigen_assert(m_matrix.rows()==bAndX.rows()); + matrixL().solveInPlace(bAndX); + matrixU().solveInPlace(bAndX); +} + +/** \returns the matrix represented by the decomposition, + * i.e., it returns the product: L L^*. + * This function is provided for debug purpose. */ +template +MatrixType LLT::reconstructedMatrix() const +{ + eigen_assert(m_isInitialized && "LLT is not initialized."); + return matrixL() * matrixL().adjoint().toDenseMatrix(); +} + +/** \cholesky_module + * \returns the LLT decomposition of \c *this + * \sa SelfAdjointView::llt() + */ +template +inline const LLT::PlainObject> +MatrixBase::llt() const +{ + return LLT(derived()); +} + +/** \cholesky_module + * \returns the LLT decomposition of \c *this + * \sa SelfAdjointView::llt() + */ +template +inline const LLT::PlainObject, UpLo> +SelfAdjointView::llt() const +{ + return LLT(m_matrix); +} + +} // end namespace Eigen + +#endif // EIGEN_LLT_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Cholesky/LLT_LAPACKE.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Cholesky/LLT_LAPACKE.h new file mode 100644 index 0000000000000000000000000000000000000000..a32ff2307f09efb292c8a056dfdc3e04357993ef --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Cholesky/LLT_LAPACKE.h @@ -0,0 +1,123 @@ +/* + Copyright (c) 2011, Intel Corporation. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ******************************************************************************** + * Content : Eigen bindings to LAPACKe + * LLt decomposition based on LAPACKE_?potrf function. + ******************************************************************************** +*/ + +#ifndef EIGEN_LLT_LAPACKE_H +#define EIGEN_LLT_LAPACKE_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { + +namespace lapacke_helpers { + // ------------------------------------------------------------------------------------------------------------------- + // Dispatch for rank update handling upper and lower parts + // ------------------------------------------------------------------------------------------------------------------- + + template + struct rank_update {}; + + template<> + struct rank_update { + template + static Index run(MatrixType &mat, const VectorType &vec, const typename MatrixType::RealScalar &sigma) { + return Eigen::internal::llt_rank_update_lower(mat, vec, sigma); + } + }; + + template<> + struct rank_update { + template + static Index run(MatrixType &mat, const VectorType &vec, const typename MatrixType::RealScalar &sigma) { + Transpose matt(mat); + return Eigen::internal::llt_rank_update_lower(matt, vec.conjugate(), sigma); + } + }; + + // ------------------------------------------------------------------------------------------------------------------- + // Generic lapacke llt implementation that hands of to the dispatches + // ------------------------------------------------------------------------------------------------------------------- + + template + struct lapacke_llt { + EIGEN_STATIC_ASSERT(((Mode == Lower) || (Mode == Upper)),MODE_MUST_BE_UPPER_OR_LOWER) + template + static Index blocked(MatrixType& m) + { + eigen_assert(m.rows() == m.cols()); + if(m.rows() == 0) { + return -1; + } + /* Set up parameters for ?potrf */ + lapack_int size = to_lapack(m.rows()); + lapack_int matrix_order = lapack_storage_of(m); + constexpr char uplo = Mode == Upper ? 'U' : 'L'; + Scalar* a = &(m.coeffRef(0,0)); + lapack_int lda = to_lapack(m.outerStride()); + + lapack_int info = potrf(matrix_order, uplo, size, to_lapack(a), lda ); + info = (info==0) ? -1 : info>0 ? info-1 : size; + return info; + } + + template + static Index rankUpdate(MatrixType& mat, const VectorType& vec, const typename MatrixType::RealScalar& sigma) + { + return rank_update::run(mat, vec, sigma); + } + }; +} +// end namespace lapacke_helpers + +/* + * Here, we just put the generic implementation from lapacke_llt into a full specialization of the llt_inplace + * type. By being a full specialization, the versions defined here thus get precedence over the generic implementation + * in LLT.h for double, float and complex double, complex float types. + */ + +#define EIGEN_LAPACKE_LLT(EIGTYPE) \ +template<> struct llt_inplace : public lapacke_helpers::lapacke_llt {}; \ +template<> struct llt_inplace : public lapacke_helpers::lapacke_llt {}; + +EIGEN_LAPACKE_LLT(double) +EIGEN_LAPACKE_LLT(float) +EIGEN_LAPACKE_LLT(std::complex) +EIGEN_LAPACKE_LLT(std::complex) + +#undef EIGEN_LAPACKE_LLT + +} // end namespace internal + +} // end namespace Eigen + +#endif // EIGEN_LLT_LAPACKE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/CholmodSupport/CholmodSupport.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/CholmodSupport/CholmodSupport.h new file mode 100644 index 0000000000000000000000000000000000000000..91c1cfc14e88396605ad25d6ea860e62d37d2c67 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/CholmodSupport/CholmodSupport.h @@ -0,0 +1,684 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008-2010 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_CHOLMODSUPPORT_H +#define EIGEN_CHOLMODSUPPORT_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { + +template struct cholmod_configure_matrix; + +template<> struct cholmod_configure_matrix { + template + static void run(CholmodType& mat) { + mat.xtype = CHOLMOD_REAL; + mat.dtype = CHOLMOD_DOUBLE; + } +}; + +template<> struct cholmod_configure_matrix > { + template + static void run(CholmodType& mat) { + mat.xtype = CHOLMOD_COMPLEX; + mat.dtype = CHOLMOD_DOUBLE; + } +}; + +// Other scalar types are not yet supported by Cholmod +// template<> struct cholmod_configure_matrix { +// template +// static void run(CholmodType& mat) { +// mat.xtype = CHOLMOD_REAL; +// mat.dtype = CHOLMOD_SINGLE; +// } +// }; +// +// template<> struct cholmod_configure_matrix > { +// template +// static void run(CholmodType& mat) { +// mat.xtype = CHOLMOD_COMPLEX; +// mat.dtype = CHOLMOD_SINGLE; +// } +// }; + +} // namespace internal + +/** Wraps the Eigen sparse matrix \a mat into a Cholmod sparse matrix object. + * Note that the data are shared. + */ +template +cholmod_sparse viewAsCholmod(Ref > mat) +{ + cholmod_sparse res; + res.nzmax = mat.nonZeros(); + res.nrow = mat.rows(); + res.ncol = mat.cols(); + res.p = mat.outerIndexPtr(); + res.i = mat.innerIndexPtr(); + res.x = mat.valuePtr(); + res.z = 0; + res.sorted = 1; + if(mat.isCompressed()) + { + res.packed = 1; + res.nz = 0; + } + else + { + res.packed = 0; + res.nz = mat.innerNonZeroPtr(); + } + + res.dtype = 0; + res.stype = -1; + + if (internal::is_same::value) + { + res.itype = CHOLMOD_INT; + } + else if (internal::is_same::value) + { + res.itype = CHOLMOD_LONG; + } + else + { + eigen_assert(false && "Index type not supported yet"); + } + + // setup res.xtype + internal::cholmod_configure_matrix::run(res); + + res.stype = 0; + + return res; +} + +template +const cholmod_sparse viewAsCholmod(const SparseMatrix& mat) +{ + cholmod_sparse res = viewAsCholmod(Ref >(mat.const_cast_derived())); + return res; +} + +template +const cholmod_sparse viewAsCholmod(const SparseVector& mat) +{ + cholmod_sparse res = viewAsCholmod(Ref >(mat.const_cast_derived())); + return res; +} + +/** Returns a view of the Eigen sparse matrix \a mat as Cholmod sparse matrix. + * The data are not copied but shared. */ +template +cholmod_sparse viewAsCholmod(const SparseSelfAdjointView, UpLo>& mat) +{ + cholmod_sparse res = viewAsCholmod(Ref >(mat.matrix().const_cast_derived())); + + if(UpLo==Upper) res.stype = 1; + if(UpLo==Lower) res.stype = -1; + // swap stype for rowmajor matrices (only works for real matrices) + EIGEN_STATIC_ASSERT((Options_ & RowMajorBit) == 0 || NumTraits::IsComplex == 0, THIS_METHOD_IS_ONLY_FOR_COLUMN_MAJOR_MATRICES); + if(Options_ & RowMajorBit) res.stype *=-1; + + return res; +} + +/** Returns a view of the Eigen \b dense matrix \a mat as Cholmod dense matrix. + * The data are not copied but shared. */ +template +cholmod_dense viewAsCholmod(MatrixBase& mat) +{ + EIGEN_STATIC_ASSERT((internal::traits::Flags&RowMajorBit)==0,THIS_METHOD_IS_ONLY_FOR_COLUMN_MAJOR_MATRICES); + typedef typename Derived::Scalar Scalar; + + cholmod_dense res; + res.nrow = mat.rows(); + res.ncol = mat.cols(); + res.nzmax = res.nrow * res.ncol; + res.d = Derived::IsVectorAtCompileTime ? mat.derived().size() : mat.derived().outerStride(); + res.x = (void*)(mat.derived().data()); + res.z = 0; + + internal::cholmod_configure_matrix::run(res); + + return res; +} + +/** Returns a view of the Cholmod sparse matrix \a cm as an Eigen sparse matrix. + * The data are not copied but shared. */ +template +Map > viewAsEigen(cholmod_sparse& cm) +{ + return Map > + (cm.nrow, cm.ncol, static_cast(cm.p)[cm.ncol], + static_cast(cm.p), static_cast(cm.i),static_cast(cm.x) ); +} + +namespace internal { + +// template specializations for int and long that call the correct cholmod method + +#define EIGEN_CHOLMOD_SPECIALIZE0(ret, name) \ + template inline ret cm_ ## name (cholmod_common &Common) { return cholmod_ ## name (&Common); } \ + template<> inline ret cm_ ## name (cholmod_common &Common) { return cholmod_l_ ## name (&Common); } + +#define EIGEN_CHOLMOD_SPECIALIZE1(ret, name, t1, a1) \ + template inline ret cm_ ## name (t1& a1, cholmod_common &Common) { return cholmod_ ## name (&a1, &Common); } \ + template<> inline ret cm_ ## name (t1& a1, cholmod_common &Common) { return cholmod_l_ ## name (&a1, &Common); } + +EIGEN_CHOLMOD_SPECIALIZE0(int, start) +EIGEN_CHOLMOD_SPECIALIZE0(int, finish) + +EIGEN_CHOLMOD_SPECIALIZE1(int, free_factor, cholmod_factor*, L) +EIGEN_CHOLMOD_SPECIALIZE1(int, free_dense, cholmod_dense*, X) +EIGEN_CHOLMOD_SPECIALIZE1(int, free_sparse, cholmod_sparse*, A) + +EIGEN_CHOLMOD_SPECIALIZE1(cholmod_factor*, analyze, cholmod_sparse, A) + +template inline cholmod_dense* cm_solve (int sys, cholmod_factor& L, cholmod_dense& B, cholmod_common &Common) { return cholmod_solve (sys, &L, &B, &Common); } +template<> inline cholmod_dense* cm_solve (int sys, cholmod_factor& L, cholmod_dense& B, cholmod_common &Common) { return cholmod_l_solve (sys, &L, &B, &Common); } + +template inline cholmod_sparse* cm_spsolve (int sys, cholmod_factor& L, cholmod_sparse& B, cholmod_common &Common) { return cholmod_spsolve (sys, &L, &B, &Common); } +template<> inline cholmod_sparse* cm_spsolve (int sys, cholmod_factor& L, cholmod_sparse& B, cholmod_common &Common) { return cholmod_l_spsolve (sys, &L, &B, &Common); } + +template +inline int cm_factorize_p (cholmod_sparse* A, double beta[2], StorageIndex_* fset, std::size_t fsize, cholmod_factor* L, cholmod_common &Common) { return cholmod_factorize_p (A, beta, fset, fsize, L, &Common); } +template<> +inline int cm_factorize_p (cholmod_sparse* A, double beta[2], SuiteSparse_long* fset, std::size_t fsize, cholmod_factor* L, cholmod_common &Common) { return cholmod_l_factorize_p (A, beta, fset, fsize, L, &Common); } + +#undef EIGEN_CHOLMOD_SPECIALIZE0 +#undef EIGEN_CHOLMOD_SPECIALIZE1 + +} // namespace internal + + +enum CholmodMode { + CholmodAuto, CholmodSimplicialLLt, CholmodSupernodalLLt, CholmodLDLt +}; + + +/** \ingroup CholmodSupport_Module + * \class CholmodBase + * \brief The base class for the direct Cholesky factorization of Cholmod + * \sa class CholmodSupernodalLLT, class CholmodSimplicialLDLT, class CholmodSimplicialLLT + */ +template +class CholmodBase : public SparseSolverBase +{ + protected: + typedef SparseSolverBase Base; + using Base::derived; + using Base::m_isInitialized; + public: + typedef MatrixType_ MatrixType; + enum { UpLo = UpLo_ }; + typedef typename MatrixType::Scalar Scalar; + typedef typename MatrixType::RealScalar RealScalar; + typedef MatrixType CholMatrixType; + typedef typename MatrixType::StorageIndex StorageIndex; + enum { + ColsAtCompileTime = MatrixType::ColsAtCompileTime, + MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime + }; + + public: + + CholmodBase() + : m_cholmodFactor(0), m_info(Success), m_factorizationIsOk(false), m_analysisIsOk(false) + { + EIGEN_STATIC_ASSERT((internal::is_same::value), CHOLMOD_SUPPORTS_DOUBLE_PRECISION_ONLY); + m_shiftOffset[0] = m_shiftOffset[1] = 0.0; + internal::cm_start(m_cholmod); + } + + explicit CholmodBase(const MatrixType& matrix) + : m_cholmodFactor(0), m_info(Success), m_factorizationIsOk(false), m_analysisIsOk(false) + { + EIGEN_STATIC_ASSERT((internal::is_same::value), CHOLMOD_SUPPORTS_DOUBLE_PRECISION_ONLY); + m_shiftOffset[0] = m_shiftOffset[1] = 0.0; + internal::cm_start(m_cholmod); + compute(matrix); + } + + ~CholmodBase() + { + if(m_cholmodFactor) + internal::cm_free_factor(m_cholmodFactor, m_cholmod); + internal::cm_finish(m_cholmod); + } + + inline StorageIndex cols() const { return internal::convert_index(m_cholmodFactor->n); } + inline StorageIndex rows() const { return internal::convert_index(m_cholmodFactor->n); } + + /** \brief Reports whether previous computation was successful. + * + * \returns \c Success if computation was successful, + * \c NumericalIssue if the matrix.appears to be negative. + */ + ComputationInfo info() const + { + eigen_assert(m_isInitialized && "Decomposition is not initialized."); + return m_info; + } + + /** Computes the sparse Cholesky decomposition of \a matrix */ + Derived& compute(const MatrixType& matrix) + { + analyzePattern(matrix); + factorize(matrix); + return derived(); + } + + /** Performs a symbolic decomposition on the sparsity pattern of \a matrix. + * + * This function is particularly useful when solving for several problems having the same structure. + * + * \sa factorize() + */ + void analyzePattern(const MatrixType& matrix) + { + if(m_cholmodFactor) + { + internal::cm_free_factor(m_cholmodFactor, m_cholmod); + m_cholmodFactor = 0; + } + cholmod_sparse A = viewAsCholmod(matrix.template selfadjointView()); + m_cholmodFactor = internal::cm_analyze(A, m_cholmod); + + this->m_isInitialized = true; + this->m_info = Success; + m_analysisIsOk = true; + m_factorizationIsOk = false; + } + + /** Performs a numeric decomposition of \a matrix + * + * The given matrix must have the same sparsity pattern as the matrix on which the symbolic decomposition has been performed. + * + * \sa analyzePattern() + */ + void factorize(const MatrixType& matrix) + { + eigen_assert(m_analysisIsOk && "You must first call analyzePattern()"); + cholmod_sparse A = viewAsCholmod(matrix.template selfadjointView()); + internal::cm_factorize_p(&A, m_shiftOffset, 0, 0, m_cholmodFactor, m_cholmod); + + // If the factorization failed, minor is the column at which it did. On success minor == n. + this->m_info = (m_cholmodFactor->minor == m_cholmodFactor->n ? Success : NumericalIssue); + m_factorizationIsOk = true; + } + + /** Returns a reference to the Cholmod's configuration structure to get a full control over the performed operations. + * See the Cholmod user guide for details. */ + cholmod_common& cholmod() { return m_cholmod; } + + #ifndef EIGEN_PARSED_BY_DOXYGEN + /** \internal */ + template + void _solve_impl(const MatrixBase &b, MatrixBase &dest) const + { + eigen_assert(m_factorizationIsOk && "The decomposition is not in a valid state for solving, you must first call either compute() or symbolic()/numeric()"); + const Index size = m_cholmodFactor->n; + EIGEN_UNUSED_VARIABLE(size); + eigen_assert(size==b.rows()); + + // Cholmod needs column-major storage without inner-stride, which corresponds to the default behavior of Ref. + Ref > b_ref(b.derived()); + + cholmod_dense b_cd = viewAsCholmod(b_ref); + cholmod_dense* x_cd = internal::cm_solve(CHOLMOD_A, *m_cholmodFactor, b_cd, m_cholmod); + if(!x_cd) + { + this->m_info = NumericalIssue; + return; + } + // TODO optimize this copy by swapping when possible (be careful with alignment, etc.) + // NOTE Actually, the copy can be avoided by calling cholmod_solve2 instead of cholmod_solve + dest = Matrix::Map(reinterpret_cast(x_cd->x),b.rows(),b.cols()); + internal::cm_free_dense(x_cd, m_cholmod); + } + + /** \internal */ + template + void _solve_impl(const SparseMatrixBase &b, SparseMatrixBase &dest) const + { + eigen_assert(m_factorizationIsOk && "The decomposition is not in a valid state for solving, you must first call either compute() or symbolic()/numeric()"); + const Index size = m_cholmodFactor->n; + EIGEN_UNUSED_VARIABLE(size); + eigen_assert(size==b.rows()); + + // note: cs stands for Cholmod Sparse + Ref > b_ref(b.const_cast_derived()); + cholmod_sparse b_cs = viewAsCholmod(b_ref); + cholmod_sparse* x_cs = internal::cm_spsolve(CHOLMOD_A, *m_cholmodFactor, b_cs, m_cholmod); + if(!x_cs) + { + this->m_info = NumericalIssue; + return; + } + // TODO optimize this copy by swapping when possible (be careful with alignment, etc.) + // NOTE cholmod_spsolve in fact just calls the dense solver for blocks of 4 columns at a time (similar to Eigen's sparse solver) + dest.derived() = viewAsEigen(*x_cs); + internal::cm_free_sparse(x_cs, m_cholmod); + } + #endif // EIGEN_PARSED_BY_DOXYGEN + + + /** Sets the shift parameter that will be used to adjust the diagonal coefficients during the numerical factorization. + * + * During the numerical factorization, an offset term is added to the diagonal coefficients:\n + * \c d_ii = \a offset + \c d_ii + * + * The default is \a offset=0. + * + * \returns a reference to \c *this. + */ + Derived& setShift(const RealScalar& offset) + { + m_shiftOffset[0] = double(offset); + return derived(); + } + + /** \returns the determinant of the underlying matrix from the current factorization */ + Scalar determinant() const + { + using std::exp; + return exp(logDeterminant()); + } + + /** \returns the log determinant of the underlying matrix from the current factorization */ + Scalar logDeterminant() const + { + using std::log; + using numext::real; + eigen_assert(m_factorizationIsOk && "The decomposition is not in a valid state for solving, you must first call either compute() or symbolic()/numeric()"); + + RealScalar logDet = 0; + Scalar *x = static_cast(m_cholmodFactor->x); + if (m_cholmodFactor->is_super) + { + // Supernodal factorization stored as a packed list of dense column-major blocs, + // as described by the following structure: + + // super[k] == index of the first column of the j-th super node + StorageIndex *super = static_cast(m_cholmodFactor->super); + // pi[k] == offset to the description of row indices + StorageIndex *pi = static_cast(m_cholmodFactor->pi); + // px[k] == offset to the respective dense block + StorageIndex *px = static_cast(m_cholmodFactor->px); + + Index nb_super_nodes = m_cholmodFactor->nsuper; + for (Index k=0; k < nb_super_nodes; ++k) + { + StorageIndex ncols = super[k + 1] - super[k]; + StorageIndex nrows = pi[k + 1] - pi[k]; + + Map, 0, InnerStride<> > sk(x + px[k], ncols, InnerStride<>(nrows+1)); + logDet += sk.real().log().sum(); + } + } + else + { + // Simplicial factorization stored as standard CSC matrix. + StorageIndex *p = static_cast(m_cholmodFactor->p); + Index size = m_cholmodFactor->n; + for (Index k=0; kis_ll) + logDet *= 2.0; + return logDet; + } + + template + void dumpMemory(Stream& /*s*/) + {} + + protected: + mutable cholmod_common m_cholmod; + cholmod_factor* m_cholmodFactor; + double m_shiftOffset[2]; + mutable ComputationInfo m_info; + int m_factorizationIsOk; + int m_analysisIsOk; +}; + +/** \ingroup CholmodSupport_Module + * \class CholmodSimplicialLLT + * \brief A simplicial direct Cholesky (LLT) factorization and solver based on Cholmod + * + * This class allows to solve for A.X = B sparse linear problems via a simplicial LL^T Cholesky factorization + * using the Cholmod library. + * This simplicial variant is equivalent to Eigen's built-in SimplicialLLT class. Therefore, it has little practical interest. + * The sparse matrix A must be selfadjoint and positive definite. The vectors or matrices + * X and B can be either dense or sparse. + * + * \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<> + * \tparam UpLo_ the triangular part that will be used for the computations. It can be Lower + * or Upper. Default is Lower. + * + * \implsparsesolverconcept + * + * This class supports all kind of SparseMatrix<>: row or column major; upper, lower, or both; compressed or non compressed. + * + * \warning Only double precision real and complex scalar types are supported by Cholmod. + * + * \sa \ref TutorialSparseSolverConcept, class CholmodSupernodalLLT, class SimplicialLLT + */ +template +class CholmodSimplicialLLT : public CholmodBase > +{ + typedef CholmodBase Base; + using Base::m_cholmod; + + public: + + typedef MatrixType_ MatrixType; + + CholmodSimplicialLLT() : Base() { init(); } + + CholmodSimplicialLLT(const MatrixType& matrix) : Base() + { + init(); + this->compute(matrix); + } + + ~CholmodSimplicialLLT() {} + protected: + void init() + { + m_cholmod.final_asis = 0; + m_cholmod.supernodal = CHOLMOD_SIMPLICIAL; + m_cholmod.final_ll = 1; + } +}; + + +/** \ingroup CholmodSupport_Module + * \class CholmodSimplicialLDLT + * \brief A simplicial direct Cholesky (LDLT) factorization and solver based on Cholmod + * + * This class allows to solve for A.X = B sparse linear problems via a simplicial LDL^T Cholesky factorization + * using the Cholmod library. + * This simplicial variant is equivalent to Eigen's built-in SimplicialLDLT class. Therefore, it has little practical interest. + * The sparse matrix A must be selfadjoint and positive definite. The vectors or matrices + * X and B can be either dense or sparse. + * + * \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<> + * \tparam UpLo_ the triangular part that will be used for the computations. It can be Lower + * or Upper. Default is Lower. + * + * \implsparsesolverconcept + * + * This class supports all kind of SparseMatrix<>: row or column major; upper, lower, or both; compressed or non compressed. + * + * \warning Only double precision real and complex scalar types are supported by Cholmod. + * + * \sa \ref TutorialSparseSolverConcept, class CholmodSupernodalLLT, class SimplicialLDLT + */ +template +class CholmodSimplicialLDLT : public CholmodBase > +{ + typedef CholmodBase Base; + using Base::m_cholmod; + + public: + + typedef MatrixType_ MatrixType; + + CholmodSimplicialLDLT() : Base() { init(); } + + CholmodSimplicialLDLT(const MatrixType& matrix) : Base() + { + init(); + this->compute(matrix); + } + + ~CholmodSimplicialLDLT() {} + protected: + void init() + { + m_cholmod.final_asis = 1; + m_cholmod.supernodal = CHOLMOD_SIMPLICIAL; + } +}; + +/** \ingroup CholmodSupport_Module + * \class CholmodSupernodalLLT + * \brief A supernodal Cholesky (LLT) factorization and solver based on Cholmod + * + * This class allows to solve for A.X = B sparse linear problems via a supernodal LL^T Cholesky factorization + * using the Cholmod library. + * This supernodal variant performs best on dense enough problems, e.g., 3D FEM, or very high order 2D FEM. + * The sparse matrix A must be selfadjoint and positive definite. The vectors or matrices + * X and B can be either dense or sparse. + * + * \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<> + * \tparam UpLo_ the triangular part that will be used for the computations. It can be Lower + * or Upper. Default is Lower. + * + * \implsparsesolverconcept + * + * This class supports all kind of SparseMatrix<>: row or column major; upper, lower, or both; compressed or non compressed. + * + * \warning Only double precision real and complex scalar types are supported by Cholmod. + * + * \sa \ref TutorialSparseSolverConcept + */ +template +class CholmodSupernodalLLT : public CholmodBase > +{ + typedef CholmodBase Base; + using Base::m_cholmod; + + public: + + typedef MatrixType_ MatrixType; + + CholmodSupernodalLLT() : Base() { init(); } + + CholmodSupernodalLLT(const MatrixType& matrix) : Base() + { + init(); + this->compute(matrix); + } + + ~CholmodSupernodalLLT() {} + protected: + void init() + { + m_cholmod.final_asis = 1; + m_cholmod.supernodal = CHOLMOD_SUPERNODAL; + } +}; + +/** \ingroup CholmodSupport_Module + * \class CholmodDecomposition + * \brief A general Cholesky factorization and solver based on Cholmod + * + * This class allows to solve for A.X = B sparse linear problems via a LL^T or LDL^T Cholesky factorization + * using the Cholmod library. The sparse matrix A must be selfadjoint and positive definite. The vectors or matrices + * X and B can be either dense or sparse. + * + * This variant permits to change the underlying Cholesky method at runtime. + * On the other hand, it does not provide access to the result of the factorization. + * The default is to let Cholmod automatically choose between a simplicial and supernodal factorization. + * + * \tparam MatrixType_ the type of the sparse matrix A, it must be a SparseMatrix<> + * \tparam UpLo_ the triangular part that will be used for the computations. It can be Lower + * or Upper. Default is Lower. + * + * \implsparsesolverconcept + * + * This class supports all kind of SparseMatrix<>: row or column major; upper, lower, or both; compressed or non compressed. + * + * \warning Only double precision real and complex scalar types are supported by Cholmod. + * + * \sa \ref TutorialSparseSolverConcept + */ +template +class CholmodDecomposition : public CholmodBase > +{ + typedef CholmodBase Base; + using Base::m_cholmod; + + public: + + typedef MatrixType_ MatrixType; + + CholmodDecomposition() : Base() { init(); } + + CholmodDecomposition(const MatrixType& matrix) : Base() + { + init(); + this->compute(matrix); + } + + ~CholmodDecomposition() {} + + void setMode(CholmodMode mode) + { + switch(mode) + { + case CholmodAuto: + m_cholmod.final_asis = 1; + m_cholmod.supernodal = CHOLMOD_AUTO; + break; + case CholmodSimplicialLLt: + m_cholmod.final_asis = 0; + m_cholmod.supernodal = CHOLMOD_SIMPLICIAL; + m_cholmod.final_ll = 1; + break; + case CholmodSupernodalLLt: + m_cholmod.final_asis = 1; + m_cholmod.supernodal = CHOLMOD_SUPERNODAL; + break; + case CholmodLDLt: + m_cholmod.final_asis = 1; + m_cholmod.supernodal = CHOLMOD_SIMPLICIAL; + break; + default: + break; + } + } + protected: + void init() + { + m_cholmod.final_asis = 1; + m_cholmod.supernodal = CHOLMOD_AUTO; + } +}; + +} // end namespace Eigen + +#endif // EIGEN_CHOLMODSUPPORT_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/CholmodSupport/InternalHeaderCheck.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/CholmodSupport/InternalHeaderCheck.h new file mode 100644 index 0000000000000000000000000000000000000000..0fb3abc704095b8874a447c99451f7f12f1fd66b --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/CholmodSupport/InternalHeaderCheck.h @@ -0,0 +1,3 @@ +#ifndef EIGEN_CHOLMODSUPPORT_MODULE_H +#error "Please include Eigen/CholmodSupport instead of including headers inside the src directory directly." +#endif diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/ArithmeticSequence.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/ArithmeticSequence.h new file mode 100644 index 0000000000000000000000000000000000000000..81005c5a16084edfe1065a2c84a6bc6278cf1967 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/ArithmeticSequence.h @@ -0,0 +1,258 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2017 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_ARITHMETIC_SEQUENCE_H +#define EIGEN_ARITHMETIC_SEQUENCE_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { + +// Helper to cleanup the type of the increment: +template struct cleanup_seq_incr { + typedef typename cleanup_index_type::type type; +}; + +} // namespace internal + +//-------------------------------------------------------------------------------- +// seq(first,last,incr) and seqN(first,size,incr) +//-------------------------------------------------------------------------------- + +template > +class ArithmeticSequence; + +template +ArithmeticSequence::type, + typename internal::cleanup_index_type::type, + typename internal::cleanup_seq_incr::type > +seqN(FirstType first, SizeType size, IncrType incr); + +/** \class ArithmeticSequence + * \ingroup Core_Module + * + * This class represents an arithmetic progression \f$ a_0, a_1, a_2, ..., a_{n-1}\f$ defined by + * its \em first value \f$ a_0 \f$, its \em size (aka length) \em n, and the \em increment (aka stride) + * that is equal to \f$ a_{i+1}-a_{i}\f$ for any \em i. + * + * It is internally used as the return type of the Eigen::seq and Eigen::seqN functions, and as the input arguments + * of DenseBase::operator()(const RowIndices&, const ColIndices&), and most of the time this is the + * only way it is used. + * + * \tparam FirstType type of the first element, usually an Index, + * but internally it can be a symbolic expression + * \tparam SizeType type representing the size of the sequence, usually an Index + * or a compile time integral constant. Internally, it can also be a symbolic expression + * \tparam IncrType type of the increment, can be a runtime Index, or a compile time integral constant (default is compile-time 1) + * + * \sa Eigen::seq, Eigen::seqN, DenseBase::operator()(const RowIndices&, const ColIndices&), class IndexedView + */ +template +class ArithmeticSequence +{ +public: + ArithmeticSequence(FirstType first, SizeType size) : m_first(first), m_size(size) {} + ArithmeticSequence(FirstType first, SizeType size, IncrType incr) : m_first(first), m_size(size), m_incr(incr) {} + + enum { + SizeAtCompileTime = internal::get_fixed_value::value, + IncrAtCompileTime = internal::get_fixed_value::value + }; + + /** \returns the size, i.e., number of elements, of the sequence */ + Index size() const { return m_size; } + + /** \returns the first element \f$ a_0 \f$ in the sequence */ + Index first() const { return m_first; } + + /** \returns the value \f$ a_i \f$ at index \a i in the sequence. */ + Index operator[](Index i) const { return m_first + i * m_incr; } + + const FirstType& firstObject() const { return m_first; } + const SizeType& sizeObject() const { return m_size; } + const IncrType& incrObject() const { return m_incr; } + +protected: + FirstType m_first; + SizeType m_size; + IncrType m_incr; + +public: + auto reverse() const -> decltype(Eigen::seqN(m_first+(m_size+fix<-1>())*m_incr,m_size,-m_incr)) { + return seqN(m_first+(m_size+fix<-1>())*m_incr,m_size,-m_incr); + } +}; + +/** \returns an ArithmeticSequence starting at \a first, of length \a size, and increment \a incr + * + * \sa seqN(FirstType,SizeType), seq(FirstType,LastType,IncrType) */ +template +ArithmeticSequence::type,typename internal::cleanup_index_type::type,typename internal::cleanup_seq_incr::type > +seqN(FirstType first, SizeType size, IncrType incr) { + return ArithmeticSequence::type,typename internal::cleanup_index_type::type,typename internal::cleanup_seq_incr::type>(first,size,incr); +} + +/** \returns an ArithmeticSequence starting at \a first, of length \a size, and unit increment + * + * \sa seqN(FirstType,SizeType,IncrType), seq(FirstType,LastType) */ +template +ArithmeticSequence::type,typename internal::cleanup_index_type::type > +seqN(FirstType first, SizeType size) { + return ArithmeticSequence::type,typename internal::cleanup_index_type::type>(first,size); +} + +#ifdef EIGEN_PARSED_BY_DOXYGEN + +/** \returns an ArithmeticSequence starting at \a f, up (or down) to \a l, and with positive (or negative) increment \a incr + * + * It is essentially an alias to: + * \code + * seqN(f, (l-f+incr)/incr, incr); + * \endcode + * + * \sa seqN(FirstType,SizeType,IncrType), seq(FirstType,LastType) + */ +template +auto seq(FirstType f, LastType l, IncrType incr); + +/** \returns an ArithmeticSequence starting at \a f, up (or down) to \a l, and unit increment + * + * It is essentially an alias to: + * \code + * seqN(f,l-f+1); + * \endcode + * + * \sa seqN(FirstType,SizeType), seq(FirstType,LastType,IncrType) + */ +template +auto seq(FirstType f, LastType l); + +#else // EIGEN_PARSED_BY_DOXYGEN + +template +auto seq(FirstType f, LastType l) -> decltype(seqN(typename internal::cleanup_index_type::type(f), + ( typename internal::cleanup_index_type::type(l) + - typename internal::cleanup_index_type::type(f)+fix<1>()))) +{ + return seqN(typename internal::cleanup_index_type::type(f), + (typename internal::cleanup_index_type::type(l) + -typename internal::cleanup_index_type::type(f)+fix<1>())); +} + +template +auto seq(FirstType f, LastType l, IncrType incr) + -> decltype(seqN(typename internal::cleanup_index_type::type(f), + ( typename internal::cleanup_index_type::type(l) + - typename internal::cleanup_index_type::type(f)+typename internal::cleanup_seq_incr::type(incr) + ) / typename internal::cleanup_seq_incr::type(incr), + typename internal::cleanup_seq_incr::type(incr))) +{ + typedef typename internal::cleanup_seq_incr::type CleanedIncrType; + return seqN(typename internal::cleanup_index_type::type(f), + ( typename internal::cleanup_index_type::type(l) + -typename internal::cleanup_index_type::type(f)+CleanedIncrType(incr)) / CleanedIncrType(incr), + CleanedIncrType(incr)); +} + + +#endif // EIGEN_PARSED_BY_DOXYGEN + +namespace placeholders { + +/** \cpp11 + * \returns a symbolic ArithmeticSequence representing the last \a size elements with increment \a incr. + * + * It is a shortcut for: \code seqN(last-(size-fix<1>)*incr, size, incr) \endcode + * + * \sa lastN(SizeType), seqN(FirstType,SizeType), seq(FirstType,LastType,IncrType) */ +template +auto lastN(SizeType size, IncrType incr) +-> decltype(seqN(Eigen::placeholders::last-(size-fix<1>())*incr, size, incr)) +{ + return seqN(Eigen::placeholders::last-(size-fix<1>())*incr, size, incr); +} + +/** \cpp11 + * \returns a symbolic ArithmeticSequence representing the last \a size elements with a unit increment. + * + * It is a shortcut for: \code seq(last+fix<1>-size, last) \endcode + * + * \sa lastN(SizeType,IncrType, seqN(FirstType,SizeType), seq(FirstType,LastType) */ +template +auto lastN(SizeType size) +-> decltype(seqN(Eigen::placeholders::last+fix<1>()-size, size)) +{ + return seqN(Eigen::placeholders::last+fix<1>()-size, size); +} + +} // namespace placeholders + +namespace internal { + +// Convert a symbolic span into a usable one (i.e., remove last/end "keywords") +template +struct make_size_type { + typedef std::conditional_t::value, Index, T> type; +}; + +template +struct IndexedViewCompatibleType, XprSize> { + typedef ArithmeticSequence::type,IncrType> type; +}; + +template +ArithmeticSequence::type,IncrType> +makeIndexedViewCompatible(const ArithmeticSequence& ids, Index size,SpecializedType) { + return ArithmeticSequence::type,IncrType>( + eval_expr_given_size(ids.firstObject(),size),eval_expr_given_size(ids.sizeObject(),size),ids.incrObject()); +} + +template +struct get_compile_time_incr > { + enum { value = get_fixed_value::value }; +}; + +} // end namespace internal + +/** \namespace Eigen::indexing + * \ingroup Core_Module + * + * The sole purpose of this namespace is to be able to import all functions + * and symbols that are expected to be used within operator() for indexing + * and slicing. If you already imported the whole Eigen namespace: + * \code using namespace Eigen; \endcode + * then you are already all set. Otherwise, if you don't want/cannot import + * the whole Eigen namespace, the following line: + * \code using namespace Eigen::indexing; \endcode + * is equivalent to: + * \code + using Eigen::fix; + using Eigen::seq; + using Eigen::seqN; + using Eigen::placeholders::all; + using Eigen::placeholders::last; + using Eigen::placeholders::lastN; // c++11 only + using Eigen::placeholders::lastp1; + \endcode + */ +namespace indexing { + using Eigen::fix; + using Eigen::seq; + using Eigen::seqN; + using Eigen::placeholders::all; + using Eigen::placeholders::last; + using Eigen::placeholders::lastN; + using Eigen::placeholders::lastp1; +} + +} // end namespace Eigen + +#endif // EIGEN_ARITHMETIC_SEQUENCE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Array.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Array.h new file mode 100644 index 0000000000000000000000000000000000000000..d7a5e7aefeb8d997298a90a0ee326fc6be404b32 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Array.h @@ -0,0 +1,405 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2009 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_ARRAY_H +#define EIGEN_ARRAY_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { +template +struct traits > : traits > +{ + typedef ArrayXpr XprKind; + typedef ArrayBase > XprBase; +}; +} + +/** \class Array + * \ingroup Core_Module + * + * \brief General-purpose arrays with easy API for coefficient-wise operations + * + * The %Array class is very similar to the Matrix class. It provides + * general-purpose one- and two-dimensional arrays. The difference between the + * %Array and the %Matrix class is primarily in the API: the API for the + * %Array class provides easy access to coefficient-wise operations, while the + * API for the %Matrix class provides easy access to linear-algebra + * operations. + * + * See documentation of class Matrix for detailed information on the template parameters + * storage layout. + * + * This class can be extended with the help of the plugin mechanism described on the page + * \ref TopicCustomizing_Plugins by defining the preprocessor symbol \c EIGEN_ARRAY_PLUGIN. + * + * \sa \blank \ref TutorialArrayClass, \ref TopicClassHierarchy + */ +template +class Array + : public PlainObjectBase > +{ + public: + + typedef PlainObjectBase Base; + EIGEN_DENSE_PUBLIC_INTERFACE(Array) + + enum { Options = Options_ }; + typedef typename Base::PlainObject PlainObject; + + protected: + template + friend struct internal::conservative_resize_like_impl; + + using Base::m_storage; + + public: + + using Base::base; + using Base::coeff; + using Base::coeffRef; + + /** + * The usage of + * using Base::operator=; + * fails on MSVC. Since the code below is working with GCC and MSVC, we skipped + * the usage of 'using'. This should be done only for operator=. + */ + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Array& operator=(const EigenBase &other) + { + return Base::operator=(other); + } + + /** Set all the entries to \a value. + * \sa DenseBase::setConstant(), DenseBase::fill() + */ + /* This overload is needed because the usage of + * using Base::operator=; + * fails on MSVC. Since the code below is working with GCC and MSVC, we skipped + * the usage of 'using'. This should be done only for operator=. + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Array& operator=(const Scalar &value) + { + Base::setConstant(value); + return *this; + } + + /** Copies the value of the expression \a other into \c *this with automatic resizing. + * + * *this might be resized to match the dimensions of \a other. If *this was a null matrix (not already initialized), + * it will be initialized. + * + * Note that copying a row-vector into a vector (and conversely) is allowed. + * The resizing, if any, is then done in the appropriate way so that row-vectors + * remain row-vectors and vectors remain vectors. + */ + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Array& operator=(const DenseBase& other) + { + return Base::_set(other); + } + + /** This is a special case of the templated operator=. Its purpose is to + * prevent a default operator= from hiding the templated operator=. + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Array& operator=(const Array& other) + { + return Base::_set(other); + } + + /** Default constructor. + * + * For fixed-size matrices, does nothing. + * + * For dynamic-size matrices, creates an empty matrix of size 0. Does not allocate any array. Such a matrix + * is called a null matrix. This constructor is the unique way to create null matrices: resizing + * a matrix to 0 is not supported. + * + * \sa resize(Index,Index) + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Array() : Base() + { + EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED + } + +#ifndef EIGEN_PARSED_BY_DOXYGEN + // FIXME is it still needed ?? + /** \internal */ + EIGEN_DEVICE_FUNC + Array(internal::constructor_without_unaligned_array_assert) + : Base(internal::constructor_without_unaligned_array_assert()) + { + EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED + } +#endif + + EIGEN_DEVICE_FUNC + Array(Array&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_constructible::value) + : Base(std::move(other)) + { + } + EIGEN_DEVICE_FUNC + Array& operator=(Array&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_assignable::value) + { + Base::operator=(std::move(other)); + return *this; + } + + /** \copydoc PlainObjectBase(const Scalar& a0, const Scalar& a1, const Scalar& a2, const Scalar& a3, const ArgTypes&... args) + * + * Example: \include Array_variadic_ctor_cxx11.cpp + * Output: \verbinclude Array_variadic_ctor_cxx11.out + * + * \sa Array(const std::initializer_list>&) + * \sa Array(const Scalar&), Array(const Scalar&,const Scalar&) + */ + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Array(const Scalar& a0, const Scalar& a1, const Scalar& a2, const Scalar& a3, const ArgTypes&... args) + : Base(a0, a1, a2, a3, args...) {} + + /** \brief Constructs an array and initializes it from the coefficients given as initializer-lists grouped by row. \cpp11 + * + * In the general case, the constructor takes a list of rows, each row being represented as a list of coefficients: + * + * Example: \include Array_initializer_list_23_cxx11.cpp + * Output: \verbinclude Array_initializer_list_23_cxx11.out + * + * Each of the inner initializer lists must contain the exact same number of elements, otherwise an assertion is triggered. + * + * In the case of a compile-time column 1D array, implicit transposition from a single row is allowed. + * Therefore Array{{1,2,3,4,5}} is legal and the more verbose syntax + * Array{{1},{2},{3},{4},{5}} can be avoided: + * + * Example: \include Array_initializer_list_vector_cxx11.cpp + * Output: \verbinclude Array_initializer_list_vector_cxx11.out + * + * In the case of fixed-sized arrays, the initializer list sizes must exactly match the array sizes, + * and implicit transposition is allowed for compile-time 1D arrays only. + * + * \sa Array(const Scalar& a0, const Scalar& a1, const Scalar& a2, const Scalar& a3, const ArgTypes&... args) + */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Array( + const std::initializer_list>& list) + : Base(list) {} + + #ifndef EIGEN_PARSED_BY_DOXYGEN + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE explicit Array(const T& x) + { + Base::template _init1(x); + } + + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Array(const T0& val0, const T1& val1) + { + this->template _init2(val0, val1); + } + + #else + /** \brief Constructs a fixed-sized array initialized with coefficients starting at \a data */ + EIGEN_DEVICE_FUNC explicit Array(const Scalar *data); + /** Constructs a vector or row-vector with given dimension. \only_for_vectors + * + * Note that this is only useful for dynamic-size vectors. For fixed-size vectors, + * it is redundant to pass the dimension here, so it makes more sense to use the default + * constructor Array() instead. + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE explicit Array(Index dim); + /** constructs an initialized 1x1 Array with the given coefficient + * \sa const Scalar& a0, const Scalar& a1, const Scalar& a2, const Scalar& a3, const ArgTypes&... args */ + Array(const Scalar& value); + /** constructs an uninitialized array with \a rows rows and \a cols columns. + * + * This is useful for dynamic-size arrays. For fixed-size arrays, + * it is redundant to pass these parameters, so one should use the default constructor + * Array() instead. */ + Array(Index rows, Index cols); + /** constructs an initialized 2D vector with given coefficients + * \sa Array(const Scalar& a0, const Scalar& a1, const Scalar& a2, const Scalar& a3, const ArgTypes&... args) */ + Array(const Scalar& val0, const Scalar& val1); + #endif // end EIGEN_PARSED_BY_DOXYGEN + + /** constructs an initialized 3D vector with given coefficients + * \sa Array(const Scalar& a0, const Scalar& a1, const Scalar& a2, const Scalar& a3, const ArgTypes&... args) + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Array(const Scalar& val0, const Scalar& val1, const Scalar& val2) + { + EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Array, 3) + m_storage.data()[0] = val0; + m_storage.data()[1] = val1; + m_storage.data()[2] = val2; + } + /** constructs an initialized 4D vector with given coefficients + * \sa Array(const Scalar& a0, const Scalar& a1, const Scalar& a2, const Scalar& a3, const ArgTypes&... args) + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Array(const Scalar& val0, const Scalar& val1, const Scalar& val2, const Scalar& val3) + { + EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Array, 4) + m_storage.data()[0] = val0; + m_storage.data()[1] = val1; + m_storage.data()[2] = val2; + m_storage.data()[3] = val3; + } + + /** Copy constructor */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Array(const Array& other) + : Base(other) + { } + + private: + struct PrivateType {}; + public: + + /** \sa MatrixBase::operator=(const EigenBase&) */ + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Array(const EigenBase &other, + std::enable_if_t::value, + PrivateType> = PrivateType()) + : Base(other.derived()) + { } + + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index innerStride() const EIGEN_NOEXCEPT{ return 1; } + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index outerStride() const EIGEN_NOEXCEPT { return this->innerSize(); } + + #ifdef EIGEN_ARRAY_PLUGIN + #include EIGEN_ARRAY_PLUGIN + #endif + + private: + + template + friend struct internal::matrix_swap_impl; +}; + +/** \defgroup arraytypedefs Global array typedefs + * \ingroup Core_Module + * + * %Eigen defines several typedef shortcuts for most common 1D and 2D array types. + * + * The general patterns are the following: + * + * \c ArrayRowsColsType where \c Rows and \c Cols can be \c 2,\c 3,\c 4 for fixed size square matrices or \c X for dynamic size, + * and where \c Type can be \c i for integer, \c f for float, \c d for double, \c cf for complex float, \c cd + * for complex double. + * + * For example, \c Array33d is a fixed-size 3x3 array type of doubles, and \c ArrayXXf is a dynamic-size matrix of floats. + * + * There are also \c ArraySizeType which are self-explanatory. For example, \c Array4cf is + * a fixed-size 1D array of 4 complex floats. + * + * With \cpp11, template alias are also defined for common sizes. + * They follow the same pattern as above except that the scalar type suffix is replaced by a + * template parameter, i.e.: + * - `ArrayRowsCols` where `Rows` and `Cols` can be \c 2,\c 3,\c 4, or \c X for fixed or dynamic size. + * - `ArraySize` where `Size` can be \c 2,\c 3,\c 4 or \c X for fixed or dynamic size 1D arrays. + * + * \sa class Array + */ + +#define EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, Size, SizeSuffix) \ +/** \ingroup arraytypedefs */ \ +typedef Array Array##SizeSuffix##SizeSuffix##TypeSuffix; \ +/** \ingroup arraytypedefs */ \ +typedef Array Array##SizeSuffix##TypeSuffix; + +#define EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(Type, TypeSuffix, Size) \ +/** \ingroup arraytypedefs */ \ +typedef Array Array##Size##X##TypeSuffix; \ +/** \ingroup arraytypedefs */ \ +typedef Array Array##X##Size##TypeSuffix; + +#define EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(Type, TypeSuffix) \ +EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, 2, 2) \ +EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, 3, 3) \ +EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, 4, 4) \ +EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, Dynamic, X) \ +EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(Type, TypeSuffix, 2) \ +EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(Type, TypeSuffix, 3) \ +EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(Type, TypeSuffix, 4) + +EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(int, i) +EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(float, f) +EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(double, d) +EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(std::complex, cf) +EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(std::complex, cd) + +#undef EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES +#undef EIGEN_MAKE_ARRAY_TYPEDEFS +#undef EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS + +#define EIGEN_MAKE_ARRAY_TYPEDEFS(Size, SizeSuffix) \ +/** \ingroup arraytypedefs */ \ +/** \brief \cpp11 */ \ +template \ +using Array##SizeSuffix##SizeSuffix = Array; \ +/** \ingroup arraytypedefs */ \ +/** \brief \cpp11 */ \ +template \ +using Array##SizeSuffix = Array; + +#define EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(Size) \ +/** \ingroup arraytypedefs */ \ +/** \brief \cpp11 */ \ +template \ +using Array##Size##X = Array; \ +/** \ingroup arraytypedefs */ \ +/** \brief \cpp11 */ \ +template \ +using Array##X##Size = Array; + +EIGEN_MAKE_ARRAY_TYPEDEFS(2, 2) +EIGEN_MAKE_ARRAY_TYPEDEFS(3, 3) +EIGEN_MAKE_ARRAY_TYPEDEFS(4, 4) +EIGEN_MAKE_ARRAY_TYPEDEFS(Dynamic, X) +EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(2) +EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(3) +EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(4) + +#undef EIGEN_MAKE_ARRAY_TYPEDEFS +#undef EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS + +#define EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, SizeSuffix) \ +using Eigen::Matrix##SizeSuffix##TypeSuffix; \ +using Eigen::Vector##SizeSuffix##TypeSuffix; \ +using Eigen::RowVector##SizeSuffix##TypeSuffix; + +#define EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(TypeSuffix) \ +EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 2) \ +EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 3) \ +EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 4) \ +EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, X) \ + +#define EIGEN_USING_ARRAY_TYPEDEFS \ +EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(i) \ +EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(f) \ +EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(d) \ +EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(cf) \ +EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(cd) + +} // end namespace Eigen + +#endif // EIGEN_ARRAY_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/ArrayBase.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/ArrayBase.h new file mode 100644 index 0000000000000000000000000000000000000000..28397e5cf53e2cfc09ddc1c07441638985fc9c3d --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/ArrayBase.h @@ -0,0 +1,228 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2009 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_ARRAYBASE_H +#define EIGEN_ARRAYBASE_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +template class MatrixWrapper; + +/** \class ArrayBase + * \ingroup Core_Module + * + * \brief Base class for all 1D and 2D array, and related expressions + * + * An array is similar to a dense vector or matrix. While matrices are mathematical + * objects with well defined linear algebra operators, an array is just a collection + * of scalar values arranged in a one or two dimensional fashion. As the main consequence, + * all operations applied to an array are performed coefficient wise. Furthermore, + * arrays support scalar math functions of the c++ standard library (e.g., std::sin(x)), and convenient + * constructors allowing to easily write generic code working for both scalar values + * and arrays. + * + * This class is the base that is inherited by all array expression types. + * + * \tparam Derived is the derived type, e.g., an array or an expression type. + * + * This class can be extended with the help of the plugin mechanism described on the page + * \ref TopicCustomizing_Plugins by defining the preprocessor symbol \c EIGEN_ARRAYBASE_PLUGIN. + * + * \sa class MatrixBase, \ref TopicClassHierarchy + */ +template class ArrayBase + : public DenseBase +{ + public: +#ifndef EIGEN_PARSED_BY_DOXYGEN + /** The base class for a given storage type. */ + typedef ArrayBase StorageBaseType; + + typedef ArrayBase Eigen_BaseClassForSpecializationOfGlobalMathFuncImpl; + + typedef typename internal::traits::StorageKind StorageKind; + typedef typename internal::traits::Scalar Scalar; + typedef typename internal::packet_traits::type PacketScalar; + typedef typename NumTraits::Real RealScalar; + + typedef DenseBase Base; + using Base::RowsAtCompileTime; + using Base::ColsAtCompileTime; + using Base::SizeAtCompileTime; + using Base::MaxRowsAtCompileTime; + using Base::MaxColsAtCompileTime; + using Base::MaxSizeAtCompileTime; + using Base::IsVectorAtCompileTime; + using Base::Flags; + + using Base::derived; + using Base::const_cast_derived; + using Base::rows; + using Base::cols; + using Base::size; + using Base::coeff; + using Base::coeffRef; + using Base::lazyAssign; + using Base::operator-; + using Base::operator=; + using Base::operator+=; + using Base::operator-=; + using Base::operator*=; + using Base::operator/=; + + typedef typename Base::CoeffReturnType CoeffReturnType; + +#endif // not EIGEN_PARSED_BY_DOXYGEN + +#ifndef EIGEN_PARSED_BY_DOXYGEN + typedef typename Base::PlainObject PlainObject; + + /** \internal Represents a matrix with all coefficients equal to one another*/ + typedef CwiseNullaryOp,PlainObject> ConstantReturnType; +#endif // not EIGEN_PARSED_BY_DOXYGEN + +#define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::ArrayBase +#define EIGEN_DOC_UNARY_ADDONS(X,Y) +# include "../plugins/MatrixCwiseUnaryOps.h" +# include "../plugins/ArrayCwiseUnaryOps.h" +# include "../plugins/CommonCwiseBinaryOps.h" +# include "../plugins/MatrixCwiseBinaryOps.h" +# include "../plugins/ArrayCwiseBinaryOps.h" +# ifdef EIGEN_ARRAYBASE_PLUGIN +# include EIGEN_ARRAYBASE_PLUGIN +# endif +#undef EIGEN_CURRENT_STORAGE_BASE_CLASS +#undef EIGEN_DOC_UNARY_ADDONS + + /** Special case of the template operator=, in order to prevent the compiler + * from generating a default operator= (issue hit with g++ 4.1) + */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Derived& operator=(const ArrayBase& other) + { + internal::call_assignment(derived(), other.derived()); + return derived(); + } + + /** Set all the entries to \a value. + * \sa DenseBase::setConstant(), DenseBase::fill() */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Derived& operator=(const Scalar &value) + { Base::setConstant(value); return derived(); } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Derived& operator+=(const Scalar& scalar); + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Derived& operator-=(const Scalar& scalar); + + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Derived& operator+=(const ArrayBase& other); + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Derived& operator-=(const ArrayBase& other); + + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Derived& operator*=(const ArrayBase& other); + + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Derived& operator/=(const ArrayBase& other); + + public: + EIGEN_DEVICE_FUNC + ArrayBase& array() { return *this; } + EIGEN_DEVICE_FUNC + const ArrayBase& array() const { return *this; } + + /** \returns an \link Eigen::MatrixBase Matrix \endlink expression of this array + * \sa MatrixBase::array() */ + EIGEN_DEVICE_FUNC + MatrixWrapper matrix() { return MatrixWrapper(derived()); } + EIGEN_DEVICE_FUNC + const MatrixWrapper matrix() const { return MatrixWrapper(derived()); } + +// template +// inline void evalTo(Dest& dst) const { dst = matrix(); } + + protected: + EIGEN_DEFAULT_COPY_CONSTRUCTOR(ArrayBase) + EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(ArrayBase) + + private: + explicit ArrayBase(Index); + ArrayBase(Index,Index); + template explicit ArrayBase(const ArrayBase&); + protected: + // mixing arrays and matrices is not legal + template Derived& operator+=(const MatrixBase& ) + {EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES); return *this;} + // mixing arrays and matrices is not legal + template Derived& operator-=(const MatrixBase& ) + {EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES); return *this;} +}; + +/** replaces \c *this by \c *this - \a other. + * + * \returns a reference to \c *this + */ +template +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & +ArrayBase::operator-=(const ArrayBase &other) +{ + call_assignment(derived(), other.derived(), internal::sub_assign_op()); + return derived(); +} + +/** replaces \c *this by \c *this + \a other. + * + * \returns a reference to \c *this + */ +template +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & +ArrayBase::operator+=(const ArrayBase& other) +{ + call_assignment(derived(), other.derived(), internal::add_assign_op()); + return derived(); +} + +/** replaces \c *this by \c *this * \a other coefficient wise. + * + * \returns a reference to \c *this + */ +template +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & +ArrayBase::operator*=(const ArrayBase& other) +{ + call_assignment(derived(), other.derived(), internal::mul_assign_op()); + return derived(); +} + +/** replaces \c *this by \c *this / \a other coefficient wise. + * + * \returns a reference to \c *this + */ +template +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & +ArrayBase::operator/=(const ArrayBase& other) +{ + call_assignment(derived(), other.derived(), internal::div_assign_op()); + return derived(); +} + +} // end namespace Eigen + +#endif // EIGEN_ARRAYBASE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/ArrayWrapper.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/ArrayWrapper.h new file mode 100644 index 0000000000000000000000000000000000000000..e65b8fb17df1c26fe4b7afaa9fa1bc2881e73174 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/ArrayWrapper.h @@ -0,0 +1,211 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2009-2010 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_ARRAYWRAPPER_H +#define EIGEN_ARRAYWRAPPER_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +/** \class ArrayWrapper + * \ingroup Core_Module + * + * \brief Expression of a mathematical vector or matrix as an array object + * + * This class is the return type of MatrixBase::array(), and most of the time + * this is the only way it is use. + * + * \sa MatrixBase::array(), class MatrixWrapper + */ + +namespace internal { +template +struct traits > + : public traits > +{ + typedef ArrayXpr XprKind; + // Let's remove NestByRefBit + enum { + Flags0 = traits >::Flags, + LvalueBitFlag = is_lvalue::value ? LvalueBit : 0, + Flags = (Flags0 & ~(NestByRefBit | LvalueBit)) | LvalueBitFlag + }; +}; +} + +template +class ArrayWrapper : public ArrayBase > +{ + public: + typedef ArrayBase Base; + EIGEN_DENSE_PUBLIC_INTERFACE(ArrayWrapper) + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(ArrayWrapper) + typedef internal::remove_all_t NestedExpression; + + typedef std::conditional_t< + internal::is_lvalue::value, + Scalar, + const Scalar + > ScalarWithConstIfNotLvalue; + + typedef typename internal::ref_selector::non_const_type NestedExpressionType; + + using Base::coeffRef; + + EIGEN_DEVICE_FUNC + explicit EIGEN_STRONG_INLINE ArrayWrapper(ExpressionType& matrix) : m_expression(matrix) {} + + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index rows() const EIGEN_NOEXCEPT { return m_expression.rows(); } + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index cols() const EIGEN_NOEXCEPT { return m_expression.cols(); } + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index outerStride() const EIGEN_NOEXCEPT { return m_expression.outerStride(); } + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index innerStride() const EIGEN_NOEXCEPT { return m_expression.innerStride(); } + + EIGEN_DEVICE_FUNC + inline ScalarWithConstIfNotLvalue* data() { return m_expression.data(); } + EIGEN_DEVICE_FUNC + inline const Scalar* data() const { return m_expression.data(); } + + EIGEN_DEVICE_FUNC + inline const Scalar& coeffRef(Index rowId, Index colId) const + { + return m_expression.coeffRef(rowId, colId); + } + + EIGEN_DEVICE_FUNC + inline const Scalar& coeffRef(Index index) const + { + return m_expression.coeffRef(index); + } + + template + EIGEN_DEVICE_FUNC + inline void evalTo(Dest& dst) const { dst = m_expression; } + + EIGEN_DEVICE_FUNC + const internal::remove_all_t& + nestedExpression() const + { + return m_expression; + } + + /** Forwards the resizing request to the nested expression + * \sa DenseBase::resize(Index) */ + EIGEN_DEVICE_FUNC + void resize(Index newSize) { m_expression.resize(newSize); } + /** Forwards the resizing request to the nested expression + * \sa DenseBase::resize(Index,Index)*/ + EIGEN_DEVICE_FUNC + void resize(Index rows, Index cols) { m_expression.resize(rows,cols); } + + protected: + NestedExpressionType m_expression; +}; + +/** \class MatrixWrapper + * \ingroup Core_Module + * + * \brief Expression of an array as a mathematical vector or matrix + * + * This class is the return type of ArrayBase::matrix(), and most of the time + * this is the only way it is use. + * + * \sa MatrixBase::matrix(), class ArrayWrapper + */ + +namespace internal { +template +struct traits > + : public traits > +{ + typedef MatrixXpr XprKind; + // Let's remove NestByRefBit + enum { + Flags0 = traits >::Flags, + LvalueBitFlag = is_lvalue::value ? LvalueBit : 0, + Flags = (Flags0 & ~(NestByRefBit | LvalueBit)) | LvalueBitFlag + }; +}; +} + +template +class MatrixWrapper : public MatrixBase > +{ + public: + typedef MatrixBase > Base; + EIGEN_DENSE_PUBLIC_INTERFACE(MatrixWrapper) + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(MatrixWrapper) + typedef internal::remove_all_t NestedExpression; + + typedef std::conditional_t< + internal::is_lvalue::value, + Scalar, + const Scalar + > ScalarWithConstIfNotLvalue; + + typedef typename internal::ref_selector::non_const_type NestedExpressionType; + + using Base::coeffRef; + + EIGEN_DEVICE_FUNC + explicit inline MatrixWrapper(ExpressionType& matrix) : m_expression(matrix) {} + + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index rows() const EIGEN_NOEXCEPT { return m_expression.rows(); } + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index cols() const EIGEN_NOEXCEPT { return m_expression.cols(); } + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index outerStride() const EIGEN_NOEXCEPT { return m_expression.outerStride(); } + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index innerStride() const EIGEN_NOEXCEPT { return m_expression.innerStride(); } + + EIGEN_DEVICE_FUNC + inline ScalarWithConstIfNotLvalue* data() { return m_expression.data(); } + EIGEN_DEVICE_FUNC + inline const Scalar* data() const { return m_expression.data(); } + + EIGEN_DEVICE_FUNC + inline const Scalar& coeffRef(Index rowId, Index colId) const + { + return m_expression.derived().coeffRef(rowId, colId); + } + + EIGEN_DEVICE_FUNC + inline const Scalar& coeffRef(Index index) const + { + return m_expression.coeffRef(index); + } + + EIGEN_DEVICE_FUNC + const internal::remove_all_t& + nestedExpression() const + { + return m_expression; + } + + /** Forwards the resizing request to the nested expression + * \sa DenseBase::resize(Index) */ + EIGEN_DEVICE_FUNC + void resize(Index newSize) { m_expression.resize(newSize); } + /** Forwards the resizing request to the nested expression + * \sa DenseBase::resize(Index,Index)*/ + EIGEN_DEVICE_FUNC + void resize(Index rows, Index cols) { m_expression.resize(rows,cols); } + + protected: + NestedExpressionType m_expression; +}; + +} // end namespace Eigen + +#endif // EIGEN_ARRAYWRAPPER_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Assign.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Assign.h new file mode 100644 index 0000000000000000000000000000000000000000..dc716d3d8f5e5172c96c2e172c9ab14bf7eb373b --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Assign.h @@ -0,0 +1,92 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2007 Michael Olbrich +// Copyright (C) 2006-2010 Benoit Jacob +// Copyright (C) 2008 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_ASSIGN_H +#define EIGEN_ASSIGN_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +template +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase + ::lazyAssign(const DenseBase& other) +{ + enum{ + SameType = internal::is_same::value + }; + + EIGEN_STATIC_ASSERT_LVALUE(Derived) + EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Derived,OtherDerived) + EIGEN_STATIC_ASSERT(SameType,YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) + + eigen_assert(rows() == other.rows() && cols() == other.cols()); + internal::call_assignment_no_alias(derived(),other.derived()); + + return derived(); +} + +template +template +EIGEN_DEVICE_FUNC +EIGEN_STRONG_INLINE Derived& DenseBase::operator=(const DenseBase& other) +{ + internal::call_assignment(derived(), other.derived()); + return derived(); +} + +template +EIGEN_DEVICE_FUNC +EIGEN_STRONG_INLINE Derived& DenseBase::operator=(const DenseBase& other) +{ + internal::call_assignment(derived(), other.derived()); + return derived(); +} + +template +EIGEN_DEVICE_FUNC +EIGEN_STRONG_INLINE Derived& MatrixBase::operator=(const MatrixBase& other) +{ + internal::call_assignment(derived(), other.derived()); + return derived(); +} + +template +template +EIGEN_DEVICE_FUNC +EIGEN_STRONG_INLINE Derived& MatrixBase::operator=(const DenseBase& other) +{ + internal::call_assignment(derived(), other.derived()); + return derived(); +} + +template +template +EIGEN_DEVICE_FUNC +EIGEN_STRONG_INLINE Derived& MatrixBase::operator=(const EigenBase& other) +{ + internal::call_assignment(derived(), other.derived()); + return derived(); +} + +template +template +EIGEN_DEVICE_FUNC +EIGEN_STRONG_INLINE Derived& MatrixBase::operator=(const ReturnByValue& other) +{ + other.derived().evalTo(derived()); + return derived(); +} + +} // end namespace Eigen + +#endif // EIGEN_ASSIGN_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/AssignEvaluator.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/AssignEvaluator.h new file mode 100644 index 0000000000000000000000000000000000000000..ec03822409b5e173f89e71f952620d817226b189 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/AssignEvaluator.h @@ -0,0 +1,1035 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2011 Benoit Jacob +// Copyright (C) 2011-2014 Gael Guennebaud +// Copyright (C) 2011-2012 Jitse Niesen +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_ASSIGN_EVALUATOR_H +#define EIGEN_ASSIGN_EVALUATOR_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +// This implementation is based on Assign.h + +namespace internal { + +/*************************************************************************** +* Part 1 : the logic deciding a strategy for traversal and unrolling * +***************************************************************************/ + +// copy_using_evaluator_traits is based on assign_traits + +template +struct copy_using_evaluator_traits +{ + typedef typename DstEvaluator::XprType Dst; + typedef typename Dst::Scalar DstScalar; + + enum { + DstFlags = DstEvaluator::Flags, + SrcFlags = SrcEvaluator::Flags + }; + +public: + enum { + DstAlignment = DstEvaluator::Alignment, + SrcAlignment = SrcEvaluator::Alignment, + DstHasDirectAccess = (DstFlags & DirectAccessBit) == DirectAccessBit, + JointAlignment = plain_enum_min(DstAlignment, SrcAlignment) + }; + +private: + enum { + InnerSize = int(Dst::IsVectorAtCompileTime) ? int(Dst::SizeAtCompileTime) + : int(DstFlags)&RowMajorBit ? int(Dst::ColsAtCompileTime) + : int(Dst::RowsAtCompileTime), + InnerMaxSize = int(Dst::IsVectorAtCompileTime) ? int(Dst::MaxSizeAtCompileTime) + : int(DstFlags)&RowMajorBit ? int(Dst::MaxColsAtCompileTime) + : int(Dst::MaxRowsAtCompileTime), + RestrictedInnerSize = min_size_prefer_fixed(InnerSize, MaxPacketSize), + RestrictedLinearSize = min_size_prefer_fixed(Dst::SizeAtCompileTime, MaxPacketSize), + OuterStride = int(outer_stride_at_compile_time::ret), + MaxSizeAtCompileTime = Dst::SizeAtCompileTime + }; + + // TODO distinguish between linear traversal and inner-traversals + typedef typename find_best_packet::type LinearPacketType; + typedef typename find_best_packet::type InnerPacketType; + + enum { + LinearPacketSize = unpacket_traits::size, + InnerPacketSize = unpacket_traits::size + }; + +public: + enum { + LinearRequiredAlignment = unpacket_traits::alignment, + InnerRequiredAlignment = unpacket_traits::alignment + }; + +private: + enum { + DstIsRowMajor = DstFlags&RowMajorBit, + SrcIsRowMajor = SrcFlags&RowMajorBit, + StorageOrdersAgree = (int(DstIsRowMajor) == int(SrcIsRowMajor)), + MightVectorize = bool(StorageOrdersAgree) + && (int(DstFlags) & int(SrcFlags) & ActualPacketAccessBit) + && bool(functor_traits::PacketAccess), + MayInnerVectorize = MightVectorize + && int(InnerSize)!=Dynamic && int(InnerSize)%int(InnerPacketSize)==0 + && int(OuterStride)!=Dynamic && int(OuterStride)%int(InnerPacketSize)==0 + && (EIGEN_UNALIGNED_VECTORIZE || int(JointAlignment)>=int(InnerRequiredAlignment)), + MayLinearize = bool(StorageOrdersAgree) && (int(DstFlags) & int(SrcFlags) & LinearAccessBit), + MayLinearVectorize = bool(MightVectorize) && bool(MayLinearize) && bool(DstHasDirectAccess) + && (EIGEN_UNALIGNED_VECTORIZE || (int(DstAlignment)>=int(LinearRequiredAlignment)) || MaxSizeAtCompileTime == Dynamic), + /* If the destination isn't aligned, we have to do runtime checks and we don't unroll, + so it's only good for large enough sizes. */ + MaySliceVectorize = bool(MightVectorize) && bool(DstHasDirectAccess) + && (int(InnerMaxSize)==Dynamic || int(InnerMaxSize)>=(EIGEN_UNALIGNED_VECTORIZE?InnerPacketSize:(3*InnerPacketSize))) + /* slice vectorization can be slow, so we only want it if the slices are big, which is + indicated by InnerMaxSize rather than InnerSize, think of the case of a dynamic block + in a fixed-size matrix + However, with EIGEN_UNALIGNED_VECTORIZE and unrolling, slice vectorization is still worth it */ + }; + +public: + enum { + Traversal = int(Dst::SizeAtCompileTime) == 0 ? int(AllAtOnceTraversal) // If compile-size is zero, traversing will fail at compile-time. + : (int(MayLinearVectorize) && (LinearPacketSize>InnerPacketSize)) ? int(LinearVectorizedTraversal) + : int(MayInnerVectorize) ? int(InnerVectorizedTraversal) + : int(MayLinearVectorize) ? int(LinearVectorizedTraversal) + : int(MaySliceVectorize) ? int(SliceVectorizedTraversal) + : int(MayLinearize) ? int(LinearTraversal) + : int(DefaultTraversal), + Vectorized = int(Traversal) == InnerVectorizedTraversal + || int(Traversal) == LinearVectorizedTraversal + || int(Traversal) == SliceVectorizedTraversal + }; + + typedef std::conditional_t PacketType; + +private: + enum { + ActualPacketSize = int(Traversal)==LinearVectorizedTraversal ? LinearPacketSize + : Vectorized ? InnerPacketSize + : 1, + UnrollingLimit = EIGEN_UNROLLING_LIMIT * ActualPacketSize, + MayUnrollCompletely = int(Dst::SizeAtCompileTime) != Dynamic + && int(Dst::SizeAtCompileTime) * (int(DstEvaluator::CoeffReadCost)+int(SrcEvaluator::CoeffReadCost)) <= int(UnrollingLimit), + MayUnrollInner = int(InnerSize) != Dynamic + && int(InnerSize) * (int(DstEvaluator::CoeffReadCost)+int(SrcEvaluator::CoeffReadCost)) <= int(UnrollingLimit) + }; + +public: + enum { + Unrolling = (int(Traversal) == int(InnerVectorizedTraversal) || int(Traversal) == int(DefaultTraversal)) + ? ( + int(MayUnrollCompletely) ? int(CompleteUnrolling) + : int(MayUnrollInner) ? int(InnerUnrolling) + : int(NoUnrolling) + ) + : int(Traversal) == int(LinearVectorizedTraversal) + ? ( bool(MayUnrollCompletely) && ( EIGEN_UNALIGNED_VECTORIZE || (int(DstAlignment)>=int(LinearRequiredAlignment))) + ? int(CompleteUnrolling) + : int(NoUnrolling) ) + : int(Traversal) == int(LinearTraversal) + ? ( bool(MayUnrollCompletely) ? int(CompleteUnrolling) + : int(NoUnrolling) ) +#if EIGEN_UNALIGNED_VECTORIZE + : int(Traversal) == int(SliceVectorizedTraversal) + ? ( bool(MayUnrollInner) ? int(InnerUnrolling) + : int(NoUnrolling) ) +#endif + : int(NoUnrolling) + }; + +#ifdef EIGEN_DEBUG_ASSIGN + static void debug() + { + std::cerr << "DstXpr: " << typeid(typename DstEvaluator::XprType).name() << std::endl; + std::cerr << "SrcXpr: " << typeid(typename SrcEvaluator::XprType).name() << std::endl; + std::cerr.setf(std::ios::hex, std::ios::basefield); + std::cerr << "DstFlags" << " = " << DstFlags << " (" << demangle_flags(DstFlags) << " )" << std::endl; + std::cerr << "SrcFlags" << " = " << SrcFlags << " (" << demangle_flags(SrcFlags) << " )" << std::endl; + std::cerr.unsetf(std::ios::hex); + EIGEN_DEBUG_VAR(DstAlignment) + EIGEN_DEBUG_VAR(SrcAlignment) + EIGEN_DEBUG_VAR(LinearRequiredAlignment) + EIGEN_DEBUG_VAR(InnerRequiredAlignment) + EIGEN_DEBUG_VAR(JointAlignment) + EIGEN_DEBUG_VAR(InnerSize) + EIGEN_DEBUG_VAR(InnerMaxSize) + EIGEN_DEBUG_VAR(LinearPacketSize) + EIGEN_DEBUG_VAR(InnerPacketSize) + EIGEN_DEBUG_VAR(ActualPacketSize) + EIGEN_DEBUG_VAR(StorageOrdersAgree) + EIGEN_DEBUG_VAR(MightVectorize) + EIGEN_DEBUG_VAR(MayLinearize) + EIGEN_DEBUG_VAR(MayInnerVectorize) + EIGEN_DEBUG_VAR(MayLinearVectorize) + EIGEN_DEBUG_VAR(MaySliceVectorize) + std::cerr << "Traversal" << " = " << Traversal << " (" << demangle_traversal(Traversal) << ")" << std::endl; + EIGEN_DEBUG_VAR(SrcEvaluator::CoeffReadCost) + EIGEN_DEBUG_VAR(DstEvaluator::CoeffReadCost) + EIGEN_DEBUG_VAR(Dst::SizeAtCompileTime) + EIGEN_DEBUG_VAR(UnrollingLimit) + EIGEN_DEBUG_VAR(MayUnrollCompletely) + EIGEN_DEBUG_VAR(MayUnrollInner) + std::cerr << "Unrolling" << " = " << Unrolling << " (" << demangle_unrolling(Unrolling) << ")" << std::endl; + std::cerr << std::endl; + } +#endif +}; + +/*************************************************************************** +* Part 2 : meta-unrollers +***************************************************************************/ + +/************************ +*** Default traversal *** +************************/ + +template +struct copy_using_evaluator_DefaultTraversal_CompleteUnrolling +{ + // FIXME: this is not very clean, perhaps this information should be provided by the kernel? + typedef typename Kernel::DstEvaluatorType DstEvaluatorType; + typedef typename DstEvaluatorType::XprType DstXprType; + + enum { + outer = Index / DstXprType::InnerSizeAtCompileTime, + inner = Index % DstXprType::InnerSizeAtCompileTime + }; + + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel) + { + kernel.assignCoeffByOuterInner(outer, inner); + copy_using_evaluator_DefaultTraversal_CompleteUnrolling::run(kernel); + } +}; + +template +struct copy_using_evaluator_DefaultTraversal_CompleteUnrolling +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel&) { } +}; + +template +struct copy_using_evaluator_DefaultTraversal_InnerUnrolling +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel, Index outer) + { + kernel.assignCoeffByOuterInner(outer, Index_); + copy_using_evaluator_DefaultTraversal_InnerUnrolling::run(kernel, outer); + } +}; + +template +struct copy_using_evaluator_DefaultTraversal_InnerUnrolling +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel&, Index) { } +}; + +/*********************** +*** Linear traversal *** +***********************/ + +template +struct copy_using_evaluator_LinearTraversal_CompleteUnrolling +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel& kernel) + { + kernel.assignCoeff(Index); + copy_using_evaluator_LinearTraversal_CompleteUnrolling::run(kernel); + } +}; + +template +struct copy_using_evaluator_LinearTraversal_CompleteUnrolling +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel&) { } +}; + +/************************** +*** Inner vectorization *** +**************************/ + +template +struct copy_using_evaluator_innervec_CompleteUnrolling +{ + // FIXME: this is not very clean, perhaps this information should be provided by the kernel? + typedef typename Kernel::DstEvaluatorType DstEvaluatorType; + typedef typename DstEvaluatorType::XprType DstXprType; + typedef typename Kernel::PacketType PacketType; + + enum { + outer = Index / DstXprType::InnerSizeAtCompileTime, + inner = Index % DstXprType::InnerSizeAtCompileTime, + SrcAlignment = Kernel::AssignmentTraits::SrcAlignment, + DstAlignment = Kernel::AssignmentTraits::DstAlignment + }; + + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel) + { + kernel.template assignPacketByOuterInner(outer, inner); + enum { NextIndex = Index + unpacket_traits::size }; + copy_using_evaluator_innervec_CompleteUnrolling::run(kernel); + } +}; + +template +struct copy_using_evaluator_innervec_CompleteUnrolling +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel&) { } +}; + +template +struct copy_using_evaluator_innervec_InnerUnrolling +{ + typedef typename Kernel::PacketType PacketType; + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel, Index outer) + { + kernel.template assignPacketByOuterInner(outer, Index_); + enum { NextIndex = Index_ + unpacket_traits::size }; + copy_using_evaluator_innervec_InnerUnrolling::run(kernel, outer); + } +}; + +template +struct copy_using_evaluator_innervec_InnerUnrolling +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &, Index) { } +}; + +/*************************************************************************** +* Part 3 : implementation of all cases +***************************************************************************/ + +// dense_assignment_loop is based on assign_impl + +template +struct dense_assignment_loop; + +/************************ +***** Special Cases ***** +************************/ + +// Zero-sized assignment is a no-op. +template +struct dense_assignment_loop +{ + EIGEN_DEVICE_FUNC static void EIGEN_STRONG_INLINE EIGEN_CONSTEXPR run(Kernel& /*kernel*/) + { + EIGEN_STATIC_ASSERT(int(Kernel::DstEvaluatorType::XprType::SizeAtCompileTime) == 0, + EIGEN_INTERNAL_ERROR_PLEASE_FILE_A_BUG_REPORT) + } +}; + +/************************ +*** Default traversal *** +************************/ + +template +struct dense_assignment_loop +{ + EIGEN_DEVICE_FUNC static void EIGEN_STRONG_INLINE run(Kernel &kernel) + { + for(Index outer = 0; outer < kernel.outerSize(); ++outer) { + for(Index inner = 0; inner < kernel.innerSize(); ++inner) { + kernel.assignCoeffByOuterInner(outer, inner); + } + } + } +}; + +template +struct dense_assignment_loop +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel) + { + typedef typename Kernel::DstEvaluatorType::XprType DstXprType; + copy_using_evaluator_DefaultTraversal_CompleteUnrolling::run(kernel); + } +}; + +template +struct dense_assignment_loop +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel) + { + typedef typename Kernel::DstEvaluatorType::XprType DstXprType; + + const Index outerSize = kernel.outerSize(); + for(Index outer = 0; outer < outerSize; ++outer) + copy_using_evaluator_DefaultTraversal_InnerUnrolling::run(kernel, outer); + } +}; + +/*************************** +*** Linear vectorization *** +***************************/ + + +// The goal of unaligned_dense_assignment_loop is simply to factorize the handling +// of the non vectorizable beginning and ending parts + +template +struct unaligned_dense_assignment_loop +{ + // if IsAligned = true, then do nothing + template + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel&, Index, Index) {} +}; + +template <> +struct unaligned_dense_assignment_loop +{ + // MSVC must not inline this functions. If it does, it fails to optimize the + // packet access path. + // FIXME check which version exhibits this issue +#if EIGEN_COMP_MSVC + template + static EIGEN_DONT_INLINE void run(Kernel &kernel, + Index start, + Index end) +#else + template + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel &kernel, + Index start, + Index end) +#endif + { + for (Index index = start; index < end; ++index) + kernel.assignCoeff(index); + } +}; + +template +struct copy_using_evaluator_linearvec_CompleteUnrolling { + // FIXME: this is not very clean, perhaps this information should be provided by the kernel? + typedef typename Kernel::DstEvaluatorType DstEvaluatorType; + typedef typename DstEvaluatorType::XprType DstXprType; + typedef typename Kernel::PacketType PacketType; + + enum { + SrcAlignment = Kernel::AssignmentTraits::SrcAlignment, + DstAlignment = Kernel::AssignmentTraits::DstAlignment + }; + + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel& kernel) { + kernel.template assignPacket(Index); + enum { NextIndex = Index + unpacket_traits::size }; + copy_using_evaluator_linearvec_CompleteUnrolling::run(kernel); + } +}; + +template +struct copy_using_evaluator_linearvec_CompleteUnrolling { + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel&) {} +}; + +template +struct dense_assignment_loop +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel &kernel) + { + const Index size = kernel.size(); + typedef typename Kernel::Scalar Scalar; + typedef typename Kernel::PacketType PacketType; + enum { + requestedAlignment = Kernel::AssignmentTraits::LinearRequiredAlignment, + packetSize = unpacket_traits::size, + dstIsAligned = int(Kernel::AssignmentTraits::DstAlignment)>=int(requestedAlignment), + dstAlignment = packet_traits::AlignedOnScalar ? int(requestedAlignment) + : int(Kernel::AssignmentTraits::DstAlignment), + srcAlignment = Kernel::AssignmentTraits::JointAlignment + }; + const Index alignedStart = dstIsAligned ? 0 : internal::first_aligned(kernel.dstDataPtr(), size); + const Index alignedEnd = alignedStart + ((size-alignedStart)/packetSize)*packetSize; + + unaligned_dense_assignment_loop::run(kernel, 0, alignedStart); + + for(Index index = alignedStart; index < alignedEnd; index += packetSize) + kernel.template assignPacket(index); + + unaligned_dense_assignment_loop<>::run(kernel, alignedEnd, size); + } +}; + +template +struct dense_assignment_loop +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel &kernel) + { + typedef typename Kernel::DstEvaluatorType::XprType DstXprType; + typedef typename Kernel::PacketType PacketType; + + enum { size = DstXprType::SizeAtCompileTime, + packetSize =unpacket_traits::size, + alignedSize = (int(size)/packetSize)*packetSize }; + + copy_using_evaluator_linearvec_CompleteUnrolling::run(kernel); + copy_using_evaluator_LinearTraversal_CompleteUnrolling::run(kernel); + } +}; + +/************************** +*** Inner vectorization *** +**************************/ + +template +struct dense_assignment_loop +{ + typedef typename Kernel::PacketType PacketType; + enum { + SrcAlignment = Kernel::AssignmentTraits::SrcAlignment, + DstAlignment = Kernel::AssignmentTraits::DstAlignment + }; + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel &kernel) + { + const Index innerSize = kernel.innerSize(); + const Index outerSize = kernel.outerSize(); + const Index packetSize = unpacket_traits::size; + for(Index outer = 0; outer < outerSize; ++outer) + for(Index inner = 0; inner < innerSize; inner+=packetSize) + kernel.template assignPacketByOuterInner(outer, inner); + } +}; + +template +struct dense_assignment_loop +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel) + { + typedef typename Kernel::DstEvaluatorType::XprType DstXprType; + copy_using_evaluator_innervec_CompleteUnrolling::run(kernel); + } +}; + +template +struct dense_assignment_loop +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel) + { + typedef typename Kernel::DstEvaluatorType::XprType DstXprType; + typedef typename Kernel::AssignmentTraits Traits; + const Index outerSize = kernel.outerSize(); + for(Index outer = 0; outer < outerSize; ++outer) + copy_using_evaluator_innervec_InnerUnrolling::run(kernel, outer); + } +}; + +/*********************** +*** Linear traversal *** +***********************/ + +template +struct dense_assignment_loop +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel &kernel) + { + const Index size = kernel.size(); + for(Index i = 0; i < size; ++i) + kernel.assignCoeff(i); + } +}; + +template +struct dense_assignment_loop +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel &kernel) + { + typedef typename Kernel::DstEvaluatorType::XprType DstXprType; + copy_using_evaluator_LinearTraversal_CompleteUnrolling::run(kernel); + } +}; + +/************************** +*** Slice vectorization *** +***************************/ + +template +struct dense_assignment_loop +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel &kernel) + { + typedef typename Kernel::Scalar Scalar; + typedef typename Kernel::PacketType PacketType; + enum { + packetSize = unpacket_traits::size, + requestedAlignment = int(Kernel::AssignmentTraits::InnerRequiredAlignment), + alignable = packet_traits::AlignedOnScalar || int(Kernel::AssignmentTraits::DstAlignment)>=sizeof(Scalar), + dstIsAligned = int(Kernel::AssignmentTraits::DstAlignment)>=int(requestedAlignment), + dstAlignment = alignable ? int(requestedAlignment) + : int(Kernel::AssignmentTraits::DstAlignment) + }; + const Scalar *dst_ptr = kernel.dstDataPtr(); + if((!bool(dstIsAligned)) && (std::uintptr_t(dst_ptr) % sizeof(Scalar))>0) + { + // the pointer is not aligned-on scalar, so alignment is not possible + return dense_assignment_loop::run(kernel); + } + const Index packetAlignedMask = packetSize - 1; + const Index innerSize = kernel.innerSize(); + const Index outerSize = kernel.outerSize(); + const Index alignedStep = alignable ? (packetSize - kernel.outerStride() % packetSize) & packetAlignedMask : 0; + Index alignedStart = ((!alignable) || bool(dstIsAligned)) ? 0 : internal::first_aligned(dst_ptr, innerSize); + + for(Index outer = 0; outer < outerSize; ++outer) + { + const Index alignedEnd = alignedStart + ((innerSize-alignedStart) & ~packetAlignedMask); + // do the non-vectorizable part of the assignment + for(Index inner = 0; inner(outer, inner); + + // do the non-vectorizable part of the assignment + for(Index inner = alignedEnd; inner +struct dense_assignment_loop +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel &kernel) + { + typedef typename Kernel::DstEvaluatorType::XprType DstXprType; + typedef typename Kernel::PacketType PacketType; + + enum { innerSize = DstXprType::InnerSizeAtCompileTime, + packetSize =unpacket_traits::size, + vectorizableSize = (int(innerSize) / int(packetSize)) * int(packetSize), + size = DstXprType::SizeAtCompileTime }; + + for(Index outer = 0; outer < kernel.outerSize(); ++outer) + { + copy_using_evaluator_innervec_InnerUnrolling::run(kernel, outer); + copy_using_evaluator_DefaultTraversal_InnerUnrolling::run(kernel, outer); + } + } +}; +#endif + + +/*************************************************************************** +* Part 4 : Generic dense assignment kernel +***************************************************************************/ + +// This class generalize the assignment of a coefficient (or packet) from one dense evaluator +// to another dense writable evaluator. +// It is parametrized by the two evaluators, and the actual assignment functor. +// This abstraction level permits to keep the evaluation loops as simple and as generic as possible. +// One can customize the assignment using this generic dense_assignment_kernel with different +// functors, or by completely overloading it, by-passing a functor. +template +class generic_dense_assignment_kernel +{ +protected: + typedef typename DstEvaluatorTypeT::XprType DstXprType; + typedef typename SrcEvaluatorTypeT::XprType SrcXprType; +public: + + typedef DstEvaluatorTypeT DstEvaluatorType; + typedef SrcEvaluatorTypeT SrcEvaluatorType; + typedef typename DstEvaluatorType::Scalar Scalar; + typedef copy_using_evaluator_traits AssignmentTraits; + typedef typename AssignmentTraits::PacketType PacketType; + + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + generic_dense_assignment_kernel(DstEvaluatorType &dst, const SrcEvaluatorType &src, const Functor &func, DstXprType& dstExpr) + : m_dst(dst), m_src(src), m_functor(func), m_dstExpr(dstExpr) + { + #ifdef EIGEN_DEBUG_ASSIGN + AssignmentTraits::debug(); + #endif + } + + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index size() const EIGEN_NOEXCEPT { return m_dstExpr.size(); } + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index innerSize() const EIGEN_NOEXCEPT { return m_dstExpr.innerSize(); } + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index outerSize() const EIGEN_NOEXCEPT { return m_dstExpr.outerSize(); } + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_dstExpr.rows(); } + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_dstExpr.cols(); } + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index outerStride() const EIGEN_NOEXCEPT { return m_dstExpr.outerStride(); } + + EIGEN_DEVICE_FUNC DstEvaluatorType& dstEvaluator() EIGEN_NOEXCEPT { return m_dst; } + EIGEN_DEVICE_FUNC const SrcEvaluatorType& srcEvaluator() const EIGEN_NOEXCEPT { return m_src; } + + /// Assign src(row,col) to dst(row,col) through the assignment functor. + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void assignCoeff(Index row, Index col) + { + m_functor.assignCoeff(m_dst.coeffRef(row,col), m_src.coeff(row,col)); + } + + /// \sa assignCoeff(Index,Index) + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void assignCoeff(Index index) + { + m_functor.assignCoeff(m_dst.coeffRef(index), m_src.coeff(index)); + } + + /// \sa assignCoeff(Index,Index) + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void assignCoeffByOuterInner(Index outer, Index inner) + { + Index row = rowIndexByOuterInner(outer, inner); + Index col = colIndexByOuterInner(outer, inner); + assignCoeff(row, col); + } + + + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void assignPacket(Index row, Index col) + { + m_functor.template assignPacket(&m_dst.coeffRef(row,col), m_src.template packet(row,col)); + } + + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void assignPacket(Index index) + { + m_functor.template assignPacket(&m_dst.coeffRef(index), m_src.template packet(index)); + } + + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void assignPacketByOuterInner(Index outer, Index inner) + { + Index row = rowIndexByOuterInner(outer, inner); + Index col = colIndexByOuterInner(outer, inner); + assignPacket(row, col); + } + + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE Index rowIndexByOuterInner(Index outer, Index inner) + { + typedef typename DstEvaluatorType::ExpressionTraits Traits; + return int(Traits::RowsAtCompileTime) == 1 ? 0 + : int(Traits::ColsAtCompileTime) == 1 ? inner + : int(DstEvaluatorType::Flags)&RowMajorBit ? outer + : inner; + } + + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE Index colIndexByOuterInner(Index outer, Index inner) + { + typedef typename DstEvaluatorType::ExpressionTraits Traits; + return int(Traits::ColsAtCompileTime) == 1 ? 0 + : int(Traits::RowsAtCompileTime) == 1 ? inner + : int(DstEvaluatorType::Flags)&RowMajorBit ? inner + : outer; + } + + EIGEN_DEVICE_FUNC const Scalar* dstDataPtr() const + { + return m_dstExpr.data(); + } + +protected: + DstEvaluatorType& m_dst; + const SrcEvaluatorType& m_src; + const Functor &m_functor; + // TODO find a way to avoid the needs of the original expression + DstXprType& m_dstExpr; +}; + +// Special kernel used when computing small products whose operands have dynamic dimensions. It ensures that the +// PacketSize used is no larger than 4, thereby increasing the chance that vectorized instructions will be used +// when computing the product. + +template +class restricted_packet_dense_assignment_kernel : public generic_dense_assignment_kernel +{ +protected: + typedef generic_dense_assignment_kernel Base; + public: + typedef typename Base::Scalar Scalar; + typedef typename Base::DstXprType DstXprType; + typedef copy_using_evaluator_traits AssignmentTraits; + typedef typename AssignmentTraits::PacketType PacketType; + + EIGEN_DEVICE_FUNC restricted_packet_dense_assignment_kernel(DstEvaluatorTypeT &dst, const SrcEvaluatorTypeT &src, const Functor &func, DstXprType& dstExpr) + : Base(dst, src, func, dstExpr) + { + } + }; + +/*************************************************************************** +* Part 5 : Entry point for dense rectangular assignment +***************************************************************************/ + +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE +void resize_if_allowed(DstXprType &dst, const SrcXprType& src, const Functor &/*func*/) +{ + EIGEN_ONLY_USED_FOR_DEBUG(dst); + EIGEN_ONLY_USED_FOR_DEBUG(src); + eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols()); +} + +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE +void resize_if_allowed(DstXprType &dst, const SrcXprType& src, const internal::assign_op &/*func*/) +{ + Index dstRows = src.rows(); + Index dstCols = src.cols(); + if(((dst.rows()!=dstRows) || (dst.cols()!=dstCols))) + dst.resize(dstRows, dstCols); + eigen_assert(dst.rows() == dstRows && dst.cols() == dstCols); +} + +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void call_dense_assignment_loop(DstXprType& dst, const SrcXprType& src, const Functor &func) +{ + typedef evaluator DstEvaluatorType; + typedef evaluator SrcEvaluatorType; + + SrcEvaluatorType srcEvaluator(src); + + // NOTE To properly handle A = (A*A.transpose())/s with A rectangular, + // we need to resize the destination after the source evaluator has been created. + resize_if_allowed(dst, src, func); + + DstEvaluatorType dstEvaluator(dst); + + typedef generic_dense_assignment_kernel Kernel; + Kernel kernel(dstEvaluator, srcEvaluator, func, dst.const_cast_derived()); + + dense_assignment_loop::run(kernel); +} + +// Specialization for filling the destination with a constant value. +#ifndef EIGEN_GPU_COMPILE_PHASE +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_dense_assignment_loop(DstXprType& dst, const Eigen::CwiseNullaryOp, DstXprType>& src, const internal::assign_op& func) +{ + resize_if_allowed(dst, src, func); + std::fill_n(dst.data(), dst.size(), src.functor()()); +} +#endif + +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_dense_assignment_loop(DstXprType& dst, const SrcXprType& src) +{ + call_dense_assignment_loop(dst, src, internal::assign_op()); +} + +/*************************************************************************** +* Part 6 : Generic assignment +***************************************************************************/ + +// Based on the respective shapes of the destination and source, +// the class AssignmentKind determine the kind of assignment mechanism. +// AssignmentKind must define a Kind typedef. +template struct AssignmentKind; + +// Assignment kind defined in this file: +struct Dense2Dense {}; +struct EigenBase2EigenBase {}; + +template struct AssignmentKind { typedef EigenBase2EigenBase Kind; }; +template<> struct AssignmentKind { typedef Dense2Dense Kind; }; + +// This is the main assignment class +template< typename DstXprType, typename SrcXprType, typename Functor, + typename Kind = typename AssignmentKind< typename evaluator_traits::Shape , typename evaluator_traits::Shape >::Kind, + typename EnableIf = void> +struct Assignment; + + +// The only purpose of this call_assignment() function is to deal with noalias() / "assume-aliasing" and automatic transposition. +// Indeed, I (Gael) think that this concept of "assume-aliasing" was a mistake, and it makes thing quite complicated. +// So this intermediate function removes everything related to "assume-aliasing" such that Assignment +// does not has to bother about these annoying details. + +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE +void call_assignment(Dst& dst, const Src& src) +{ + call_assignment(dst, src, internal::assign_op()); +} +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE +void call_assignment(const Dst& dst, const Src& src) +{ + call_assignment(dst, src, internal::assign_op()); +} + +// Deal with "assume-aliasing" +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR +void call_assignment(Dst& dst, const Src& src, const Func& func, std::enable_if_t< evaluator_assume_aliasing::value, void*> = 0) +{ + typename plain_matrix_type::type tmp(src); + call_assignment_no_alias(dst, tmp, func); +} + +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE +void call_assignment(Dst& dst, const Src& src, const Func& func, std::enable_if_t::value, void*> = 0) +{ + call_assignment_no_alias(dst, src, func); +} + +// by-pass "assume-aliasing" +// When there is no aliasing, we require that 'dst' has been properly resized +template class StorageBase, typename Src, typename Func> +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR +void call_assignment(NoAlias& dst, const Src& src, const Func& func) +{ + call_assignment_no_alias(dst.expression(), src, func); +} + + +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR +void call_assignment_no_alias(Dst& dst, const Src& src, const Func& func) +{ + enum { + NeedToTranspose = ( (int(Dst::RowsAtCompileTime) == 1 && int(Src::ColsAtCompileTime) == 1) + || (int(Dst::ColsAtCompileTime) == 1 && int(Src::RowsAtCompileTime) == 1) + ) && int(Dst::SizeAtCompileTime) != 1 + }; + + typedef std::conditional_t, Dst> ActualDstTypeCleaned; + typedef std::conditional_t, Dst&> ActualDstType; + ActualDstType actualDst(dst); + + // TODO check whether this is the right place to perform these checks: + EIGEN_STATIC_ASSERT_LVALUE(Dst) + EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(ActualDstTypeCleaned,Src) + EIGEN_CHECK_BINARY_COMPATIBILIY(Func,typename ActualDstTypeCleaned::Scalar,typename Src::Scalar); + + Assignment::run(actualDst, src, func); +} + +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE +void call_restricted_packet_assignment_no_alias(Dst& dst, const Src& src, const Func& func) +{ + typedef evaluator DstEvaluatorType; + typedef evaluator SrcEvaluatorType; + typedef restricted_packet_dense_assignment_kernel Kernel; + + EIGEN_STATIC_ASSERT_LVALUE(Dst) + EIGEN_CHECK_BINARY_COMPATIBILIY(Func,typename Dst::Scalar,typename Src::Scalar); + + SrcEvaluatorType srcEvaluator(src); + resize_if_allowed(dst, src, func); + + DstEvaluatorType dstEvaluator(dst); + Kernel kernel(dstEvaluator, srcEvaluator, func, dst.const_cast_derived()); + + dense_assignment_loop::run(kernel); +} + +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR +void call_assignment_no_alias(Dst& dst, const Src& src) +{ + call_assignment_no_alias(dst, src, internal::assign_op()); +} + +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR +void call_assignment_no_alias_no_transpose(Dst& dst, const Src& src, const Func& func) +{ + // TODO check whether this is the right place to perform these checks: + EIGEN_STATIC_ASSERT_LVALUE(Dst) + EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Dst,Src) + EIGEN_CHECK_BINARY_COMPATIBILIY(Func,typename Dst::Scalar,typename Src::Scalar); + + Assignment::run(dst, src, func); +} +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR +void call_assignment_no_alias_no_transpose(Dst& dst, const Src& src) +{ + call_assignment_no_alias_no_transpose(dst, src, internal::assign_op()); +} + +// forward declaration +template EIGEN_DEVICE_FUNC void check_for_aliasing(const Dst &dst, const Src &src); + +// Generic Dense to Dense assignment +// Note that the last template argument "Weak" is needed to make it possible to perform +// both partial specialization+SFINAE without ambiguous specialization +template< typename DstXprType, typename SrcXprType, typename Functor, typename Weak> +struct Assignment +{ + EIGEN_DEVICE_FUNC + static EIGEN_STRONG_INLINE void run(DstXprType &dst, const SrcXprType &src, const Functor &func) + { +#ifndef EIGEN_NO_DEBUG + internal::check_for_aliasing(dst, src); +#endif + + call_dense_assignment_loop(dst, src, func); + } +}; + +// Generic assignment through evalTo. +// TODO: not sure we have to keep that one, but it helps porting current code to new evaluator mechanism. +// Note that the last template argument "Weak" is needed to make it possible to perform +// both partial specialization+SFINAE without ambiguous specialization +template< typename DstXprType, typename SrcXprType, typename Functor, typename Weak> +struct Assignment +{ + EIGEN_DEVICE_FUNC + static EIGEN_STRONG_INLINE void run(DstXprType &dst, const SrcXprType &src, const internal::assign_op &/*func*/) + { + Index dstRows = src.rows(); + Index dstCols = src.cols(); + if((dst.rows()!=dstRows) || (dst.cols()!=dstCols)) + dst.resize(dstRows, dstCols); + + eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols()); + src.evalTo(dst); + } + + // NOTE The following two functions are templated to avoid their instantiation if not needed + // This is needed because some expressions supports evalTo only and/or have 'void' as scalar type. + template + EIGEN_DEVICE_FUNC + static EIGEN_STRONG_INLINE void run(DstXprType &dst, const SrcXprType &src, const internal::add_assign_op &/*func*/) + { + Index dstRows = src.rows(); + Index dstCols = src.cols(); + if((dst.rows()!=dstRows) || (dst.cols()!=dstCols)) + dst.resize(dstRows, dstCols); + + eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols()); + src.addTo(dst); + } + + template + EIGEN_DEVICE_FUNC + static EIGEN_STRONG_INLINE void run(DstXprType &dst, const SrcXprType &src, const internal::sub_assign_op &/*func*/) + { + Index dstRows = src.rows(); + Index dstCols = src.cols(); + if((dst.rows()!=dstRows) || (dst.cols()!=dstCols)) + dst.resize(dstRows, dstCols); + + eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols()); + src.subTo(dst); + } +}; + +} // namespace internal + +} // end namespace Eigen + +#endif // EIGEN_ASSIGN_EVALUATOR_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Assign_MKL.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Assign_MKL.h new file mode 100644 index 0000000000000000000000000000000000000000..f9b86c8eb7fc09dd10a7caa676d177570b4c84d2 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Assign_MKL.h @@ -0,0 +1,180 @@ +/* + Copyright (c) 2011, Intel Corporation. All rights reserved. + Copyright (C) 2015 Gael Guennebaud + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ******************************************************************************** + * Content : Eigen bindings to Intel(R) MKL + * MKL VML support for coefficient-wise unary Eigen expressions like a=b.sin() + ******************************************************************************** +*/ + +#ifndef EIGEN_ASSIGN_VML_H +#define EIGEN_ASSIGN_VML_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { + +template +class vml_assign_traits +{ + private: + enum { + DstHasDirectAccess = Dst::Flags & DirectAccessBit, + SrcHasDirectAccess = Src::Flags & DirectAccessBit, + StorageOrdersAgree = (int(Dst::IsRowMajor) == int(Src::IsRowMajor)), + InnerSize = int(Dst::IsVectorAtCompileTime) ? int(Dst::SizeAtCompileTime) + : int(Dst::Flags)&RowMajorBit ? int(Dst::ColsAtCompileTime) + : int(Dst::RowsAtCompileTime), + InnerMaxSize = int(Dst::IsVectorAtCompileTime) ? int(Dst::MaxSizeAtCompileTime) + : int(Dst::Flags)&RowMajorBit ? int(Dst::MaxColsAtCompileTime) + : int(Dst::MaxRowsAtCompileTime), + MaxSizeAtCompileTime = Dst::SizeAtCompileTime, + + MightEnableVml = StorageOrdersAgree && DstHasDirectAccess && SrcHasDirectAccess && Src::InnerStrideAtCompileTime==1 && Dst::InnerStrideAtCompileTime==1, + MightLinearize = MightEnableVml && (int(Dst::Flags) & int(Src::Flags) & LinearAccessBit), + VmlSize = MightLinearize ? MaxSizeAtCompileTime : InnerMaxSize, + LargeEnough = VmlSize==Dynamic || VmlSize>=EIGEN_MKL_VML_THRESHOLD + }; + public: + enum { + EnableVml = MightEnableVml && LargeEnough, + Traversal = MightLinearize ? LinearTraversal : DefaultTraversal + }; +}; + +#define EIGEN_PP_EXPAND(ARG) ARG +#if !defined (EIGEN_FAST_MATH) || (EIGEN_FAST_MATH != 1) +#define EIGEN_VMLMODE_EXPAND_xLA , VML_HA +#else +#define EIGEN_VMLMODE_EXPAND_xLA , VML_LA +#endif + +#define EIGEN_VMLMODE_EXPAND_x_ + +#define EIGEN_VMLMODE_PREFIX_xLA vm +#define EIGEN_VMLMODE_PREFIX_x_ v +#define EIGEN_VMLMODE_PREFIX(VMLMODE) EIGEN_CAT(EIGEN_VMLMODE_PREFIX_x,VMLMODE) + +#define EIGEN_MKL_VML_DECLARE_UNARY_CALL(EIGENOP, VMLOP, EIGENTYPE, VMLTYPE, VMLMODE) \ + template< typename DstXprType, typename SrcXprNested> \ + struct Assignment, SrcXprNested>, assign_op, \ + Dense2Dense, std::enable_if_t::EnableVml>> { \ + typedef CwiseUnaryOp, SrcXprNested> SrcXprType; \ + static void run(DstXprType &dst, const SrcXprType &src, const assign_op &func) { \ + resize_if_allowed(dst, src, func); \ + eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols()); \ + if(vml_assign_traits::Traversal==LinearTraversal) { \ + VMLOP(dst.size(), (const VMLTYPE*)src.nestedExpression().data(), \ + (VMLTYPE*)dst.data() EIGEN_PP_EXPAND(EIGEN_VMLMODE_EXPAND_x##VMLMODE) ); \ + } else { \ + const Index outerSize = dst.outerSize(); \ + for(Index outer = 0; outer < outerSize; ++outer) { \ + const EIGENTYPE *src_ptr = src.IsRowMajor ? &(src.nestedExpression().coeffRef(outer,0)) : \ + &(src.nestedExpression().coeffRef(0, outer)); \ + EIGENTYPE *dst_ptr = dst.IsRowMajor ? &(dst.coeffRef(outer,0)) : &(dst.coeffRef(0, outer)); \ + VMLOP( dst.innerSize(), (const VMLTYPE*)src_ptr, \ + (VMLTYPE*)dst_ptr EIGEN_PP_EXPAND(EIGEN_VMLMODE_EXPAND_x##VMLMODE)); \ + } \ + } \ + } \ + }; \ + + +#define EIGEN_MKL_VML_DECLARE_UNARY_CALLS_REAL(EIGENOP, VMLOP, VMLMODE) \ + EIGEN_MKL_VML_DECLARE_UNARY_CALL(EIGENOP, EIGEN_CAT(EIGEN_VMLMODE_PREFIX(VMLMODE),s##VMLOP), float, float, VMLMODE) \ + EIGEN_MKL_VML_DECLARE_UNARY_CALL(EIGENOP, EIGEN_CAT(EIGEN_VMLMODE_PREFIX(VMLMODE),d##VMLOP), double, double, VMLMODE) + +#define EIGEN_MKL_VML_DECLARE_UNARY_CALLS_CPLX(EIGENOP, VMLOP, VMLMODE) \ + EIGEN_MKL_VML_DECLARE_UNARY_CALL(EIGENOP, EIGEN_CAT(EIGEN_VMLMODE_PREFIX(VMLMODE),c##VMLOP), scomplex, MKL_Complex8, VMLMODE) \ + EIGEN_MKL_VML_DECLARE_UNARY_CALL(EIGENOP, EIGEN_CAT(EIGEN_VMLMODE_PREFIX(VMLMODE),z##VMLOP), dcomplex, MKL_Complex16, VMLMODE) + +#define EIGEN_MKL_VML_DECLARE_UNARY_CALLS(EIGENOP, VMLOP, VMLMODE) \ + EIGEN_MKL_VML_DECLARE_UNARY_CALLS_REAL(EIGENOP, VMLOP, VMLMODE) \ + EIGEN_MKL_VML_DECLARE_UNARY_CALLS_CPLX(EIGENOP, VMLOP, VMLMODE) + + +EIGEN_MKL_VML_DECLARE_UNARY_CALLS(sin, Sin, LA) +EIGEN_MKL_VML_DECLARE_UNARY_CALLS(asin, Asin, LA) +EIGEN_MKL_VML_DECLARE_UNARY_CALLS(sinh, Sinh, LA) +EIGEN_MKL_VML_DECLARE_UNARY_CALLS(cos, Cos, LA) +EIGEN_MKL_VML_DECLARE_UNARY_CALLS(acos, Acos, LA) +EIGEN_MKL_VML_DECLARE_UNARY_CALLS(cosh, Cosh, LA) +EIGEN_MKL_VML_DECLARE_UNARY_CALLS(tan, Tan, LA) +EIGEN_MKL_VML_DECLARE_UNARY_CALLS(atan, Atan, LA) +EIGEN_MKL_VML_DECLARE_UNARY_CALLS(tanh, Tanh, LA) +// EIGEN_MKL_VML_DECLARE_UNARY_CALLS(abs, Abs, _) +EIGEN_MKL_VML_DECLARE_UNARY_CALLS(exp, Exp, LA) +EIGEN_MKL_VML_DECLARE_UNARY_CALLS(log, Ln, LA) +EIGEN_MKL_VML_DECLARE_UNARY_CALLS(log10, Log10, LA) +EIGEN_MKL_VML_DECLARE_UNARY_CALLS(sqrt, Sqrt, _) + +EIGEN_MKL_VML_DECLARE_UNARY_CALLS_REAL(square, Sqr, _) +EIGEN_MKL_VML_DECLARE_UNARY_CALLS_CPLX(arg, Arg, _) +EIGEN_MKL_VML_DECLARE_UNARY_CALLS_REAL(round, Round, _) +EIGEN_MKL_VML_DECLARE_UNARY_CALLS_REAL(floor, Floor, _) +EIGEN_MKL_VML_DECLARE_UNARY_CALLS_REAL(ceil, Ceil, _) + +#define EIGEN_MKL_VML_DECLARE_POW_CALL(EIGENOP, VMLOP, EIGENTYPE, VMLTYPE, VMLMODE) \ + template< typename DstXprType, typename SrcXprNested, typename Plain> \ + struct Assignment, SrcXprNested, \ + const CwiseNullaryOp,Plain> >, assign_op, \ + Dense2Dense, std::enable_if_t::EnableVml>> { \ + typedef CwiseBinaryOp, SrcXprNested, \ + const CwiseNullaryOp,Plain> > SrcXprType; \ + static void run(DstXprType &dst, const SrcXprType &src, const assign_op &func) { \ + resize_if_allowed(dst, src, func); \ + eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols()); \ + VMLTYPE exponent = reinterpret_cast(src.rhs().functor().m_other); \ + if(vml_assign_traits::Traversal==LinearTraversal) \ + { \ + VMLOP( dst.size(), (const VMLTYPE*)src.lhs().data(), exponent, \ + (VMLTYPE*)dst.data() EIGEN_PP_EXPAND(EIGEN_VMLMODE_EXPAND_x##VMLMODE) ); \ + } else { \ + const Index outerSize = dst.outerSize(); \ + for(Index outer = 0; outer < outerSize; ++outer) { \ + const EIGENTYPE *src_ptr = src.IsRowMajor ? &(src.lhs().coeffRef(outer,0)) : \ + &(src.lhs().coeffRef(0, outer)); \ + EIGENTYPE *dst_ptr = dst.IsRowMajor ? &(dst.coeffRef(outer,0)) : &(dst.coeffRef(0, outer)); \ + VMLOP( dst.innerSize(), (const VMLTYPE*)src_ptr, exponent, \ + (VMLTYPE*)dst_ptr EIGEN_PP_EXPAND(EIGEN_VMLMODE_EXPAND_x##VMLMODE)); \ + } \ + } \ + } \ + }; + +EIGEN_MKL_VML_DECLARE_POW_CALL(pow, vmsPowx, float, float, LA) +EIGEN_MKL_VML_DECLARE_POW_CALL(pow, vmdPowx, double, double, LA) +EIGEN_MKL_VML_DECLARE_POW_CALL(pow, vmcPowx, scomplex, MKL_Complex8, LA) +EIGEN_MKL_VML_DECLARE_POW_CALL(pow, vmzPowx, dcomplex, MKL_Complex16, LA) + +} // end namespace internal + +} // end namespace Eigen + +#endif // EIGEN_ASSIGN_VML_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/BandMatrix.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/BandMatrix.h new file mode 100644 index 0000000000000000000000000000000000000000..dcb0d13861c4442d9a07d17eb86768789a250e0b --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/BandMatrix.h @@ -0,0 +1,355 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2009 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_BANDMATRIX_H +#define EIGEN_BANDMATRIX_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { + +template +class BandMatrixBase : public EigenBase +{ + public: + + enum { + Flags = internal::traits::Flags, + CoeffReadCost = internal::traits::CoeffReadCost, + RowsAtCompileTime = internal::traits::RowsAtCompileTime, + ColsAtCompileTime = internal::traits::ColsAtCompileTime, + MaxRowsAtCompileTime = internal::traits::MaxRowsAtCompileTime, + MaxColsAtCompileTime = internal::traits::MaxColsAtCompileTime, + Supers = internal::traits::Supers, + Subs = internal::traits::Subs, + Options = internal::traits::Options + }; + typedef typename internal::traits::Scalar Scalar; + typedef Matrix DenseMatrixType; + typedef typename DenseMatrixType::StorageIndex StorageIndex; + typedef typename internal::traits::CoefficientsType CoefficientsType; + typedef EigenBase Base; + + protected: + enum { + DataRowsAtCompileTime = ((Supers!=Dynamic) && (Subs!=Dynamic)) + ? 1 + Supers + Subs + : Dynamic, + SizeAtCompileTime = min_size_prefer_dynamic(RowsAtCompileTime,ColsAtCompileTime) + }; + + public: + + using Base::derived; + using Base::rows; + using Base::cols; + + /** \returns the number of super diagonals */ + inline Index supers() const { return derived().supers(); } + + /** \returns the number of sub diagonals */ + inline Index subs() const { return derived().subs(); } + + /** \returns an expression of the underlying coefficient matrix */ + inline const CoefficientsType& coeffs() const { return derived().coeffs(); } + + /** \returns an expression of the underlying coefficient matrix */ + inline CoefficientsType& coeffs() { return derived().coeffs(); } + + /** \returns a vector expression of the \a i -th column, + * only the meaningful part is returned. + * \warning the internal storage must be column major. */ + inline Block col(Index i) + { + EIGEN_STATIC_ASSERT((int(Options) & int(RowMajor)) == 0, THIS_METHOD_IS_ONLY_FOR_COLUMN_MAJOR_MATRICES); + Index start = 0; + Index len = coeffs().rows(); + if (i<=supers()) + { + start = supers()-i; + len = (std::min)(rows(),std::max(0,coeffs().rows() - (supers()-i))); + } + else if (i>=rows()-subs()) + len = std::max(0,coeffs().rows() - (i + 1 - rows() + subs())); + return Block(coeffs(), start, i, len, 1); + } + + /** \returns a vector expression of the main diagonal */ + inline Block diagonal() + { return Block(coeffs(),supers(),0,1,(std::min)(rows(),cols())); } + + /** \returns a vector expression of the main diagonal (const version) */ + inline const Block diagonal() const + { return Block(coeffs(),supers(),0,1,(std::min)(rows(),cols())); } + + template struct DiagonalIntReturnType { + enum { + ReturnOpposite = (int(Options) & int(SelfAdjoint)) && (((Index) > 0 && Supers == 0) || ((Index) < 0 && Subs == 0)), + Conjugate = ReturnOpposite && NumTraits::IsComplex, + ActualIndex = ReturnOpposite ? -Index : Index, + DiagonalSize = (RowsAtCompileTime==Dynamic || ColsAtCompileTime==Dynamic) + ? Dynamic + : (ActualIndex<0 + ? min_size_prefer_dynamic(ColsAtCompileTime, RowsAtCompileTime + ActualIndex) + : min_size_prefer_dynamic(RowsAtCompileTime, ColsAtCompileTime - ActualIndex)) + }; + typedef Block BuildType; + typedef std::conditional_t,BuildType >, + BuildType> Type; + }; + + /** \returns a vector expression of the \a N -th sub or super diagonal */ + template inline typename DiagonalIntReturnType::Type diagonal() + { + return typename DiagonalIntReturnType::BuildType(coeffs(), supers()-N, (std::max)(0,N), 1, diagonalLength(N)); + } + + /** \returns a vector expression of the \a N -th sub or super diagonal */ + template inline const typename DiagonalIntReturnType::Type diagonal() const + { + return typename DiagonalIntReturnType::BuildType(coeffs(), supers()-N, (std::max)(0,N), 1, diagonalLength(N)); + } + + /** \returns a vector expression of the \a i -th sub or super diagonal */ + inline Block diagonal(Index i) + { + eigen_assert((i<0 && -i<=subs()) || (i>=0 && i<=supers())); + return Block(coeffs(), supers()-i, std::max(0,i), 1, diagonalLength(i)); + } + + /** \returns a vector expression of the \a i -th sub or super diagonal */ + inline const Block diagonal(Index i) const + { + eigen_assert((i<0 && -i<=subs()) || (i>=0 && i<=supers())); + return Block(coeffs(), supers()-i, std::max(0,i), 1, diagonalLength(i)); + } + + template inline void evalTo(Dest& dst) const + { + dst.resize(rows(),cols()); + dst.setZero(); + dst.diagonal() = diagonal(); + for (Index i=1; i<=supers();++i) + dst.diagonal(i) = diagonal(i); + for (Index i=1; i<=subs();++i) + dst.diagonal(-i) = diagonal(-i); + } + + DenseMatrixType toDenseMatrix() const + { + DenseMatrixType res(rows(),cols()); + evalTo(res); + return res; + } + + protected: + + inline Index diagonalLength(Index i) const + { return i<0 ? (std::min)(cols(),rows()+i) : (std::min)(rows(),cols()-i); } +}; + +/** + * \class BandMatrix + * \ingroup Core_Module + * + * \brief Represents a rectangular matrix with a banded storage + * + * \tparam Scalar_ Numeric type, i.e. float, double, int + * \tparam Rows_ Number of rows, or \b Dynamic + * \tparam Cols_ Number of columns, or \b Dynamic + * \tparam Supers_ Number of super diagonal + * \tparam Subs_ Number of sub diagonal + * \tparam Options_ A combination of either \b #RowMajor or \b #ColMajor, and of \b #SelfAdjoint + * The former controls \ref TopicStorageOrders "storage order", and defaults to + * column-major. The latter controls whether the matrix represents a selfadjoint + * matrix in which case either Supers of Subs have to be null. + * + * \sa class TridiagonalMatrix + */ + +template +struct traits > +{ + typedef Scalar_ Scalar; + typedef Dense StorageKind; + typedef Eigen::Index StorageIndex; + enum { + CoeffReadCost = NumTraits::ReadCost, + RowsAtCompileTime = Rows_, + ColsAtCompileTime = Cols_, + MaxRowsAtCompileTime = Rows_, + MaxColsAtCompileTime = Cols_, + Flags = LvalueBit, + Supers = Supers_, + Subs = Subs_, + Options = Options_, + DataRowsAtCompileTime = ((Supers!=Dynamic) && (Subs!=Dynamic)) ? 1 + Supers + Subs : Dynamic + }; + typedef Matrix CoefficientsType; +}; + +template +class BandMatrix : public BandMatrixBase > +{ + public: + + typedef typename internal::traits::Scalar Scalar; + typedef typename internal::traits::StorageIndex StorageIndex; + typedef typename internal::traits::CoefficientsType CoefficientsType; + + explicit inline BandMatrix(Index rows=Rows, Index cols=Cols, Index supers=Supers, Index subs=Subs) + : m_coeffs(1+supers+subs,cols), + m_rows(rows), m_supers(supers), m_subs(subs) + { + } + + /** \returns the number of columns */ + inline EIGEN_CONSTEXPR Index rows() const { return m_rows.value(); } + + /** \returns the number of rows */ + inline EIGEN_CONSTEXPR Index cols() const { return m_coeffs.cols(); } + + /** \returns the number of super diagonals */ + inline EIGEN_CONSTEXPR Index supers() const { return m_supers.value(); } + + /** \returns the number of sub diagonals */ + inline EIGEN_CONSTEXPR Index subs() const { return m_subs.value(); } + + inline const CoefficientsType& coeffs() const { return m_coeffs; } + inline CoefficientsType& coeffs() { return m_coeffs; } + + protected: + + CoefficientsType m_coeffs; + internal::variable_if_dynamic m_rows; + internal::variable_if_dynamic m_supers; + internal::variable_if_dynamic m_subs; +}; + +template +class BandMatrixWrapper; + +template +struct traits > +{ + typedef typename CoefficientsType_::Scalar Scalar; + typedef typename CoefficientsType_::StorageKind StorageKind; + typedef typename CoefficientsType_::StorageIndex StorageIndex; + enum { + CoeffReadCost = internal::traits::CoeffReadCost, + RowsAtCompileTime = Rows_, + ColsAtCompileTime = Cols_, + MaxRowsAtCompileTime = Rows_, + MaxColsAtCompileTime = Cols_, + Flags = LvalueBit, + Supers = Supers_, + Subs = Subs_, + Options = Options_, + DataRowsAtCompileTime = ((Supers!=Dynamic) && (Subs!=Dynamic)) ? 1 + Supers + Subs : Dynamic + }; + typedef CoefficientsType_ CoefficientsType; +}; + +template +class BandMatrixWrapper : public BandMatrixBase > +{ + public: + + typedef typename internal::traits::Scalar Scalar; + typedef typename internal::traits::CoefficientsType CoefficientsType; + typedef typename internal::traits::StorageIndex StorageIndex; + + explicit inline BandMatrixWrapper(const CoefficientsType& coeffs, Index rows=Rows_, Index cols=Cols_, Index supers=Supers_, Index subs=Subs_) + : m_coeffs(coeffs), + m_rows(rows), m_supers(supers), m_subs(subs) + { + EIGEN_UNUSED_VARIABLE(cols); + // eigen_assert(coeffs.cols()==cols() && (supers()+subs()+1)==coeffs.rows()); + } + + /** \returns the number of columns */ + inline EIGEN_CONSTEXPR Index rows() const { return m_rows.value(); } + + /** \returns the number of rows */ + inline EIGEN_CONSTEXPR Index cols() const { return m_coeffs.cols(); } + + /** \returns the number of super diagonals */ + inline EIGEN_CONSTEXPR Index supers() const { return m_supers.value(); } + + /** \returns the number of sub diagonals */ + inline EIGEN_CONSTEXPR Index subs() const { return m_subs.value(); } + + inline const CoefficientsType& coeffs() const { return m_coeffs; } + + protected: + + const CoefficientsType& m_coeffs; + internal::variable_if_dynamic m_rows; + internal::variable_if_dynamic m_supers; + internal::variable_if_dynamic m_subs; +}; + +/** + * \class TridiagonalMatrix + * \ingroup Core_Module + * + * \brief Represents a tridiagonal matrix with a compact banded storage + * + * \tparam Scalar Numeric type, i.e. float, double, int + * \tparam Size Number of rows and cols, or \b Dynamic + * \tparam Options Can be 0 or \b SelfAdjoint + * + * \sa class BandMatrix + */ +template +class TridiagonalMatrix : public BandMatrix +{ + typedef BandMatrix Base; + typedef typename Base::StorageIndex StorageIndex; + public: + explicit TridiagonalMatrix(Index size = Size) : Base(size,size,Options&SelfAdjoint?0:1,1) {} + + inline typename Base::template DiagonalIntReturnType<1>::Type super() + { return Base::template diagonal<1>(); } + inline const typename Base::template DiagonalIntReturnType<1>::Type super() const + { return Base::template diagonal<1>(); } + inline typename Base::template DiagonalIntReturnType<-1>::Type sub() + { return Base::template diagonal<-1>(); } + inline const typename Base::template DiagonalIntReturnType<-1>::Type sub() const + { return Base::template diagonal<-1>(); } + protected: +}; + + +struct BandShape {}; + +template +struct evaluator_traits > + : public evaluator_traits_base > +{ + typedef BandShape Shape; +}; + +template +struct evaluator_traits > + : public evaluator_traits_base > +{ + typedef BandShape Shape; +}; + +template<> struct AssignmentKind { typedef EigenBase2EigenBase Kind; }; + +} // end namespace internal + +} // end namespace Eigen + +#endif // EIGEN_BANDMATRIX_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Block.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Block.h new file mode 100644 index 0000000000000000000000000000000000000000..dad2af802afe600dbfba377adf1851bfe433aeff --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Block.h @@ -0,0 +1,465 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008 Gael Guennebaud +// Copyright (C) 2006-2010 Benoit Jacob +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_BLOCK_H +#define EIGEN_BLOCK_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { +template +struct traits > : traits +{ + typedef typename traits::Scalar Scalar; + typedef typename traits::StorageKind StorageKind; + typedef typename traits::XprKind XprKind; + typedef typename ref_selector::type XprTypeNested; + typedef std::remove_reference_t XprTypeNested_; + enum{ + MatrixRows = traits::RowsAtCompileTime, + MatrixCols = traits::ColsAtCompileTime, + RowsAtCompileTime = MatrixRows == 0 ? 0 : BlockRows, + ColsAtCompileTime = MatrixCols == 0 ? 0 : BlockCols, + MaxRowsAtCompileTime = BlockRows==0 ? 0 + : RowsAtCompileTime != Dynamic ? int(RowsAtCompileTime) + : int(traits::MaxRowsAtCompileTime), + MaxColsAtCompileTime = BlockCols==0 ? 0 + : ColsAtCompileTime != Dynamic ? int(ColsAtCompileTime) + : int(traits::MaxColsAtCompileTime), + + XprTypeIsRowMajor = (int(traits::Flags)&RowMajorBit) != 0, + IsRowMajor = (MaxRowsAtCompileTime==1&&MaxColsAtCompileTime!=1) ? 1 + : (MaxColsAtCompileTime==1&&MaxRowsAtCompileTime!=1) ? 0 + : XprTypeIsRowMajor, + HasSameStorageOrderAsXprType = (IsRowMajor == XprTypeIsRowMajor), + InnerSize = IsRowMajor ? int(ColsAtCompileTime) : int(RowsAtCompileTime), + InnerStrideAtCompileTime = HasSameStorageOrderAsXprType + ? int(inner_stride_at_compile_time::ret) + : int(outer_stride_at_compile_time::ret), + OuterStrideAtCompileTime = HasSameStorageOrderAsXprType + ? int(outer_stride_at_compile_time::ret) + : int(inner_stride_at_compile_time::ret), + + // FIXME, this traits is rather specialized for dense object and it needs to be cleaned further + FlagsLvalueBit = is_lvalue::value ? LvalueBit : 0, + FlagsRowMajorBit = IsRowMajor ? RowMajorBit : 0, + Flags = (traits::Flags & (DirectAccessBit | (InnerPanel?CompressedAccessBit:0))) | FlagsLvalueBit | FlagsRowMajorBit, + // FIXME DirectAccessBit should not be handled by expressions + // + // Alignment is needed by MapBase's assertions + // We can sefely set it to false here. Internal alignment errors will be detected by an eigen_internal_assert in the respective evaluator + Alignment = 0 + }; +}; + +template::ret> class BlockImpl_dense; + +} // end namespace internal + +template class BlockImpl; + +/** \class Block + * \ingroup Core_Module + * + * \brief Expression of a fixed-size or dynamic-size block + * + * \tparam XprType the type of the expression in which we are taking a block + * \tparam BlockRows the number of rows of the block we are taking at compile time (optional) + * \tparam BlockCols the number of columns of the block we are taking at compile time (optional) + * \tparam InnerPanel is true, if the block maps to a set of rows of a row major matrix or + * to set of columns of a column major matrix (optional). The parameter allows to determine + * at compile time whether aligned access is possible on the block expression. + * + * This class represents an expression of either a fixed-size or dynamic-size block. It is the return + * type of DenseBase::block(Index,Index,Index,Index) and DenseBase::block(Index,Index) and + * most of the time this is the only way it is used. + * + * However, if you want to directly maniputate block expressions, + * for instance if you want to write a function returning such an expression, you + * will need to use this class. + * + * Here is an example illustrating the dynamic case: + * \include class_Block.cpp + * Output: \verbinclude class_Block.out + * + * \note Even though this expression has dynamic size, in the case where \a XprType + * has fixed size, this expression inherits a fixed maximal size which means that evaluating + * it does not cause a dynamic memory allocation. + * + * Here is an example illustrating the fixed-size case: + * \include class_FixedBlock.cpp + * Output: \verbinclude class_FixedBlock.out + * + * \sa DenseBase::block(Index,Index,Index,Index), DenseBase::block(Index,Index), class VectorBlock + */ +template class Block + : public BlockImpl::StorageKind> +{ + typedef BlockImpl::StorageKind> Impl; + public: + //typedef typename Impl::Base Base; + typedef Impl Base; + EIGEN_GENERIC_PUBLIC_INTERFACE(Block) + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Block) + + typedef internal::remove_all_t NestedExpression; + + /** Column or Row constructor + */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Block(XprType& xpr, Index i) : Impl(xpr,i) + { + eigen_assert( (i>=0) && ( + ((BlockRows==1) && (BlockCols==XprType::ColsAtCompileTime) && i= 0 && BlockRows >= 0 && startRow + BlockRows <= xpr.rows() + && startCol >= 0 && BlockCols >= 0 && startCol + BlockCols <= xpr.cols()); + } + + /** Dynamic-size constructor + */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Block(XprType& xpr, + Index startRow, Index startCol, + Index blockRows, Index blockCols) + : Impl(xpr, startRow, startCol, blockRows, blockCols) + { + eigen_assert((RowsAtCompileTime==Dynamic || RowsAtCompileTime==blockRows) + && (ColsAtCompileTime==Dynamic || ColsAtCompileTime==blockCols)); + eigen_assert(startRow >= 0 && blockRows >= 0 && startRow <= xpr.rows() - blockRows + && startCol >= 0 && blockCols >= 0 && startCol <= xpr.cols() - blockCols); + } +}; + +// The generic default implementation for dense block simplu forward to the internal::BlockImpl_dense +// that must be specialized for direct and non-direct access... +template +class BlockImpl + : public internal::BlockImpl_dense +{ + typedef internal::BlockImpl_dense Impl; + typedef typename XprType::StorageIndex StorageIndex; + public: + typedef Impl Base; + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(BlockImpl) + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE BlockImpl(XprType& xpr, Index i) : Impl(xpr,i) {} + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE BlockImpl(XprType& xpr, Index startRow, Index startCol) : Impl(xpr, startRow, startCol) {} + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE BlockImpl(XprType& xpr, Index startRow, Index startCol, Index blockRows, Index blockCols) + : Impl(xpr, startRow, startCol, blockRows, blockCols) {} +}; + +namespace internal { + +/** \internal Internal implementation of dense Blocks in the general case. */ +template class BlockImpl_dense + : public internal::dense_xpr_base >::type +{ + typedef Block BlockType; + typedef typename internal::ref_selector::non_const_type XprTypeNested; + public: + + typedef typename internal::dense_xpr_base::type Base; + EIGEN_DENSE_PUBLIC_INTERFACE(BlockType) + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(BlockImpl_dense) + + // class InnerIterator; // FIXME apparently never used + + /** Column or Row constructor + */ + EIGEN_DEVICE_FUNC + inline BlockImpl_dense(XprType& xpr, Index i) + : m_xpr(xpr), + // It is a row if and only if BlockRows==1 and BlockCols==XprType::ColsAtCompileTime, + // and it is a column if and only if BlockRows==XprType::RowsAtCompileTime and BlockCols==1, + // all other cases are invalid. + // The case a 1x1 matrix seems ambiguous, but the result is the same anyway. + m_startRow( (BlockRows==1) && (BlockCols==XprType::ColsAtCompileTime) ? i : 0), + m_startCol( (BlockRows==XprType::RowsAtCompileTime) && (BlockCols==1) ? i : 0), + m_blockRows(BlockRows==1 ? 1 : xpr.rows()), + m_blockCols(BlockCols==1 ? 1 : xpr.cols()) + {} + + /** Fixed-size constructor + */ + EIGEN_DEVICE_FUNC + inline BlockImpl_dense(XprType& xpr, Index startRow, Index startCol) + : m_xpr(xpr), m_startRow(startRow), m_startCol(startCol), + m_blockRows(BlockRows), m_blockCols(BlockCols) + {} + + /** Dynamic-size constructor + */ + EIGEN_DEVICE_FUNC + inline BlockImpl_dense(XprType& xpr, + Index startRow, Index startCol, + Index blockRows, Index blockCols) + : m_xpr(xpr), m_startRow(startRow), m_startCol(startCol), + m_blockRows(blockRows), m_blockCols(blockCols) + {} + + EIGEN_DEVICE_FUNC inline Index rows() const { return m_blockRows.value(); } + EIGEN_DEVICE_FUNC inline Index cols() const { return m_blockCols.value(); } + + EIGEN_DEVICE_FUNC + inline Scalar& coeffRef(Index rowId, Index colId) + { + EIGEN_STATIC_ASSERT_LVALUE(XprType) + return m_xpr.coeffRef(rowId + m_startRow.value(), colId + m_startCol.value()); + } + + EIGEN_DEVICE_FUNC + inline const Scalar& coeffRef(Index rowId, Index colId) const + { + return m_xpr.derived().coeffRef(rowId + m_startRow.value(), colId + m_startCol.value()); + } + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE const CoeffReturnType coeff(Index rowId, Index colId) const + { + return m_xpr.coeff(rowId + m_startRow.value(), colId + m_startCol.value()); + } + + EIGEN_DEVICE_FUNC + inline Scalar& coeffRef(Index index) + { + EIGEN_STATIC_ASSERT_LVALUE(XprType) + return m_xpr.coeffRef(m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index), + m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0)); + } + + EIGEN_DEVICE_FUNC + inline const Scalar& coeffRef(Index index) const + { + return m_xpr.coeffRef(m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index), + m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0)); + } + + EIGEN_DEVICE_FUNC + inline const CoeffReturnType coeff(Index index) const + { + return m_xpr.coeff(m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index), + m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0)); + } + + template + EIGEN_DEVICE_FUNC inline PacketScalar packet(Index rowId, Index colId) const + { + return m_xpr.template packet(rowId + m_startRow.value(), colId + m_startCol.value()); + } + + template + EIGEN_DEVICE_FUNC inline void writePacket(Index rowId, Index colId, const PacketScalar& val) + { + m_xpr.template writePacket(rowId + m_startRow.value(), colId + m_startCol.value(), val); + } + + template + EIGEN_DEVICE_FUNC inline PacketScalar packet(Index index) const + { + return m_xpr.template packet + (m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index), + m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0)); + } + + template + EIGEN_DEVICE_FUNC inline void writePacket(Index index, const PacketScalar& val) + { + m_xpr.template writePacket + (m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index), + m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0), val); + } + + #ifdef EIGEN_PARSED_BY_DOXYGEN + /** \sa MapBase::data() */ + EIGEN_DEVICE_FUNC inline const Scalar* data() const; + EIGEN_DEVICE_FUNC inline Index innerStride() const; + EIGEN_DEVICE_FUNC inline Index outerStride() const; + #endif + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + const internal::remove_all_t& nestedExpression() const + { + return m_xpr; + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + XprType& nestedExpression() { return m_xpr; } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR + StorageIndex startRow() const EIGEN_NOEXCEPT + { + return m_startRow.value(); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR + StorageIndex startCol() const EIGEN_NOEXCEPT + { + return m_startCol.value(); + } + + protected: + + XprTypeNested m_xpr; + const internal::variable_if_dynamic m_startRow; + const internal::variable_if_dynamic m_startCol; + const internal::variable_if_dynamic m_blockRows; + const internal::variable_if_dynamic m_blockCols; +}; + +/** \internal Internal implementation of dense Blocks in the direct access case.*/ +template +class BlockImpl_dense + : public MapBase > +{ + typedef Block BlockType; + typedef typename internal::ref_selector::non_const_type XprTypeNested; + enum { + XprTypeIsRowMajor = (int(traits::Flags)&RowMajorBit) != 0 + }; + + /** \internal Returns base+offset (unless base is null, in which case returns null). + * Adding an offset to nullptr is undefined behavior, so we must avoid it. + */ + template + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE + static Scalar* add_to_nullable_pointer(Scalar* base, Index offset) + { + return base != nullptr ? base+offset : nullptr; + } + + public: + + typedef MapBase Base; + EIGEN_DENSE_PUBLIC_INTERFACE(BlockType) + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(BlockImpl_dense) + + /** Column or Row constructor + */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + BlockImpl_dense(XprType& xpr, Index i) + : Base((BlockRows == 0 || BlockCols == 0) ? nullptr : add_to_nullable_pointer(xpr.data(), + i * ( ((BlockRows==1) && (BlockCols==XprType::ColsAtCompileTime) && (!XprTypeIsRowMajor)) + || ((BlockRows==XprType::RowsAtCompileTime) && (BlockCols==1) && ( XprTypeIsRowMajor)) ? xpr.innerStride() : xpr.outerStride())), + BlockRows==1 ? 1 : xpr.rows(), + BlockCols==1 ? 1 : xpr.cols()), + m_xpr(xpr), + m_startRow( (BlockRows==1) && (BlockCols==XprType::ColsAtCompileTime) ? i : 0), + m_startCol( (BlockRows==XprType::RowsAtCompileTime) && (BlockCols==1) ? i : 0) + { + init(); + } + + /** Fixed-size constructor + */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + BlockImpl_dense(XprType& xpr, Index startRow, Index startCol) + : Base((BlockRows == 0 || BlockCols == 0) ? nullptr : add_to_nullable_pointer(xpr.data(), + xpr.innerStride()*(XprTypeIsRowMajor?startCol:startRow) + xpr.outerStride()*(XprTypeIsRowMajor?startRow:startCol))), + m_xpr(xpr), m_startRow(startRow), m_startCol(startCol) + { + init(); + } + + /** Dynamic-size constructor + */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + BlockImpl_dense(XprType& xpr, + Index startRow, Index startCol, + Index blockRows, Index blockCols) + : Base((blockRows == 0 || blockCols == 0) ? nullptr : add_to_nullable_pointer(xpr.data(), + xpr.innerStride()*(XprTypeIsRowMajor?startCol:startRow) + xpr.outerStride()*(XprTypeIsRowMajor?startRow:startCol)), + blockRows, blockCols), + m_xpr(xpr), m_startRow(startRow), m_startCol(startCol) + { + init(); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + const internal::remove_all_t& nestedExpression() const EIGEN_NOEXCEPT + { + return m_xpr; + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + XprType& nestedExpression() { return m_xpr; } + + /** \sa MapBase::innerStride() */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR + Index innerStride() const EIGEN_NOEXCEPT + { + return internal::traits::HasSameStorageOrderAsXprType + ? m_xpr.innerStride() + : m_xpr.outerStride(); + } + + /** \sa MapBase::outerStride() */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR + Index outerStride() const EIGEN_NOEXCEPT + { + return internal::traits::HasSameStorageOrderAsXprType + ? m_xpr.outerStride() + : m_xpr.innerStride(); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR + StorageIndex startRow() const EIGEN_NOEXCEPT { return m_startRow.value(); } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR + StorageIndex startCol() const EIGEN_NOEXCEPT { return m_startCol.value(); } + + #ifndef __SUNPRO_CC + // FIXME sunstudio is not friendly with the above friend... + // META-FIXME there is no 'friend' keyword around here. Is this obsolete? + protected: + #endif + + #ifndef EIGEN_PARSED_BY_DOXYGEN + /** \internal used by allowAligned() */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + BlockImpl_dense(XprType& xpr, const Scalar* data, Index blockRows, Index blockCols) + : Base(data, blockRows, blockCols), m_xpr(xpr) + { + init(); + } + #endif + + protected: + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + void init() + { + m_outerStride = internal::traits::HasSameStorageOrderAsXprType + ? m_xpr.outerStride() + : m_xpr.innerStride(); + } + + XprTypeNested m_xpr; + const internal::variable_if_dynamic m_startRow; + const internal::variable_if_dynamic m_startCol; + Index m_outerStride; +}; + +} // end namespace internal + +} // end namespace Eigen + +#endif // EIGEN_BLOCK_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/CommaInitializer.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/CommaInitializer.h new file mode 100644 index 0000000000000000000000000000000000000000..7c2eea8a606062d4509f9c108697221c4b3482a5 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/CommaInitializer.h @@ -0,0 +1,166 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008 Gael Guennebaud +// Copyright (C) 2006-2008 Benoit Jacob +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_COMMAINITIALIZER_H +#define EIGEN_COMMAINITIALIZER_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +/** \class CommaInitializer + * \ingroup Core_Module + * + * \brief Helper class used by the comma initializer operator + * + * This class is internally used to implement the comma initializer feature. It is + * the return type of MatrixBase::operator<<, and most of the time this is the only + * way it is used. + * + * \sa \blank \ref MatrixBaseCommaInitRef "MatrixBase::operator<<", CommaInitializer::finished() + */ +template +struct CommaInitializer +{ + typedef typename XprType::Scalar Scalar; + + EIGEN_DEVICE_FUNC + inline CommaInitializer(XprType& xpr, const Scalar& s) + : m_xpr(xpr), m_row(0), m_col(1), m_currentBlockRows(1) + { + eigen_assert(m_xpr.rows() > 0 && m_xpr.cols() > 0 + && "Cannot comma-initialize a 0x0 matrix (operator<<)"); + m_xpr.coeffRef(0,0) = s; + } + + template + EIGEN_DEVICE_FUNC + inline CommaInitializer(XprType& xpr, const DenseBase& other) + : m_xpr(xpr), m_row(0), m_col(other.cols()), m_currentBlockRows(other.rows()) + { + eigen_assert(m_xpr.rows() >= other.rows() && m_xpr.cols() >= other.cols() + && "Cannot comma-initialize a 0x0 matrix (operator<<)"); + m_xpr.template block(0, 0, other.rows(), other.cols()) = other; + } + + /* Copy/Move constructor which transfers ownership. This is crucial in + * absence of return value optimization to avoid assertions during destruction. */ + // FIXME in C++11 mode this could be replaced by a proper RValue constructor + EIGEN_DEVICE_FUNC + inline CommaInitializer(const CommaInitializer& o) + : m_xpr(o.m_xpr), m_row(o.m_row), m_col(o.m_col), m_currentBlockRows(o.m_currentBlockRows) { + // Mark original object as finished. In absence of R-value references we need to const_cast: + const_cast(o).m_row = m_xpr.rows(); + const_cast(o).m_col = m_xpr.cols(); + const_cast(o).m_currentBlockRows = 0; + } + + /* inserts a scalar value in the target matrix */ + EIGEN_DEVICE_FUNC + CommaInitializer& operator,(const Scalar& s) + { + if (m_col==m_xpr.cols()) + { + m_row+=m_currentBlockRows; + m_col = 0; + m_currentBlockRows = 1; + eigen_assert(m_row + EIGEN_DEVICE_FUNC + CommaInitializer& operator,(const DenseBase& other) + { + if (m_col==m_xpr.cols() && (other.cols()!=0 || other.rows()!=m_currentBlockRows)) + { + m_row+=m_currentBlockRows; + m_col = 0; + m_currentBlockRows = other.rows(); + eigen_assert(m_row+m_currentBlockRows<=m_xpr.rows() + && "Too many rows passed to comma initializer (operator<<)"); + } + eigen_assert((m_col + other.cols() <= m_xpr.cols()) + && "Too many coefficients passed to comma initializer (operator<<)"); + eigen_assert(m_currentBlockRows==other.rows()); + m_xpr.template block + (m_row, m_col, other.rows(), other.cols()) = other; + m_col += other.cols(); + return *this; + } + + EIGEN_DEVICE_FUNC + inline ~CommaInitializer() +#if defined VERIFY_RAISES_ASSERT && (!defined EIGEN_NO_ASSERTION_CHECKING) && defined EIGEN_EXCEPTIONS + EIGEN_EXCEPTION_SPEC(Eigen::eigen_assert_exception) +#endif + { + finished(); + } + + /** \returns the built matrix once all its coefficients have been set. + * Calling finished is 100% optional. Its purpose is to write expressions + * like this: + * \code + * quaternion.fromRotationMatrix((Matrix3f() << axis0, axis1, axis2).finished()); + * \endcode + */ + EIGEN_DEVICE_FUNC + inline XprType& finished() { + eigen_assert(((m_row+m_currentBlockRows) == m_xpr.rows() || m_xpr.cols() == 0) + && m_col == m_xpr.cols() + && "Too few coefficients passed to comma initializer (operator<<)"); + return m_xpr; + } + + XprType& m_xpr; // target expression + Index m_row; // current row id + Index m_col; // current col id + Index m_currentBlockRows; // current block height +}; + +/** \anchor MatrixBaseCommaInitRef + * Convenient operator to set the coefficients of a matrix. + * + * The coefficients must be provided in a row major order and exactly match + * the size of the matrix. Otherwise an assertion is raised. + * + * Example: \include MatrixBase_set.cpp + * Output: \verbinclude MatrixBase_set.out + * + * \note According the c++ standard, the argument expressions of this comma initializer are evaluated in arbitrary order. + * + * \sa CommaInitializer::finished(), class CommaInitializer + */ +template +EIGEN_DEVICE_FUNC inline CommaInitializer DenseBase::operator<< (const Scalar& s) +{ + return CommaInitializer(*static_cast(this), s); +} + +/** \sa operator<<(const Scalar&) */ +template +template +EIGEN_DEVICE_FUNC inline CommaInitializer +DenseBase::operator<<(const DenseBase& other) +{ + return CommaInitializer(*static_cast(this), other); +} + +} // end namespace Eigen + +#endif // EIGEN_COMMAINITIALIZER_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/ConditionEstimator.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/ConditionEstimator.h new file mode 100644 index 0000000000000000000000000000000000000000..694be8ba7a0cc1c17341b744295365e278ee0cbc --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/ConditionEstimator.h @@ -0,0 +1,177 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2016 Rasmus Munk Larsen (rmlarsen@google.com) +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_CONDITIONESTIMATOR_H +#define EIGEN_CONDITIONESTIMATOR_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { + +template +struct rcond_compute_sign { + static inline Vector run(const Vector& v) { + const RealVector v_abs = v.cwiseAbs(); + return (v_abs.array() == static_cast(0)) + .select(Vector::Ones(v.size()), v.cwiseQuotient(v_abs)); + } +}; + +// Partial specialization to avoid elementwise division for real vectors. +template +struct rcond_compute_sign { + static inline Vector run(const Vector& v) { + return (v.array() < static_cast(0)) + .select(-Vector::Ones(v.size()), Vector::Ones(v.size())); + } +}; + +/** + * \returns an estimate of ||inv(matrix)||_1 given a decomposition of + * \a matrix that implements .solve() and .adjoint().solve() methods. + * + * This function implements Algorithms 4.1 and 5.1 from + * http://www.maths.manchester.ac.uk/~higham/narep/narep135.pdf + * which also forms the basis for the condition number estimators in + * LAPACK. Since at most 10 calls to the solve method of dec are + * performed, the total cost is O(dims^2), as opposed to O(dims^3) + * needed to compute the inverse matrix explicitly. + * + * The most common usage is in estimating the condition number + * ||matrix||_1 * ||inv(matrix)||_1. The first term ||matrix||_1 can be + * computed directly in O(n^2) operations. + * + * Supports the following decompositions: FullPivLU, PartialPivLU, LDLT, and + * LLT. + * + * \sa FullPivLU, PartialPivLU, LDLT, LLT. + */ +template +typename Decomposition::RealScalar rcond_invmatrix_L1_norm_estimate(const Decomposition& dec) +{ + typedef typename Decomposition::MatrixType MatrixType; + typedef typename Decomposition::Scalar Scalar; + typedef typename Decomposition::RealScalar RealScalar; + typedef typename internal::plain_col_type::type Vector; + typedef typename internal::plain_col_type::type RealVector; + const bool is_complex = (NumTraits::IsComplex != 0); + + eigen_assert(dec.rows() == dec.cols()); + const Index n = dec.rows(); + if (n == 0) + return 0; + + // Disable Index to float conversion warning +#ifdef __INTEL_COMPILER + #pragma warning push + #pragma warning ( disable : 2259 ) +#endif + Vector v = dec.solve(Vector::Ones(n) / Scalar(n)); +#ifdef __INTEL_COMPILER + #pragma warning pop +#endif + + // lower_bound is a lower bound on + // ||inv(matrix)||_1 = sup_v ||inv(matrix) v||_1 / ||v||_1 + // and is the objective maximized by the ("super-") gradient ascent + // algorithm below. + RealScalar lower_bound = v.template lpNorm<1>(); + if (n == 1) + return lower_bound; + + // Gradient ascent algorithm follows: We know that the optimum is achieved at + // one of the simplices v = e_i, so in each iteration we follow a + // super-gradient to move towards the optimal one. + RealScalar old_lower_bound = lower_bound; + Vector sign_vector(n); + Vector old_sign_vector; + Index v_max_abs_index = -1; + Index old_v_max_abs_index = v_max_abs_index; + for (int k = 0; k < 4; ++k) + { + sign_vector = internal::rcond_compute_sign::run(v); + if (k > 0 && !is_complex && sign_vector == old_sign_vector) { + // Break if the solution stagnated. + break; + } + // v_max_abs_index = argmax |real( inv(matrix)^T * sign_vector )| + v = dec.adjoint().solve(sign_vector); + v.real().cwiseAbs().maxCoeff(&v_max_abs_index); + if (v_max_abs_index == old_v_max_abs_index) { + // Break if the solution stagnated. + break; + } + // Move to the new simplex e_j, where j = v_max_abs_index. + v = dec.solve(Vector::Unit(n, v_max_abs_index)); // v = inv(matrix) * e_j. + lower_bound = v.template lpNorm<1>(); + if (lower_bound <= old_lower_bound) { + // Break if the gradient step did not increase the lower_bound. + break; + } + if (!is_complex) { + old_sign_vector = sign_vector; + } + old_v_max_abs_index = v_max_abs_index; + old_lower_bound = lower_bound; + } + // The following calculates an independent estimate of ||matrix||_1 by + // multiplying matrix by a vector with entries of slowly increasing + // magnitude and alternating sign: + // v_i = (-1)^{i} (1 + (i / (dim-1))), i = 0,...,dim-1. + // This improvement to Hager's algorithm above is due to Higham. It was + // added to make the algorithm more robust in certain corner cases where + // large elements in the matrix might otherwise escape detection due to + // exact cancellation (especially when op and op_adjoint correspond to a + // sequence of backsubstitutions and permutations), which could cause + // Hager's algorithm to vastly underestimate ||matrix||_1. + Scalar alternating_sign(RealScalar(1)); + for (Index i = 0; i < n; ++i) { + // The static_cast is needed when Scalar is a complex and RealScalar implements expression templates + v[i] = alternating_sign * static_cast(RealScalar(1) + (RealScalar(i) / (RealScalar(n - 1)))); + alternating_sign = -alternating_sign; + } + v = dec.solve(v); + const RealScalar alternate_lower_bound = (2 * v.template lpNorm<1>()) / (3 * RealScalar(n)); + return numext::maxi(lower_bound, alternate_lower_bound); +} + +/** \brief Reciprocal condition number estimator. + * + * Computing a decomposition of a dense matrix takes O(n^3) operations, while + * this method estimates the condition number quickly and reliably in O(n^2) + * operations. + * + * \returns an estimate of the reciprocal condition number + * (1 / (||matrix||_1 * ||inv(matrix)||_1)) of matrix, given ||matrix||_1 and + * its decomposition. Supports the following decompositions: FullPivLU, + * PartialPivLU, LDLT, and LLT. + * + * \sa FullPivLU, PartialPivLU, LDLT, LLT. + */ +template +typename Decomposition::RealScalar +rcond_estimate_helper(typename Decomposition::RealScalar matrix_norm, const Decomposition& dec) +{ + typedef typename Decomposition::RealScalar RealScalar; + eigen_assert(dec.rows() == dec.cols()); + if (dec.rows() == 0) return NumTraits::infinity(); + if (numext::is_exactly_zero(matrix_norm)) return RealScalar(0); + if (dec.rows() == 1) return RealScalar(1); + const RealScalar inverse_matrix_norm = rcond_invmatrix_L1_norm_estimate(dec); + return (numext::is_exactly_zero(inverse_matrix_norm) ? RealScalar(0) + : (RealScalar(1) / inverse_matrix_norm) / matrix_norm); +} + +} // namespace internal + +} // namespace Eigen + +#endif diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/CoreEvaluators.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/CoreEvaluators.h new file mode 100644 index 0000000000000000000000000000000000000000..32371c55bf6971f97814c46e7180e2407a09cd1f --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/CoreEvaluators.h @@ -0,0 +1,1945 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2011 Benoit Jacob +// Copyright (C) 2011-2014 Gael Guennebaud +// Copyright (C) 2011-2012 Jitse Niesen +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +#ifndef EIGEN_COREEVALUATORS_H +#define EIGEN_COREEVALUATORS_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { + +// This class returns the evaluator kind from the expression storage kind. +// Default assumes index based accessors +template +struct storage_kind_to_evaluator_kind { + typedef IndexBased Kind; +}; + +// This class returns the evaluator shape from the expression storage kind. +// It can be Dense, Sparse, Triangular, Diagonal, SelfAdjoint, Band, etc. +template struct storage_kind_to_shape; + +template<> struct storage_kind_to_shape { typedef DenseShape Shape; }; +template<> struct storage_kind_to_shape { typedef SolverShape Shape; }; +template<> struct storage_kind_to_shape { typedef PermutationShape Shape; }; +template<> struct storage_kind_to_shape { typedef TranspositionsShape Shape; }; + +// Evaluators have to be specialized with respect to various criteria such as: +// - storage/structure/shape +// - scalar type +// - etc. +// Therefore, we need specialization of evaluator providing additional template arguments for each kind of evaluators. +// We currently distinguish the following kind of evaluators: +// - unary_evaluator for expressions taking only one arguments (CwiseUnaryOp, CwiseUnaryView, Transpose, MatrixWrapper, ArrayWrapper, Reverse, Replicate) +// - binary_evaluator for expression taking two arguments (CwiseBinaryOp) +// - ternary_evaluator for expression taking three arguments (CwiseTernaryOp) +// - product_evaluator for linear algebra products (Product); special case of binary_evaluator because it requires additional tags for dispatching. +// - mapbase_evaluator for Map, Block, Ref +// - block_evaluator for Block (special dispatching to a mapbase_evaluator or unary_evaluator) + +template< typename T, + typename Arg1Kind = typename evaluator_traits::Kind, + typename Arg2Kind = typename evaluator_traits::Kind, + typename Arg3Kind = typename evaluator_traits::Kind, + typename Arg1Scalar = typename traits::Scalar, + typename Arg2Scalar = typename traits::Scalar, + typename Arg3Scalar = typename traits::Scalar> struct ternary_evaluator; + +template< typename T, + typename LhsKind = typename evaluator_traits::Kind, + typename RhsKind = typename evaluator_traits::Kind, + typename LhsScalar = typename traits::Scalar, + typename RhsScalar = typename traits::Scalar> struct binary_evaluator; + +template< typename T, + typename Kind = typename evaluator_traits::Kind, + typename Scalar = typename T::Scalar> struct unary_evaluator; + +// evaluator_traits contains traits for evaluator + +template +struct evaluator_traits_base +{ + // by default, get evaluator kind and shape from storage + typedef typename storage_kind_to_evaluator_kind::StorageKind>::Kind Kind; + typedef typename storage_kind_to_shape::StorageKind>::Shape Shape; +}; + +// Default evaluator traits +template +struct evaluator_traits : public evaluator_traits_base +{ +}; + +template::Shape > +struct evaluator_assume_aliasing { + static const bool value = false; +}; + +// By default, we assume a unary expression: +template +struct evaluator : public unary_evaluator +{ + typedef unary_evaluator Base; + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit evaluator(const T& xpr) : Base(xpr) {} +}; + + +// TODO: Think about const-correctness +template +struct evaluator + : evaluator +{ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit evaluator(const T& xpr) : evaluator(xpr) {} +}; + +// ---------- base class for all evaluators ---------- + +template +struct evaluator_base +{ + // TODO that's not very nice to have to propagate all these traits. They are currently only needed to handle outer,inner indices. + typedef traits ExpressionTraits; + + enum { + Alignment = 0 + }; + // noncopyable: + // Don't make this class inherit noncopyable as this kills EBO (Empty Base Optimization) + // and make complex evaluator much larger than then should do. + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE evaluator_base() {} + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ~evaluator_base() {} +private: + EIGEN_DEVICE_FUNC evaluator_base(const evaluator_base&); + EIGEN_DEVICE_FUNC const evaluator_base& operator=(const evaluator_base&); +}; + +// -------------------- Matrix and Array -------------------- +// +// evaluator is a common base class for the +// Matrix and Array evaluators. +// Here we directly specialize evaluator. This is not really a unary expression, and it is, by definition, dense, +// so no need for more sophisticated dispatching. + +// this helper permits to completely eliminate m_outerStride if it is known at compiletime. +template class plainobjectbase_evaluator_data { +public: + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + plainobjectbase_evaluator_data(const Scalar* ptr, Index outerStride) : data(ptr) + { +#ifndef EIGEN_INTERNAL_DEBUGGING + EIGEN_UNUSED_VARIABLE(outerStride); +#endif + eigen_internal_assert(outerStride==OuterStride); + } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR + Index outerStride() const EIGEN_NOEXCEPT { return OuterStride; } + const Scalar *data; +}; + +template class plainobjectbase_evaluator_data { +public: + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + plainobjectbase_evaluator_data(const Scalar* ptr, Index outerStride) : data(ptr), m_outerStride(outerStride) {} + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Index outerStride() const { return m_outerStride; } + const Scalar *data; +protected: + Index m_outerStride; +}; + +template +struct evaluator > + : evaluator_base +{ + typedef PlainObjectBase PlainObjectType; + typedef typename PlainObjectType::Scalar Scalar; + typedef typename PlainObjectType::CoeffReturnType CoeffReturnType; + + enum { + IsRowMajor = PlainObjectType::IsRowMajor, + IsVectorAtCompileTime = PlainObjectType::IsVectorAtCompileTime, + RowsAtCompileTime = PlainObjectType::RowsAtCompileTime, + ColsAtCompileTime = PlainObjectType::ColsAtCompileTime, + + CoeffReadCost = NumTraits::ReadCost, + Flags = traits::EvaluatorFlags, + Alignment = traits::Alignment + }; + enum { + // We do not need to know the outer stride for vectors + OuterStrideAtCompileTime = IsVectorAtCompileTime ? 0 + : int(IsRowMajor) ? ColsAtCompileTime + : RowsAtCompileTime + }; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + evaluator() + : m_d(0,OuterStrideAtCompileTime) + { + EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit evaluator(const PlainObjectType& m) + : m_d(m.data(),IsVectorAtCompileTime ? 0 : m.outerStride()) + { + EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index row, Index col) const + { + if (IsRowMajor) + return m_d.data[row * m_d.outerStride() + col]; + else + return m_d.data[row + col * m_d.outerStride()]; + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index index) const + { + return m_d.data[index]; + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& coeffRef(Index row, Index col) + { + if (IsRowMajor) + return const_cast(m_d.data)[row * m_d.outerStride() + col]; + else + return const_cast(m_d.data)[row + col * m_d.outerStride()]; + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& coeffRef(Index index) + { + return const_cast(m_d.data)[index]; + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index row, Index col) const + { + if (IsRowMajor) + return ploadt(m_d.data + row * m_d.outerStride() + col); + else + return ploadt(m_d.data + row + col * m_d.outerStride()); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index index) const + { + return ploadt(m_d.data + index); + } + + template + EIGEN_STRONG_INLINE + void writePacket(Index row, Index col, const PacketType& x) + { + if (IsRowMajor) + return pstoret + (const_cast(m_d.data) + row * m_d.outerStride() + col, x); + else + return pstoret + (const_cast(m_d.data) + row + col * m_d.outerStride(), x); + } + + template + EIGEN_STRONG_INLINE + void writePacket(Index index, const PacketType& x) + { + return pstoret(const_cast(m_d.data) + index, x); + } + +protected: + + plainobjectbase_evaluator_data m_d; +}; + +template +struct evaluator > + : evaluator > > +{ + typedef Matrix XprType; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + evaluator() {} + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit evaluator(const XprType& m) + : evaluator >(m) + { } +}; + +template +struct evaluator > + : evaluator > > +{ + typedef Array XprType; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + evaluator() {} + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit evaluator(const XprType& m) + : evaluator >(m) + { } +}; + +// -------------------- Transpose -------------------- + +template +struct unary_evaluator, IndexBased> + : evaluator_base > +{ + typedef Transpose XprType; + + enum { + CoeffReadCost = evaluator::CoeffReadCost, + Flags = evaluator::Flags ^ RowMajorBit, + Alignment = evaluator::Alignment + }; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit unary_evaluator(const XprType& t) : m_argImpl(t.nestedExpression()) {} + + typedef typename XprType::Scalar Scalar; + typedef typename XprType::CoeffReturnType CoeffReturnType; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index row, Index col) const + { + return m_argImpl.coeff(col, row); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index index) const + { + return m_argImpl.coeff(index); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& coeffRef(Index row, Index col) + { + return m_argImpl.coeffRef(col, row); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + typename XprType::Scalar& coeffRef(Index index) + { + return m_argImpl.coeffRef(index); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index row, Index col) const + { + return m_argImpl.template packet(col, row); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index index) const + { + return m_argImpl.template packet(index); + } + + template + EIGEN_STRONG_INLINE + void writePacket(Index row, Index col, const PacketType& x) + { + m_argImpl.template writePacket(col, row, x); + } + + template + EIGEN_STRONG_INLINE + void writePacket(Index index, const PacketType& x) + { + m_argImpl.template writePacket(index, x); + } + +protected: + evaluator m_argImpl; +}; + +// -------------------- CwiseNullaryOp -------------------- +// Like Matrix and Array, this is not really a unary expression, so we directly specialize evaluator. +// Likewise, there is not need to more sophisticated dispatching here. + +template::value, + bool has_unary = has_unary_operator::value, + bool has_binary = has_binary_operator::value> +struct nullary_wrapper +{ + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp& op, IndexType i, IndexType j) const { return op(i,j); } + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp& op, IndexType i) const { return op(i); } + + template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T packetOp(const NullaryOp& op, IndexType i, IndexType j) const { return op.template packetOp(i,j); } + template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T packetOp(const NullaryOp& op, IndexType i) const { return op.template packetOp(i); } +}; + +template +struct nullary_wrapper +{ + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp& op, IndexType=0, IndexType=0) const { return op(); } + template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T packetOp(const NullaryOp& op, IndexType=0, IndexType=0) const { return op.template packetOp(); } +}; + +template +struct nullary_wrapper +{ + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp& op, IndexType i, IndexType j=0) const { return op(i,j); } + template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T packetOp(const NullaryOp& op, IndexType i, IndexType j=0) const { return op.template packetOp(i,j); } +}; + +// We need the following specialization for vector-only functors assigned to a runtime vector, +// for instance, using linspace and assigning a RowVectorXd to a MatrixXd or even a row of a MatrixXd. +// In this case, i==0 and j is used for the actual iteration. +template +struct nullary_wrapper +{ + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp& op, IndexType i, IndexType j) const { + eigen_assert(i==0 || j==0); + return op(i+j); + } + template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T packetOp(const NullaryOp& op, IndexType i, IndexType j) const { + eigen_assert(i==0 || j==0); + return op.template packetOp(i+j); + } + + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp& op, IndexType i) const { return op(i); } + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T packetOp(const NullaryOp& op, IndexType i) const { return op.template packetOp(i); } +}; + +template +struct nullary_wrapper {}; + +#if 0 && EIGEN_COMP_MSVC>0 +// Disable this ugly workaround. This is now handled in traits::match, +// but this piece of code might still become handly if some other weird compilation +// erros pop up again. + +// MSVC exhibits a weird compilation error when +// compiling: +// Eigen::MatrixXf A = MatrixXf::Random(3,3); +// Ref R = 2.f*A; +// and that has_*ary_operator> have not been instantiated yet. +// The "problem" is that evaluator<2.f*A> is instantiated by traits::match<2.f*A> +// and at that time has_*ary_operator returns true regardless of T. +// Then nullary_wrapper is badly instantiated as nullary_wrapper<.,.,true,true,true>. +// The trick is thus to defer the proper instantiation of nullary_wrapper when coeff(), +// and packet() are really instantiated as implemented below: + +// This is a simple wrapper around Index to enforce the re-instantiation of +// has_*ary_operator when needed. +template struct nullary_wrapper_workaround_msvc { + nullary_wrapper_workaround_msvc(const T&); + operator T()const; +}; + +template +struct nullary_wrapper +{ + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp& op, IndexType i, IndexType j) const { + return nullary_wrapper >::value, + has_unary_operator >::value, + has_binary_operator >::value>().operator()(op,i,j); + } + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp& op, IndexType i) const { + return nullary_wrapper >::value, + has_unary_operator >::value, + has_binary_operator >::value>().operator()(op,i); + } + + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T packetOp(const NullaryOp& op, IndexType i, IndexType j) const { + return nullary_wrapper >::value, + has_unary_operator >::value, + has_binary_operator >::value>().template packetOp(op,i,j); + } + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T packetOp(const NullaryOp& op, IndexType i) const { + return nullary_wrapper >::value, + has_unary_operator >::value, + has_binary_operator >::value>().template packetOp(op,i); + } +}; +#endif // MSVC workaround + +template +struct evaluator > + : evaluator_base > +{ + typedef CwiseNullaryOp XprType; + typedef internal::remove_all_t PlainObjectTypeCleaned; + + enum { + CoeffReadCost = internal::functor_traits::Cost, + + Flags = (evaluator::Flags + & ( HereditaryBits + | (functor_has_linear_access::ret ? LinearAccessBit : 0) + | (functor_traits::PacketAccess ? PacketAccessBit : 0))) + | (functor_traits::IsRepeatable ? 0 : EvalBeforeNestingBit), + Alignment = AlignedMax + }; + + EIGEN_DEVICE_FUNC explicit evaluator(const XprType& n) + : m_functor(n.functor()), m_wrapper() + { + EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); + } + + typedef typename XprType::CoeffReturnType CoeffReturnType; + + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(IndexType row, IndexType col) const + { + return m_wrapper(m_functor, row, col); + } + + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(IndexType index) const + { + return m_wrapper(m_functor,index); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(IndexType row, IndexType col) const + { + return m_wrapper.template packetOp(m_functor, row, col); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(IndexType index) const + { + return m_wrapper.template packetOp(m_functor, index); + } + +protected: + const NullaryOp m_functor; + const internal::nullary_wrapper m_wrapper; +}; + +// -------------------- CwiseUnaryOp -------------------- + +template +struct unary_evaluator, IndexBased > + : evaluator_base > +{ + typedef CwiseUnaryOp XprType; + + enum { + CoeffReadCost = int(evaluator::CoeffReadCost) + int(functor_traits::Cost), + + Flags = evaluator::Flags + & (HereditaryBits | LinearAccessBit | (functor_traits::PacketAccess ? PacketAccessBit : 0)), + Alignment = evaluator::Alignment + }; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit unary_evaluator(const XprType& op) : m_d(op) + { + EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits::Cost); + EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); + } + + typedef typename XprType::CoeffReturnType CoeffReturnType; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index row, Index col) const + { + return m_d.func()(m_d.argImpl.coeff(row, col)); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index index) const + { + return m_d.func()(m_d.argImpl.coeff(index)); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index row, Index col) const + { + return m_d.func().packetOp(m_d.argImpl.template packet(row, col)); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index index) const + { + return m_d.func().packetOp(m_d.argImpl.template packet(index)); + } + +protected: + + // this helper permits to completely eliminate the functor if it is empty + struct Data + { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Data(const XprType& xpr) : op(xpr.functor()), argImpl(xpr.nestedExpression()) {} + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + const UnaryOp& func() const { return op; } + UnaryOp op; + evaluator argImpl; + }; + + Data m_d; +}; + +// ----------------------- Casting --------------------- + +template +struct unary_evaluator, ArgType>, IndexBased> { + using CastOp = core_cast_op; + using XprType = CwiseUnaryOp; + + // Use the largest packet type by default + using SrcPacketType = typename packet_traits::type; + static constexpr int SrcPacketSize = unpacket_traits::size; + static constexpr int SrcPacketBytes = SrcPacketSize * sizeof(SrcType); + + enum { + CoeffReadCost = int(evaluator::CoeffReadCost) + int(functor_traits::Cost), + PacketAccess = functor_traits::PacketAccess, + ActualPacketAccessBit = PacketAccess ? PacketAccessBit : 0, + Flags = evaluator::Flags & (HereditaryBits | LinearAccessBit | ActualPacketAccessBit), + IsRowMajor = (evaluator::Flags & RowMajorBit), + Alignment = evaluator::Alignment + }; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit unary_evaluator(const XprType& xpr) + : m_argImpl(xpr.nestedExpression()), m_rows(xpr.rows()), m_cols(xpr.cols()) { + EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits::Cost); + EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); + } + + template + using AltSrcScalarOp = std::enable_if_t<(unpacket_traits::size < SrcPacketSize && !find_packet_by_size::size>::value), bool>; + template + using SrcPacketArgs1 = std::enable_if_t<(find_packet_by_size::size>::value), bool>; + template + using SrcPacketArgs2 = std::enable_if_t<(unpacket_traits::size) == (2 * SrcPacketSize), bool>; + template + using SrcPacketArgs4 = std::enable_if_t<(unpacket_traits::size) == (4 * SrcPacketSize), bool>; + template + using SrcPacketArgs8 = std::enable_if_t<(unpacket_traits::size) == (8 * SrcPacketSize), bool>; + + template = true> + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool check_array_bounds(Index, Index col, Index packetSize) const { + return col + packetSize <= cols(); + } + template = true> + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool check_array_bounds(Index row, Index, Index packetSize) const { + return row + packetSize <= rows(); + } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool check_array_bounds(Index index, Index packetSize) const { + return index + packetSize <= size(); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE SrcType srcCoeff(Index row, Index col, Index offset) const { + Index actualRow = IsRowMajor ? row : row + offset; + Index actualCol = IsRowMajor ? col + offset : col; + return m_argImpl.coeff(actualRow, actualCol); + } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE SrcType srcCoeff(Index index, Index offset) const { + Index actualIndex = index + offset; + return m_argImpl.coeff(actualIndex); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DstType coeff(Index row, Index col) const { + return cast(srcCoeff(row, col, 0)); + } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DstType coeff(Index index) const { return cast(srcCoeff(index, 0)); } + + template + EIGEN_STRONG_INLINE PacketType srcPacket(Index row, Index col, Index offset) const { + constexpr int PacketSize = unpacket_traits::size; + Index actualRow = IsRowMajor ? row : row + (offset * PacketSize); + Index actualCol = IsRowMajor ? col + (offset * PacketSize) : col; + eigen_assert(check_array_bounds(actualRow, actualCol, PacketSize) && "Array index out of bounds"); + return m_argImpl.template packet(actualRow, actualCol); + } + template + EIGEN_STRONG_INLINE PacketType srcPacket(Index index, Index offset) const { + constexpr int PacketSize = unpacket_traits::size; + Index actualIndex = index + (offset * PacketSize); + eigen_assert(check_array_bounds(actualIndex, PacketSize) && "Array index out of bounds"); + return m_argImpl.template packet(actualIndex); + } + + // There is no source packet type with equal or fewer elements than DstPacketType. + // This is problematic as the evaluation loop may attempt to access data outside the bounds of the array. + // For example, consider the cast utilizing pcast with an array of size 4: {0.0f,1.0f,2.0f,3.0f}. + // The first iteration of the evaulation loop will load 16 bytes: {0.0f,1.0f,2.0f,3.0f} and cast to {0.0,1.0}, which is acceptable. + // The second iteration will load 16 bytes: {2.0f,3.0f,?,?}, which is outside the bounds of the array. + + // Instead, perform runtime check to determine if the load would access data outside the bounds of the array. + // If not, perform full load. Otherwise, revert to a scalar loop to perform a partial load. + // In either case, perform a vectorized cast of the source packet. + template = true> + EIGEN_STRONG_INLINE DstPacketType packet(Index row, Index col) const { + constexpr int DstPacketSize = unpacket_traits::size; + constexpr int SrcBytesIncrement = DstPacketSize * sizeof(SrcType); + constexpr int SrcLoadMode = plain_enum_min(SrcBytesIncrement, LoadMode); + SrcPacketType src; + if (EIGEN_PREDICT_TRUE(check_array_bounds(row, col, SrcPacketSize))) { + src = srcPacket(row, col, 0); + } else { + Array srcArray; + for (size_t k = 0; k < DstPacketSize; k++) srcArray[k] = srcCoeff(row, col, k); + for (size_t k = DstPacketSize; k < SrcPacketSize; k++) srcArray[k] = SrcType(0); + src = pload(srcArray.data()); + } + return pcast(src); + } + // Use the source packet type with the same size as DstPacketType, if it exists + template = true> + EIGEN_STRONG_INLINE DstPacketType packet(Index row, Index col) const { + constexpr int DstPacketSize = unpacket_traits::size; + using SizedSrcPacketType = typename find_packet_by_size::type; + constexpr int SrcBytesIncrement = DstPacketSize * sizeof(SrcType); + constexpr int SrcLoadMode = plain_enum_min(SrcBytesIncrement, LoadMode); + return pcast( + srcPacket(row, col, 0)); + } + // unpacket_traits::size == 2 * SrcPacketSize + template = true> + EIGEN_STRONG_INLINE DstPacketType packet(Index row, Index col) const { + constexpr int SrcLoadMode = plain_enum_min(SrcPacketBytes, LoadMode); + return pcast( + srcPacket(row, col, 0), srcPacket(row, col, 1)); + } + // unpacket_traits::size == 4 * SrcPacketSize + template = true> + EIGEN_STRONG_INLINE DstPacketType packet(Index row, Index col) const { + constexpr int SrcLoadMode = plain_enum_min(SrcPacketBytes, LoadMode); + return pcast( + srcPacket(row, col, 0), srcPacket(row, col, 1), + srcPacket(row, col, 2), srcPacket(row, col, 3)); + } + // unpacket_traits::size == 8 * SrcPacketSize + template = true> + EIGEN_STRONG_INLINE DstPacketType packet(Index row, Index col) const { + constexpr int SrcLoadMode = plain_enum_min(SrcPacketBytes, LoadMode); + return pcast( + srcPacket(row, col, 0), srcPacket(row, col, 1), + srcPacket(row, col, 2), srcPacket(row, col, 3), + srcPacket(row, col, 4), srcPacket(row, col, 5), + srcPacket(row, col, 6), srcPacket(row, col, 7)); + } + + // Analagous routines for linear access. + template = true> + EIGEN_STRONG_INLINE DstPacketType packet(Index index) const { + constexpr int DstPacketSize = unpacket_traits::size; + constexpr int SrcBytesIncrement = DstPacketSize * sizeof(SrcType); + constexpr int SrcLoadMode = plain_enum_min(SrcBytesIncrement, LoadMode); + SrcPacketType src; + if (EIGEN_PREDICT_TRUE(check_array_bounds(index, SrcPacketSize))) { + src = srcPacket(index, 0); + } else { + Array srcArray; + for (size_t k = 0; k < DstPacketSize; k++) srcArray[k] = srcCoeff(index, k); + for (size_t k = DstPacketSize; k < SrcPacketSize; k++) srcArray[k] = SrcType(0); + src = pload(srcArray.data()); + } + return pcast(src); + } + template = true> + EIGEN_STRONG_INLINE DstPacketType packet(Index index) const { + constexpr int DstPacketSize = unpacket_traits::size; + using SizedSrcPacketType = typename find_packet_by_size::type; + constexpr int SrcBytesIncrement = DstPacketSize * sizeof(SrcType); + constexpr int SrcLoadMode = plain_enum_min(SrcBytesIncrement, LoadMode); + return pcast( + srcPacket(index, 0)); + } + template = true> + EIGEN_STRONG_INLINE DstPacketType packet(Index index) const { + constexpr int SrcLoadMode = plain_enum_min(SrcPacketBytes, LoadMode); + return pcast( + srcPacket(index, 0), srcPacket(index, 1)); + } + template = true> + EIGEN_STRONG_INLINE DstPacketType packet(Index index) const { + constexpr int SrcLoadMode = plain_enum_min(SrcPacketBytes, LoadMode); + return pcast( + srcPacket(index, 0), srcPacket(index, 1), + srcPacket(index, 2), srcPacket(index, 3)); + } + template = true> + EIGEN_STRONG_INLINE DstPacketType packet(Index index) const { + constexpr int SrcLoadMode = plain_enum_min(SrcPacketBytes, LoadMode); + return pcast( + srcPacket(index, 0), srcPacket(index, 1), + srcPacket(index, 2), srcPacket(index, 3), + srcPacket(index, 4), srcPacket(index, 5), + srcPacket(index, 6), srcPacket(index, 7)); + } + + constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rows() const { return m_rows; } + constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index cols() const { return m_cols; } + constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index size() const { return m_rows * m_cols; } + + protected: + const evaluator m_argImpl; + const variable_if_dynamic m_rows; + const variable_if_dynamic m_cols; +}; + +// -------------------- CwiseTernaryOp -------------------- + +// this is a ternary expression +template +struct evaluator > + : public ternary_evaluator > +{ + typedef CwiseTernaryOp XprType; + typedef ternary_evaluator > Base; + + EIGEN_DEVICE_FUNC explicit evaluator(const XprType& xpr) : Base(xpr) {} +}; + +template +struct ternary_evaluator, IndexBased, IndexBased> + : evaluator_base > +{ + typedef CwiseTernaryOp XprType; + + enum { + CoeffReadCost = int(evaluator::CoeffReadCost) + int(evaluator::CoeffReadCost) + int(evaluator::CoeffReadCost) + int(functor_traits::Cost), + + Arg1Flags = evaluator::Flags, + Arg2Flags = evaluator::Flags, + Arg3Flags = evaluator::Flags, + SameType = is_same::value && is_same::value, + StorageOrdersAgree = (int(Arg1Flags)&RowMajorBit)==(int(Arg2Flags)&RowMajorBit) && (int(Arg1Flags)&RowMajorBit)==(int(Arg3Flags)&RowMajorBit), + Flags0 = (int(Arg1Flags) | int(Arg2Flags) | int(Arg3Flags)) & ( + HereditaryBits + | (int(Arg1Flags) & int(Arg2Flags) & int(Arg3Flags) & + ( (StorageOrdersAgree ? LinearAccessBit : 0) + | (functor_traits::PacketAccess && StorageOrdersAgree && SameType ? PacketAccessBit : 0) + ) + ) + ), + Flags = (Flags0 & ~RowMajorBit) | (Arg1Flags & RowMajorBit), + Alignment = plain_enum_min( + plain_enum_min(evaluator::Alignment, evaluator::Alignment), + evaluator::Alignment) + }; + + EIGEN_DEVICE_FUNC explicit ternary_evaluator(const XprType& xpr) : m_d(xpr) + { + EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits::Cost); + EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); + } + + typedef typename XprType::CoeffReturnType CoeffReturnType; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index row, Index col) const + { + return m_d.func()(m_d.arg1Impl.coeff(row, col), m_d.arg2Impl.coeff(row, col), m_d.arg3Impl.coeff(row, col)); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index index) const + { + return m_d.func()(m_d.arg1Impl.coeff(index), m_d.arg2Impl.coeff(index), m_d.arg3Impl.coeff(index)); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index row, Index col) const + { + return m_d.func().packetOp(m_d.arg1Impl.template packet(row, col), + m_d.arg2Impl.template packet(row, col), + m_d.arg3Impl.template packet(row, col)); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index index) const + { + return m_d.func().packetOp(m_d.arg1Impl.template packet(index), + m_d.arg2Impl.template packet(index), + m_d.arg3Impl.template packet(index)); + } + +protected: + // this helper permits to completely eliminate the functor if it is empty + struct Data + { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Data(const XprType& xpr) : op(xpr.functor()), arg1Impl(xpr.arg1()), arg2Impl(xpr.arg2()), arg3Impl(xpr.arg3()) {} + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + const TernaryOp& func() const { return op; } + TernaryOp op; + evaluator arg1Impl; + evaluator arg2Impl; + evaluator arg3Impl; + }; + + Data m_d; +}; + +// -------------------- CwiseBinaryOp -------------------- + +// this is a binary expression +template +struct evaluator > + : public binary_evaluator > +{ + typedef CwiseBinaryOp XprType; + typedef binary_evaluator > Base; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit evaluator(const XprType& xpr) : Base(xpr) {} +}; + +template +struct binary_evaluator, IndexBased, IndexBased> + : evaluator_base > +{ + typedef CwiseBinaryOp XprType; + + enum { + CoeffReadCost = int(evaluator::CoeffReadCost) + int(evaluator::CoeffReadCost) + int(functor_traits::Cost), + + LhsFlags = evaluator::Flags, + RhsFlags = evaluator::Flags, + SameType = is_same::value, + StorageOrdersAgree = (int(LhsFlags)&RowMajorBit)==(int(RhsFlags)&RowMajorBit), + Flags0 = (int(LhsFlags) | int(RhsFlags)) & ( + HereditaryBits + | (int(LhsFlags) & int(RhsFlags) & + ( (StorageOrdersAgree ? LinearAccessBit : 0) + | (functor_traits::PacketAccess && StorageOrdersAgree && SameType ? PacketAccessBit : 0) + ) + ) + ), + Flags = (Flags0 & ~RowMajorBit) | (LhsFlags & RowMajorBit), + Alignment = plain_enum_min(evaluator::Alignment, evaluator::Alignment) + }; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit binary_evaluator(const XprType& xpr) : m_d(xpr) + { + EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits::Cost); + EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); + } + + typedef typename XprType::CoeffReturnType CoeffReturnType; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index row, Index col) const + { + return m_d.func()(m_d.lhsImpl.coeff(row, col), m_d.rhsImpl.coeff(row, col)); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index index) const + { + return m_d.func()(m_d.lhsImpl.coeff(index), m_d.rhsImpl.coeff(index)); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index row, Index col) const + { + return m_d.func().packetOp(m_d.lhsImpl.template packet(row, col), + m_d.rhsImpl.template packet(row, col)); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index index) const + { + return m_d.func().packetOp(m_d.lhsImpl.template packet(index), + m_d.rhsImpl.template packet(index)); + } + +protected: + + // this helper permits to completely eliminate the functor if it is empty + struct Data + { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Data(const XprType& xpr) : op(xpr.functor()), lhsImpl(xpr.lhs()), rhsImpl(xpr.rhs()) {} + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + const BinaryOp& func() const { return op; } + BinaryOp op; + evaluator lhsImpl; + evaluator rhsImpl; + }; + + Data m_d; +}; + +// -------------------- CwiseUnaryView -------------------- + +template +struct unary_evaluator, IndexBased> + : evaluator_base > +{ + typedef CwiseUnaryView XprType; + + enum { + CoeffReadCost = int(evaluator::CoeffReadCost) + int(functor_traits::Cost), + + Flags = (evaluator::Flags & (HereditaryBits | LinearAccessBit | DirectAccessBit)), + + Alignment = 0 // FIXME it is not very clear why alignment is necessarily lost... + }; + + EIGEN_DEVICE_FUNC explicit unary_evaluator(const XprType& op) : m_d(op) + { + EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits::Cost); + EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); + } + + typedef typename XprType::Scalar Scalar; + typedef typename XprType::CoeffReturnType CoeffReturnType; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index row, Index col) const + { + return m_d.func()(m_d.argImpl.coeff(row, col)); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index index) const + { + return m_d.func()(m_d.argImpl.coeff(index)); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& coeffRef(Index row, Index col) + { + return m_d.func()(m_d.argImpl.coeffRef(row, col)); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& coeffRef(Index index) + { + return m_d.func()(m_d.argImpl.coeffRef(index)); + } + +protected: + + // this helper permits to completely eliminate the functor if it is empty + struct Data + { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Data(const XprType& xpr) : op(xpr.functor()), argImpl(xpr.nestedExpression()) {} + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + const UnaryOp& func() const { return op; } + UnaryOp op; + evaluator argImpl; + }; + + Data m_d; +}; + +// -------------------- Map -------------------- + +// FIXME perhaps the PlainObjectType could be provided by Derived::PlainObject ? +// but that might complicate template specialization +template +struct mapbase_evaluator; + +template +struct mapbase_evaluator : evaluator_base +{ + typedef Derived XprType; + typedef typename XprType::PointerType PointerType; + typedef typename XprType::Scalar Scalar; + typedef typename XprType::CoeffReturnType CoeffReturnType; + + enum { + IsRowMajor = XprType::RowsAtCompileTime, + ColsAtCompileTime = XprType::ColsAtCompileTime, + CoeffReadCost = NumTraits::ReadCost + }; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit mapbase_evaluator(const XprType& map) + : m_data(const_cast(map.data())), + m_innerStride(map.innerStride()), + m_outerStride(map.outerStride()) + { + EIGEN_STATIC_ASSERT(check_implication((evaluator::Flags & PacketAccessBit) != 0, + internal::inner_stride_at_compile_time::ret == 1), + PACKET_ACCESS_REQUIRES_TO_HAVE_INNER_STRIDE_FIXED_TO_1); + EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index row, Index col) const + { + return m_data[col * colStride() + row * rowStride()]; + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index index) const + { + return m_data[index * m_innerStride.value()]; + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& coeffRef(Index row, Index col) + { + return m_data[col * colStride() + row * rowStride()]; + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& coeffRef(Index index) + { + return m_data[index * m_innerStride.value()]; + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index row, Index col) const + { + PointerType ptr = m_data + row * rowStride() + col * colStride(); + return internal::ploadt(ptr); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index index) const + { + return internal::ploadt(m_data + index * m_innerStride.value()); + } + + template + EIGEN_STRONG_INLINE + void writePacket(Index row, Index col, const PacketType& x) + { + PointerType ptr = m_data + row * rowStride() + col * colStride(); + return internal::pstoret(ptr, x); + } + + template + EIGEN_STRONG_INLINE + void writePacket(Index index, const PacketType& x) + { + internal::pstoret(m_data + index * m_innerStride.value(), x); + } +protected: + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR + Index rowStride() const EIGEN_NOEXCEPT { + return XprType::IsRowMajor ? m_outerStride.value() : m_innerStride.value(); + } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR + Index colStride() const EIGEN_NOEXCEPT { + return XprType::IsRowMajor ? m_innerStride.value() : m_outerStride.value(); + } + + PointerType m_data; + const internal::variable_if_dynamic m_innerStride; + const internal::variable_if_dynamic m_outerStride; +}; + +template +struct evaluator > + : public mapbase_evaluator, PlainObjectType> +{ + typedef Map XprType; + typedef typename XprType::Scalar Scalar; + // TODO: should check for smaller packet types once we can handle multi-sized packet types + typedef typename packet_traits::type PacketScalar; + + enum { + InnerStrideAtCompileTime = StrideType::InnerStrideAtCompileTime == 0 + ? int(PlainObjectType::InnerStrideAtCompileTime) + : int(StrideType::InnerStrideAtCompileTime), + OuterStrideAtCompileTime = StrideType::OuterStrideAtCompileTime == 0 + ? int(PlainObjectType::OuterStrideAtCompileTime) + : int(StrideType::OuterStrideAtCompileTime), + HasNoInnerStride = InnerStrideAtCompileTime == 1, + HasNoOuterStride = StrideType::OuterStrideAtCompileTime == 0, + HasNoStride = HasNoInnerStride && HasNoOuterStride, + IsDynamicSize = PlainObjectType::SizeAtCompileTime==Dynamic, + + PacketAccessMask = bool(HasNoInnerStride) ? ~int(0) : ~int(PacketAccessBit), + LinearAccessMask = bool(HasNoStride) || bool(PlainObjectType::IsVectorAtCompileTime) ? ~int(0) : ~int(LinearAccessBit), + Flags = int( evaluator::Flags) & (LinearAccessMask&PacketAccessMask), + + Alignment = int(MapOptions)&int(AlignedMask) + }; + + EIGEN_DEVICE_FUNC explicit evaluator(const XprType& map) + : mapbase_evaluator(map) + { } +}; + +// -------------------- Ref -------------------- + +template +struct evaluator > + : public mapbase_evaluator, PlainObjectType> +{ + typedef Ref XprType; + + enum { + Flags = evaluator >::Flags, + Alignment = evaluator >::Alignment + }; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit evaluator(const XprType& ref) + : mapbase_evaluator(ref) + { } +}; + +// -------------------- Block -------------------- + +template::ret> struct block_evaluator; + +template +struct evaluator > + : block_evaluator +{ + typedef Block XprType; + typedef typename XprType::Scalar Scalar; + // TODO: should check for smaller packet types once we can handle multi-sized packet types + typedef typename packet_traits::type PacketScalar; + + enum { + CoeffReadCost = evaluator::CoeffReadCost, + + RowsAtCompileTime = traits::RowsAtCompileTime, + ColsAtCompileTime = traits::ColsAtCompileTime, + MaxRowsAtCompileTime = traits::MaxRowsAtCompileTime, + MaxColsAtCompileTime = traits::MaxColsAtCompileTime, + + ArgTypeIsRowMajor = (int(evaluator::Flags)&RowMajorBit) != 0, + IsRowMajor = (MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1) ? 1 + : (MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1) ? 0 + : ArgTypeIsRowMajor, + HasSameStorageOrderAsArgType = (IsRowMajor == ArgTypeIsRowMajor), + InnerSize = IsRowMajor ? int(ColsAtCompileTime) : int(RowsAtCompileTime), + InnerStrideAtCompileTime = HasSameStorageOrderAsArgType + ? int(inner_stride_at_compile_time::ret) + : int(outer_stride_at_compile_time::ret), + OuterStrideAtCompileTime = HasSameStorageOrderAsArgType + ? int(outer_stride_at_compile_time::ret) + : int(inner_stride_at_compile_time::ret), + MaskPacketAccessBit = (InnerStrideAtCompileTime == 1 || HasSameStorageOrderAsArgType) ? PacketAccessBit : 0, + + FlagsLinearAccessBit = (RowsAtCompileTime == 1 || ColsAtCompileTime == 1 || (InnerPanel && (evaluator::Flags&LinearAccessBit))) ? LinearAccessBit : 0, + FlagsRowMajorBit = XprType::Flags&RowMajorBit, + Flags0 = evaluator::Flags & ( (HereditaryBits & ~RowMajorBit) | + DirectAccessBit | + MaskPacketAccessBit), + Flags = Flags0 | FlagsLinearAccessBit | FlagsRowMajorBit, + + PacketAlignment = unpacket_traits::alignment, + Alignment0 = (InnerPanel && (OuterStrideAtCompileTime!=Dynamic) + && (OuterStrideAtCompileTime!=0) + && (((OuterStrideAtCompileTime * int(sizeof(Scalar))) % int(PacketAlignment)) == 0)) ? int(PacketAlignment) : 0, + Alignment = plain_enum_min(evaluator::Alignment, Alignment0) + }; + typedef block_evaluator block_evaluator_type; + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit evaluator(const XprType& block) : block_evaluator_type(block) + { + EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); + } +}; + +// no direct-access => dispatch to a unary evaluator +template +struct block_evaluator + : unary_evaluator > +{ + typedef Block XprType; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit block_evaluator(const XprType& block) + : unary_evaluator(block) + {} +}; + +template +struct unary_evaluator, IndexBased> + : evaluator_base > +{ + typedef Block XprType; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit unary_evaluator(const XprType& block) + : m_argImpl(block.nestedExpression()), + m_startRow(block.startRow()), + m_startCol(block.startCol()), + m_linear_offset(ForwardLinearAccess?(ArgType::IsRowMajor ? block.startRow()*block.nestedExpression().cols() + block.startCol() : block.startCol()*block.nestedExpression().rows() + block.startRow()):0) + { } + + typedef typename XprType::Scalar Scalar; + typedef typename XprType::CoeffReturnType CoeffReturnType; + + enum { + RowsAtCompileTime = XprType::RowsAtCompileTime, + ForwardLinearAccess = (InnerPanel || int(XprType::IsRowMajor)==int(ArgType::IsRowMajor)) && bool(evaluator::Flags&LinearAccessBit) + }; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index row, Index col) const + { + return m_argImpl.coeff(m_startRow.value() + row, m_startCol.value() + col); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index index) const + { + return linear_coeff_impl(index, bool_constant()); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& coeffRef(Index row, Index col) + { + return m_argImpl.coeffRef(m_startRow.value() + row, m_startCol.value() + col); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& coeffRef(Index index) + { + return linear_coeffRef_impl(index, bool_constant()); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index row, Index col) const + { + return m_argImpl.template packet(m_startRow.value() + row, m_startCol.value() + col); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index index) const + { + if (ForwardLinearAccess) + return m_argImpl.template packet(m_linear_offset.value() + index); + else + return packet(RowsAtCompileTime == 1 ? 0 : index, + RowsAtCompileTime == 1 ? index : 0); + } + + template + EIGEN_STRONG_INLINE + void writePacket(Index row, Index col, const PacketType& x) + { + return m_argImpl.template writePacket(m_startRow.value() + row, m_startCol.value() + col, x); + } + + template + EIGEN_STRONG_INLINE + void writePacket(Index index, const PacketType& x) + { + if (ForwardLinearAccess) + return m_argImpl.template writePacket(m_linear_offset.value() + index, x); + else + return writePacket(RowsAtCompileTime == 1 ? 0 : index, + RowsAtCompileTime == 1 ? index : 0, + x); + } + +protected: + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType linear_coeff_impl(Index index, internal::true_type /* ForwardLinearAccess */) const + { + return m_argImpl.coeff(m_linear_offset.value() + index); + } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType linear_coeff_impl(Index index, internal::false_type /* not ForwardLinearAccess */) const + { + return coeff(RowsAtCompileTime == 1 ? 0 : index, RowsAtCompileTime == 1 ? index : 0); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& linear_coeffRef_impl(Index index, internal::true_type /* ForwardLinearAccess */) + { + return m_argImpl.coeffRef(m_linear_offset.value() + index); + } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& linear_coeffRef_impl(Index index, internal::false_type /* not ForwardLinearAccess */) + { + return coeffRef(RowsAtCompileTime == 1 ? 0 : index, RowsAtCompileTime == 1 ? index : 0); + } + + evaluator m_argImpl; + const variable_if_dynamic m_startRow; + const variable_if_dynamic m_startCol; + const variable_if_dynamic m_linear_offset; +}; + +// TODO: This evaluator does not actually use the child evaluator; +// all action is via the data() as returned by the Block expression. + +template +struct block_evaluator + : mapbase_evaluator, + typename Block::PlainObject> +{ + typedef Block XprType; + typedef typename XprType::Scalar Scalar; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit block_evaluator(const XprType& block) + : mapbase_evaluator(block) + { + eigen_internal_assert((internal::is_constant_evaluated() || (std::uintptr_t(block.data()) % plain_enum_max(1,evaluator::Alignment)) == 0) \ + && "data is not aligned"); + } +}; + + +// -------------------- Select -------------------- +// NOTE shall we introduce a ternary_evaluator? + +// TODO enable vectorization for Select +template +struct evaluator > + : evaluator_base > +{ + typedef Select XprType; + enum { + CoeffReadCost = evaluator::CoeffReadCost + + plain_enum_max(evaluator::CoeffReadCost, + evaluator::CoeffReadCost), + + Flags = (unsigned int)evaluator::Flags & evaluator::Flags & HereditaryBits, + + Alignment = plain_enum_min(evaluator::Alignment, evaluator::Alignment) + }; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit evaluator(const XprType& select) + : m_conditionImpl(select.conditionMatrix()), + m_thenImpl(select.thenMatrix()), + m_elseImpl(select.elseMatrix()) + { + EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); + } + + typedef typename XprType::CoeffReturnType CoeffReturnType; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index row, Index col) const + { + if (m_conditionImpl.coeff(row, col)) + return m_thenImpl.coeff(row, col); + else + return m_elseImpl.coeff(row, col); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index index) const + { + if (m_conditionImpl.coeff(index)) + return m_thenImpl.coeff(index); + else + return m_elseImpl.coeff(index); + } + +protected: + evaluator m_conditionImpl; + evaluator m_thenImpl; + evaluator m_elseImpl; +}; + + +// -------------------- Replicate -------------------- + +template +struct unary_evaluator > + : evaluator_base > +{ + typedef Replicate XprType; + typedef typename XprType::CoeffReturnType CoeffReturnType; + enum { + Factor = (RowFactor==Dynamic || ColFactor==Dynamic) ? Dynamic : RowFactor*ColFactor + }; + typedef typename internal::nested_eval::type ArgTypeNested; + typedef internal::remove_all_t ArgTypeNestedCleaned; + + enum { + CoeffReadCost = evaluator::CoeffReadCost, + LinearAccessMask = XprType::IsVectorAtCompileTime ? LinearAccessBit : 0, + Flags = (evaluator::Flags & (HereditaryBits|LinearAccessMask) & ~RowMajorBit) | (traits::Flags & RowMajorBit), + + Alignment = evaluator::Alignment + }; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit unary_evaluator(const XprType& replicate) + : m_arg(replicate.nestedExpression()), + m_argImpl(m_arg), + m_rows(replicate.nestedExpression().rows()), + m_cols(replicate.nestedExpression().cols()) + {} + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index row, Index col) const + { + // try to avoid using modulo; this is a pure optimization strategy + const Index actual_row = internal::traits::RowsAtCompileTime==1 ? 0 + : RowFactor==1 ? row + : row % m_rows.value(); + const Index actual_col = internal::traits::ColsAtCompileTime==1 ? 0 + : ColFactor==1 ? col + : col % m_cols.value(); + + return m_argImpl.coeff(actual_row, actual_col); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index index) const + { + // try to avoid using modulo; this is a pure optimization strategy + const Index actual_index = internal::traits::RowsAtCompileTime==1 + ? (ColFactor==1 ? index : index%m_cols.value()) + : (RowFactor==1 ? index : index%m_rows.value()); + + return m_argImpl.coeff(actual_index); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index row, Index col) const + { + const Index actual_row = internal::traits::RowsAtCompileTime==1 ? 0 + : RowFactor==1 ? row + : row % m_rows.value(); + const Index actual_col = internal::traits::ColsAtCompileTime==1 ? 0 + : ColFactor==1 ? col + : col % m_cols.value(); + + return m_argImpl.template packet(actual_row, actual_col); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index index) const + { + const Index actual_index = internal::traits::RowsAtCompileTime==1 + ? (ColFactor==1 ? index : index%m_cols.value()) + : (RowFactor==1 ? index : index%m_rows.value()); + + return m_argImpl.template packet(actual_index); + } + +protected: + const ArgTypeNested m_arg; + evaluator m_argImpl; + const variable_if_dynamic m_rows; + const variable_if_dynamic m_cols; +}; + +// -------------------- MatrixWrapper and ArrayWrapper -------------------- +// +// evaluator_wrapper_base is a common base class for the +// MatrixWrapper and ArrayWrapper evaluators. + +template +struct evaluator_wrapper_base + : evaluator_base +{ + typedef remove_all_t ArgType; + enum { + CoeffReadCost = evaluator::CoeffReadCost, + Flags = evaluator::Flags, + Alignment = evaluator::Alignment + }; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit evaluator_wrapper_base(const ArgType& arg) : m_argImpl(arg) {} + + typedef typename ArgType::Scalar Scalar; + typedef typename ArgType::CoeffReturnType CoeffReturnType; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index row, Index col) const + { + return m_argImpl.coeff(row, col); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index index) const + { + return m_argImpl.coeff(index); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& coeffRef(Index row, Index col) + { + return m_argImpl.coeffRef(row, col); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& coeffRef(Index index) + { + return m_argImpl.coeffRef(index); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index row, Index col) const + { + return m_argImpl.template packet(row, col); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index index) const + { + return m_argImpl.template packet(index); + } + + template + EIGEN_STRONG_INLINE + void writePacket(Index row, Index col, const PacketType& x) + { + m_argImpl.template writePacket(row, col, x); + } + + template + EIGEN_STRONG_INLINE + void writePacket(Index index, const PacketType& x) + { + m_argImpl.template writePacket(index, x); + } + +protected: + evaluator m_argImpl; +}; + +template +struct unary_evaluator > + : evaluator_wrapper_base > +{ + typedef MatrixWrapper XprType; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit unary_evaluator(const XprType& wrapper) + : evaluator_wrapper_base >(wrapper.nestedExpression()) + { } +}; + +template +struct unary_evaluator > + : evaluator_wrapper_base > +{ + typedef ArrayWrapper XprType; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit unary_evaluator(const XprType& wrapper) + : evaluator_wrapper_base >(wrapper.nestedExpression()) + { } +}; + + +// -------------------- Reverse -------------------- + +// defined in Reverse.h: +template struct reverse_packet_cond; + +template +struct unary_evaluator > + : evaluator_base > +{ + typedef Reverse XprType; + typedef typename XprType::Scalar Scalar; + typedef typename XprType::CoeffReturnType CoeffReturnType; + + enum { + IsRowMajor = XprType::IsRowMajor, + IsColMajor = !IsRowMajor, + ReverseRow = (Direction == Vertical) || (Direction == BothDirections), + ReverseCol = (Direction == Horizontal) || (Direction == BothDirections), + ReversePacket = (Direction == BothDirections) + || ((Direction == Vertical) && IsColMajor) + || ((Direction == Horizontal) && IsRowMajor), + + CoeffReadCost = evaluator::CoeffReadCost, + + // let's enable LinearAccess only with vectorization because of the product overhead + // FIXME enable DirectAccess with negative strides? + Flags0 = evaluator::Flags, + LinearAccess = ( (Direction==BothDirections) && (int(Flags0)&PacketAccessBit) ) + || ((ReverseRow && XprType::ColsAtCompileTime==1) || (ReverseCol && XprType::RowsAtCompileTime==1)) + ? LinearAccessBit : 0, + + Flags = int(Flags0) & (HereditaryBits | PacketAccessBit | LinearAccess), + + Alignment = 0 // FIXME in some rare cases, Alignment could be preserved, like a Vector4f. + }; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit unary_evaluator(const XprType& reverse) + : m_argImpl(reverse.nestedExpression()), + m_rows(ReverseRow ? reverse.nestedExpression().rows() : 1), + m_cols(ReverseCol ? reverse.nestedExpression().cols() : 1) + { } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index row, Index col) const + { + return m_argImpl.coeff(ReverseRow ? m_rows.value() - row - 1 : row, + ReverseCol ? m_cols.value() - col - 1 : col); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index index) const + { + return m_argImpl.coeff(m_rows.value() * m_cols.value() - index - 1); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& coeffRef(Index row, Index col) + { + return m_argImpl.coeffRef(ReverseRow ? m_rows.value() - row - 1 : row, + ReverseCol ? m_cols.value() - col - 1 : col); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& coeffRef(Index index) + { + return m_argImpl.coeffRef(m_rows.value() * m_cols.value() - index - 1); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index row, Index col) const + { + enum { + PacketSize = unpacket_traits::size, + OffsetRow = ReverseRow && IsColMajor ? PacketSize : 1, + OffsetCol = ReverseCol && IsRowMajor ? PacketSize : 1 + }; + typedef internal::reverse_packet_cond reverse_packet; + return reverse_packet::run(m_argImpl.template packet( + ReverseRow ? m_rows.value() - row - OffsetRow : row, + ReverseCol ? m_cols.value() - col - OffsetCol : col)); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index index) const + { + enum { PacketSize = unpacket_traits::size }; + return preverse(m_argImpl.template packet(m_rows.value() * m_cols.value() - index - PacketSize)); + } + + template + EIGEN_STRONG_INLINE + void writePacket(Index row, Index col, const PacketType& x) + { + // FIXME we could factorize some code with packet(i,j) + enum { + PacketSize = unpacket_traits::size, + OffsetRow = ReverseRow && IsColMajor ? PacketSize : 1, + OffsetCol = ReverseCol && IsRowMajor ? PacketSize : 1 + }; + typedef internal::reverse_packet_cond reverse_packet; + m_argImpl.template writePacket( + ReverseRow ? m_rows.value() - row - OffsetRow : row, + ReverseCol ? m_cols.value() - col - OffsetCol : col, + reverse_packet::run(x)); + } + + template + EIGEN_STRONG_INLINE + void writePacket(Index index, const PacketType& x) + { + enum { PacketSize = unpacket_traits::size }; + m_argImpl.template writePacket + (m_rows.value() * m_cols.value() - index - PacketSize, preverse(x)); + } + +protected: + evaluator m_argImpl; + + // If we do not reverse rows, then we do not need to know the number of rows; same for columns + // Nonetheless, in this case it is important to set to 1 such that the coeff(index) method works fine for vectors. + const variable_if_dynamic m_rows; + const variable_if_dynamic m_cols; +}; + + +// -------------------- Diagonal -------------------- + +template +struct evaluator > + : evaluator_base > +{ + typedef Diagonal XprType; + + enum { + CoeffReadCost = evaluator::CoeffReadCost, + + Flags = (unsigned int)(evaluator::Flags & (HereditaryBits | DirectAccessBit) & ~RowMajorBit) | LinearAccessBit, + + Alignment = 0 + }; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit evaluator(const XprType& diagonal) + : m_argImpl(diagonal.nestedExpression()), + m_index(diagonal.index()) + { } + + typedef typename XprType::Scalar Scalar; + typedef typename XprType::CoeffReturnType CoeffReturnType; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index row, Index) const + { + return m_argImpl.coeff(row + rowOffset(), row + colOffset()); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index index) const + { + return m_argImpl.coeff(index + rowOffset(), index + colOffset()); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& coeffRef(Index row, Index) + { + return m_argImpl.coeffRef(row + rowOffset(), row + colOffset()); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& coeffRef(Index index) + { + return m_argImpl.coeffRef(index + rowOffset(), index + colOffset()); + } + +protected: + evaluator m_argImpl; + const internal::variable_if_dynamicindex m_index; + +private: + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR + Index rowOffset() const { return m_index.value() > 0 ? 0 : -m_index.value(); } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR + Index colOffset() const { return m_index.value() > 0 ? m_index.value() : 0; } +}; + + +//---------------------------------------------------------------------- +// deprecated code +//---------------------------------------------------------------------- + +// -------------------- EvalToTemp -------------------- + +// expression class for evaluating nested expression to a temporary + +template class EvalToTemp; + +template +struct traits > + : public traits +{ }; + +template +class EvalToTemp + : public dense_xpr_base >::type +{ + public: + + typedef typename dense_xpr_base::type Base; + EIGEN_GENERIC_PUBLIC_INTERFACE(EvalToTemp) + + explicit EvalToTemp(const ArgType& arg) + : m_arg(arg) + { } + + const ArgType& arg() const + { + return m_arg; + } + + EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT + { + return m_arg.rows(); + } + + EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT + { + return m_arg.cols(); + } + + private: + const ArgType& m_arg; +}; + +template +struct evaluator > + : public evaluator +{ + typedef EvalToTemp XprType; + typedef typename ArgType::PlainObject PlainObject; + typedef evaluator Base; + + EIGEN_DEVICE_FUNC explicit evaluator(const XprType& xpr) + : m_result(xpr.arg()) + { + internal::construct_at(this, m_result); + } + + // This constructor is used when nesting an EvalTo evaluator in another evaluator + EIGEN_DEVICE_FUNC evaluator(const ArgType& arg) + : m_result(arg) + { + internal::construct_at(this, m_result); + } + +protected: + PlainObject m_result; +}; + +} // namespace internal + +} // end namespace Eigen + +#endif // EIGEN_COREEVALUATORS_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/CoreIterators.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/CoreIterators.h new file mode 100644 index 0000000000000000000000000000000000000000..f74568a174f85c582f2ae9d654fb30ee053ed4b3 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/CoreIterators.h @@ -0,0 +1,134 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008-2014 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_COREITERATORS_H +#define EIGEN_COREITERATORS_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +/* This file contains the respective InnerIterator definition of the expressions defined in Eigen/Core + */ + +namespace internal { + +template +class inner_iterator_selector; + +} + +/** \class InnerIterator + * \brief An InnerIterator allows to loop over the element of any matrix expression. + * + * \warning To be used with care because an evaluator is constructed every time an InnerIterator iterator is constructed. + * + * TODO: add a usage example + */ +template +class InnerIterator +{ +protected: + typedef internal::inner_iterator_selector::Kind> IteratorType; + typedef internal::evaluator EvaluatorType; + typedef typename internal::traits::Scalar Scalar; +public: + /** Construct an iterator over the \a outerId -th row or column of \a xpr */ + InnerIterator(const XprType &xpr, const Index &outerId) + : m_eval(xpr), m_iter(m_eval, outerId, xpr.innerSize()) + {} + + /// \returns the value of the current coefficient. + EIGEN_STRONG_INLINE Scalar value() const { return m_iter.value(); } + /** Increment the iterator \c *this to the next non-zero coefficient. + * Explicit zeros are not skipped over. To skip explicit zeros, see class SparseView + */ + EIGEN_STRONG_INLINE InnerIterator& operator++() { m_iter.operator++(); return *this; } + EIGEN_STRONG_INLINE InnerIterator& operator+=(Index i) { m_iter.operator+=(i); return *this; } + EIGEN_STRONG_INLINE InnerIterator operator+(Index i) + { InnerIterator result(*this); result+=i; return result; } + + + /// \returns the column or row index of the current coefficient. + EIGEN_STRONG_INLINE Index index() const { return m_iter.index(); } + /// \returns the row index of the current coefficient. + EIGEN_STRONG_INLINE Index row() const { return m_iter.row(); } + /// \returns the column index of the current coefficient. + EIGEN_STRONG_INLINE Index col() const { return m_iter.col(); } + /// \returns \c true if the iterator \c *this still references a valid coefficient. + EIGEN_STRONG_INLINE operator bool() const { return m_iter; } + +protected: + EvaluatorType m_eval; + IteratorType m_iter; +private: + // If you get here, then you're not using the right InnerIterator type, e.g.: + // SparseMatrix A; + // SparseMatrix::InnerIterator it(A,0); + template InnerIterator(const EigenBase&,Index outer); +}; + +namespace internal { + +// Generic inner iterator implementation for dense objects +template +class inner_iterator_selector +{ +protected: + typedef evaluator EvaluatorType; + typedef typename traits::Scalar Scalar; + enum { IsRowMajor = (XprType::Flags&RowMajorBit)==RowMajorBit }; + +public: + EIGEN_STRONG_INLINE inner_iterator_selector(const EvaluatorType &eval, const Index &outerId, const Index &innerSize) + : m_eval(eval), m_inner(0), m_outer(outerId), m_end(innerSize) + {} + + EIGEN_STRONG_INLINE Scalar value() const + { + return (IsRowMajor) ? m_eval.coeff(m_outer, m_inner) + : m_eval.coeff(m_inner, m_outer); + } + + EIGEN_STRONG_INLINE inner_iterator_selector& operator++() { m_inner++; return *this; } + + EIGEN_STRONG_INLINE Index index() const { return m_inner; } + inline Index row() const { return IsRowMajor ? m_outer : index(); } + inline Index col() const { return IsRowMajor ? index() : m_outer; } + + EIGEN_STRONG_INLINE operator bool() const { return m_inner < m_end && m_inner>=0; } + +protected: + const EvaluatorType& m_eval; + Index m_inner; + const Index m_outer; + const Index m_end; +}; + +// For iterator-based evaluator, inner-iterator is already implemented as +// evaluator<>::InnerIterator +template +class inner_iterator_selector + : public evaluator::InnerIterator +{ +protected: + typedef typename evaluator::InnerIterator Base; + typedef evaluator EvaluatorType; + +public: + EIGEN_STRONG_INLINE inner_iterator_selector(const EvaluatorType &eval, const Index &outerId, const Index &/*innerSize*/) + : Base(eval, outerId) + {} +}; + +} // end namespace internal + +} // end namespace Eigen + +#endif // EIGEN_COREITERATORS_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/CwiseBinaryOp.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/CwiseBinaryOp.h new file mode 100644 index 0000000000000000000000000000000000000000..21a061a00da8f45e8219fcb7c9f142dc22b0b1bb --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/CwiseBinaryOp.h @@ -0,0 +1,185 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008-2014 Gael Guennebaud +// Copyright (C) 2006-2008 Benoit Jacob +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_CWISE_BINARY_OP_H +#define EIGEN_CWISE_BINARY_OP_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { +template +struct traits > +{ + // we must not inherit from traits since it has + // the potential to cause problems with MSVC + typedef remove_all_t Ancestor; + typedef typename traits::XprKind XprKind; + enum { + RowsAtCompileTime = traits::RowsAtCompileTime, + ColsAtCompileTime = traits::ColsAtCompileTime, + MaxRowsAtCompileTime = traits::MaxRowsAtCompileTime, + MaxColsAtCompileTime = traits::MaxColsAtCompileTime + }; + + // even though we require Lhs and Rhs to have the same scalar type (see CwiseBinaryOp constructor), + // we still want to handle the case when the result type is different. + typedef typename result_of< + BinaryOp( + const typename Lhs::Scalar&, + const typename Rhs::Scalar& + ) + >::type Scalar; + typedef typename cwise_promote_storage_type::StorageKind, + typename traits::StorageKind, + BinaryOp>::ret StorageKind; + typedef typename promote_index_type::StorageIndex, + typename traits::StorageIndex>::type StorageIndex; + typedef typename Lhs::Nested LhsNested; + typedef typename Rhs::Nested RhsNested; + typedef std::remove_reference_t LhsNested_; + typedef std::remove_reference_t RhsNested_; + enum { + Flags = cwise_promote_storage_order::StorageKind,typename traits::StorageKind,LhsNested_::Flags & RowMajorBit,RhsNested_::Flags & RowMajorBit>::value + }; +}; +} // end namespace internal + +template +class CwiseBinaryOpImpl; + +/** \class CwiseBinaryOp + * \ingroup Core_Module + * + * \brief Generic expression where a coefficient-wise binary operator is applied to two expressions + * + * \tparam BinaryOp template functor implementing the operator + * \tparam LhsType the type of the left-hand side + * \tparam RhsType the type of the right-hand side + * + * This class represents an expression where a coefficient-wise binary operator is applied to two expressions. + * It is the return type of binary operators, by which we mean only those binary operators where + * both the left-hand side and the right-hand side are Eigen expressions. + * For example, the return type of matrix1+matrix2 is a CwiseBinaryOp. + * + * Most of the time, this is the only way that it is used, so you typically don't have to name + * CwiseBinaryOp types explicitly. + * + * \sa MatrixBase::binaryExpr(const MatrixBase &,const CustomBinaryOp &) const, class CwiseUnaryOp, class CwiseNullaryOp + */ +template +class CwiseBinaryOp : + public CwiseBinaryOpImpl< + BinaryOp, LhsType, RhsType, + typename internal::cwise_promote_storage_type::StorageKind, + typename internal::traits::StorageKind, + BinaryOp>::ret>, + internal::no_assignment_operator +{ + public: + + typedef internal::remove_all_t Functor; + typedef internal::remove_all_t Lhs; + typedef internal::remove_all_t Rhs; + + typedef typename CwiseBinaryOpImpl< + BinaryOp, LhsType, RhsType, + typename internal::cwise_promote_storage_type::StorageKind, + typename internal::traits::StorageKind, + BinaryOp>::ret>::Base Base; + EIGEN_GENERIC_PUBLIC_INTERFACE(CwiseBinaryOp) + + EIGEN_CHECK_BINARY_COMPATIBILIY(BinaryOp,typename Lhs::Scalar,typename Rhs::Scalar) + EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Lhs, Rhs) + + typedef typename internal::ref_selector::type LhsNested; + typedef typename internal::ref_selector::type RhsNested; + typedef std::remove_reference_t LhsNested_; + typedef std::remove_reference_t RhsNested_; + +#if EIGEN_COMP_MSVC + //Required for Visual Studio or the Copy constructor will probably not get inlined! + EIGEN_STRONG_INLINE + CwiseBinaryOp(const CwiseBinaryOp&) = default; +#endif + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CwiseBinaryOp(const Lhs& aLhs, const Rhs& aRhs, const BinaryOp& func = BinaryOp()) + : m_lhs(aLhs), m_rhs(aRhs), m_functor(func) + { + eigen_assert(aLhs.rows() == aRhs.rows() && aLhs.cols() == aRhs.cols()); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR + Index rows() const EIGEN_NOEXCEPT { + // return the fixed size type if available to enable compile time optimizations + return internal::traits>::RowsAtCompileTime==Dynamic ? m_rhs.rows() : m_lhs.rows(); + } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR + Index cols() const EIGEN_NOEXCEPT { + // return the fixed size type if available to enable compile time optimizations + return internal::traits>::ColsAtCompileTime==Dynamic ? m_rhs.cols() : m_lhs.cols(); + } + + /** \returns the left hand side nested expression */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + const LhsNested_& lhs() const { return m_lhs; } + /** \returns the right hand side nested expression */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + const RhsNested_& rhs() const { return m_rhs; } + /** \returns the functor representing the binary operation */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + const BinaryOp& functor() const { return m_functor; } + + protected: + LhsNested m_lhs; + RhsNested m_rhs; + const BinaryOp m_functor; +}; + +// Generic API dispatcher +template +class CwiseBinaryOpImpl + : public internal::generic_xpr_base >::type +{ +public: + typedef typename internal::generic_xpr_base >::type Base; +}; + +/** replaces \c *this by \c *this - \a other. + * + * \returns a reference to \c *this + */ +template +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & +MatrixBase::operator-=(const MatrixBase &other) +{ + call_assignment(derived(), other.derived(), internal::sub_assign_op()); + return derived(); +} + +/** replaces \c *this by \c *this + \a other. + * + * \returns a reference to \c *this + */ +template +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & +MatrixBase::operator+=(const MatrixBase& other) +{ + call_assignment(derived(), other.derived(), internal::add_assign_op()); + return derived(); +} + +} // end namespace Eigen + +#endif // EIGEN_CWISE_BINARY_OP_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/CwiseNullaryOp.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/CwiseNullaryOp.h new file mode 100644 index 0000000000000000000000000000000000000000..b33c052c3f12e19e0c6734d2e62829f43be1ac03 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/CwiseNullaryOp.h @@ -0,0 +1,1030 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008-2010 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_CWISE_NULLARY_OP_H +#define EIGEN_CWISE_NULLARY_OP_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { +template +struct traits > : traits +{ + enum { + Flags = traits::Flags & RowMajorBit + }; +}; + +} // namespace internal + +/** \class CwiseNullaryOp + * \ingroup Core_Module + * + * \brief Generic expression of a matrix where all coefficients are defined by a functor + * + * \tparam NullaryOp template functor implementing the operator + * \tparam PlainObjectType the underlying plain matrix/array type + * + * This class represents an expression of a generic nullary operator. + * It is the return type of the Ones(), Zero(), Constant(), Identity() and Random() methods, + * and most of the time this is the only way it is used. + * + * However, if you want to write a function returning such an expression, you + * will need to use this class. + * + * The functor NullaryOp must expose one of the following method: + + + + +
\c operator()() if the procedural generation does not depend on the coefficient entries (e.g., random numbers)
\c operator()(Index i)if the procedural generation makes sense for vectors only and that it depends on the coefficient index \c i (e.g., linspace)
\c operator()(Index i,Index j)if the procedural generation depends on the matrix coordinates \c i, \c j (e.g., to generate a checkerboard with 0 and 1)
+ * It is also possible to expose the last two operators if the generation makes sense for matrices but can be optimized for vectors. + * + * See DenseBase::NullaryExpr(Index,const CustomNullaryOp&) for an example binding + * C++11 random number generators. + * + * A nullary expression can also be used to implement custom sophisticated matrix manipulations + * that cannot be covered by the existing set of natively supported matrix manipulations. + * See this \ref TopicCustomizing_NullaryExpr "page" for some examples and additional explanations + * on the behavior of CwiseNullaryOp. + * + * \sa class CwiseUnaryOp, class CwiseBinaryOp, DenseBase::NullaryExpr + */ +template +class CwiseNullaryOp : public internal::dense_xpr_base< CwiseNullaryOp >::type, internal::no_assignment_operator +{ + public: + + typedef typename internal::dense_xpr_base::type Base; + EIGEN_DENSE_PUBLIC_INTERFACE(CwiseNullaryOp) + + EIGEN_DEVICE_FUNC + CwiseNullaryOp(Index rows, Index cols, const NullaryOp& func = NullaryOp()) + : m_rows(rows), m_cols(cols), m_functor(func) + { + eigen_assert(rows >= 0 + && (RowsAtCompileTime == Dynamic || RowsAtCompileTime == rows) + && cols >= 0 + && (ColsAtCompileTime == Dynamic || ColsAtCompileTime == cols)); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR + Index rows() const { return m_rows.value(); } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR + Index cols() const { return m_cols.value(); } + + /** \returns the functor representing the nullary operation */ + EIGEN_DEVICE_FUNC + const NullaryOp& functor() const { return m_functor; } + + protected: + const internal::variable_if_dynamic m_rows; + const internal::variable_if_dynamic m_cols; + const NullaryOp m_functor; +}; + + +/** \returns an expression of a matrix defined by a custom functor \a func + * + * The parameters \a rows and \a cols are the number of rows and of columns of + * the returned matrix. Must be compatible with this MatrixBase type. + * + * This variant is meant to be used for dynamic-size matrix types. For fixed-size types, + * it is redundant to pass \a rows and \a cols as arguments, so Zero() should be used + * instead. + * + * The template parameter \a CustomNullaryOp is the type of the functor. + * + * \sa class CwiseNullaryOp + */ +template +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE +#ifndef EIGEN_PARSED_BY_DOXYGEN +const CwiseNullaryOp::PlainObject> +#else +const CwiseNullaryOp +#endif +DenseBase::NullaryExpr(Index rows, Index cols, const CustomNullaryOp& func) +{ + return CwiseNullaryOp(rows, cols, func); +} + +/** \returns an expression of a matrix defined by a custom functor \a func + * + * The parameter \a size is the size of the returned vector. + * Must be compatible with this MatrixBase type. + * + * \only_for_vectors + * + * This variant is meant to be used for dynamic-size vector types. For fixed-size types, + * it is redundant to pass \a size as argument, so Zero() should be used + * instead. + * + * The template parameter \a CustomNullaryOp is the type of the functor. + * + * Here is an example with C++11 random generators: \include random_cpp11.cpp + * Output: \verbinclude random_cpp11.out + * + * \sa class CwiseNullaryOp + */ +template +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE +#ifndef EIGEN_PARSED_BY_DOXYGEN +const CwiseNullaryOp::PlainObject> +#else +const CwiseNullaryOp +#endif +DenseBase::NullaryExpr(Index size, const CustomNullaryOp& func) +{ + EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) + if(RowsAtCompileTime == 1) return CwiseNullaryOp(1, size, func); + else return CwiseNullaryOp(size, 1, func); +} + +/** \returns an expression of a matrix defined by a custom functor \a func + * + * This variant is only for fixed-size DenseBase types. For dynamic-size types, you + * need to use the variants taking size arguments. + * + * The template parameter \a CustomNullaryOp is the type of the functor. + * + * \sa class CwiseNullaryOp + */ +template +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE +#ifndef EIGEN_PARSED_BY_DOXYGEN +const CwiseNullaryOp::PlainObject> +#else +const CwiseNullaryOp +#endif +DenseBase::NullaryExpr(const CustomNullaryOp& func) +{ + return CwiseNullaryOp(RowsAtCompileTime, ColsAtCompileTime, func); +} + +/** \returns an expression of a constant matrix of value \a value + * + * The parameters \a rows and \a cols are the number of rows and of columns of + * the returned matrix. Must be compatible with this DenseBase type. + * + * This variant is meant to be used for dynamic-size matrix types. For fixed-size types, + * it is redundant to pass \a rows and \a cols as arguments, so Zero() should be used + * instead. + * + * The template parameter \a CustomNullaryOp is the type of the functor. + * + * \sa class CwiseNullaryOp + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase::ConstantReturnType +DenseBase::Constant(Index rows, Index cols, const Scalar& value) +{ + return DenseBase::NullaryExpr(rows, cols, internal::scalar_constant_op(value)); +} + +/** \returns an expression of a constant matrix of value \a value + * + * The parameter \a size is the size of the returned vector. + * Must be compatible with this DenseBase type. + * + * \only_for_vectors + * + * This variant is meant to be used for dynamic-size vector types. For fixed-size types, + * it is redundant to pass \a size as argument, so Zero() should be used + * instead. + * + * The template parameter \a CustomNullaryOp is the type of the functor. + * + * \sa class CwiseNullaryOp + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase::ConstantReturnType +DenseBase::Constant(Index size, const Scalar& value) +{ + return DenseBase::NullaryExpr(size, internal::scalar_constant_op(value)); +} + +/** \returns an expression of a constant matrix of value \a value + * + * This variant is only for fixed-size DenseBase types. For dynamic-size types, you + * need to use the variants taking size arguments. + * + * The template parameter \a CustomNullaryOp is the type of the functor. + * + * \sa class CwiseNullaryOp + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase::ConstantReturnType +DenseBase::Constant(const Scalar& value) +{ + EIGEN_STATIC_ASSERT_FIXED_SIZE(Derived) + return DenseBase::NullaryExpr(RowsAtCompileTime, ColsAtCompileTime, internal::scalar_constant_op(value)); +} + +/** \deprecated because of accuracy loss. In Eigen 3.3, it is an alias for LinSpaced(Index,const Scalar&,const Scalar&) + * + * \only_for_vectors + * + * Example: \include DenseBase_LinSpaced_seq_deprecated.cpp + * Output: \verbinclude DenseBase_LinSpaced_seq_deprecated.out + * + * \sa LinSpaced(Index,const Scalar&, const Scalar&), setLinSpaced(Index,const Scalar&,const Scalar&) + */ +template +EIGEN_DEPRECATED EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase::RandomAccessLinSpacedReturnType +DenseBase::LinSpaced(Sequential_t, Index size, const Scalar& low, const Scalar& high) +{ + EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) + return DenseBase::NullaryExpr(size, internal::linspaced_op(low,high,size)); +} + +/** \deprecated because of accuracy loss. In Eigen 3.3, it is an alias for LinSpaced(const Scalar&,const Scalar&) + * + * \sa LinSpaced(const Scalar&, const Scalar&) + */ +template +EIGEN_DEPRECATED EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase::RandomAccessLinSpacedReturnType +DenseBase::LinSpaced(Sequential_t, const Scalar& low, const Scalar& high) +{ + EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) + EIGEN_STATIC_ASSERT_FIXED_SIZE(Derived) + return DenseBase::NullaryExpr(Derived::SizeAtCompileTime, internal::linspaced_op(low,high,Derived::SizeAtCompileTime)); +} + +/** + * \brief Sets a linearly spaced vector. + * + * The function generates 'size' equally spaced values in the closed interval [low,high]. + * When size is set to 1, a vector of length 1 containing 'high' is returned. + * + * \only_for_vectors + * + * Example: \include DenseBase_LinSpaced.cpp + * Output: \verbinclude DenseBase_LinSpaced.out + * + * For integer scalar types, an even spacing is possible if and only if the length of the range, + * i.e., \c high-low is a scalar multiple of \c size-1, or if \c size is a scalar multiple of the + * number of values \c high-low+1 (meaning each value can be repeated the same number of time). + * If one of these two considions is not satisfied, then \c high is lowered to the largest value + * satisfying one of this constraint. + * Here are some examples: + * + * Example: \include DenseBase_LinSpacedInt.cpp + * Output: \verbinclude DenseBase_LinSpacedInt.out + * + * \sa setLinSpaced(Index,const Scalar&,const Scalar&), CwiseNullaryOp + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase::RandomAccessLinSpacedReturnType +DenseBase::LinSpaced(Index size, const Scalar& low, const Scalar& high) +{ + EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) + return DenseBase::NullaryExpr(size, internal::linspaced_op(low,high,size)); +} + +/** + * \copydoc DenseBase::LinSpaced(Index, const Scalar&, const Scalar&) + * Special version for fixed size types which does not require the size parameter. + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase::RandomAccessLinSpacedReturnType +DenseBase::LinSpaced(const Scalar& low, const Scalar& high) +{ + EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) + EIGEN_STATIC_ASSERT_FIXED_SIZE(Derived) + return DenseBase::NullaryExpr(Derived::SizeAtCompileTime, internal::linspaced_op(low,high,Derived::SizeAtCompileTime)); +} + +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase::RandomAccessEqualSpacedReturnType +DenseBase::EqualSpaced(Index size, const Scalar& low, const Scalar& step) { + EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) + return DenseBase::NullaryExpr(size, internal::equalspaced_op(low, step)); +} + +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase::RandomAccessEqualSpacedReturnType +DenseBase::EqualSpaced(const Scalar& low, const Scalar& step) { + EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) + return DenseBase::NullaryExpr(Derived::SizeAtCompileTime, internal::equalspaced_op(low, step)); +} + +/** \returns true if all coefficients in this matrix are approximately equal to \a val, to within precision \a prec */ +template +EIGEN_DEVICE_FUNC bool DenseBase::isApproxToConstant +(const Scalar& val, const RealScalar& prec) const +{ + typename internal::nested_eval::type self(derived()); + for(Index j = 0; j < cols(); ++j) + for(Index i = 0; i < rows(); ++i) + if(!internal::isApprox(self.coeff(i, j), val, prec)) + return false; + return true; +} + +/** This is just an alias for isApproxToConstant(). + * + * \returns true if all coefficients in this matrix are approximately equal to \a value, to within precision \a prec */ +template +EIGEN_DEVICE_FUNC bool DenseBase::isConstant +(const Scalar& val, const RealScalar& prec) const +{ + return isApproxToConstant(val, prec); +} + +/** Alias for setConstant(): sets all coefficients in this expression to \a val. + * + * \sa setConstant(), Constant(), class CwiseNullaryOp + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void DenseBase::fill(const Scalar& val) +{ + setConstant(val); +} + +/** Sets all coefficients in this expression to value \a val. + * + * \sa fill(), setConstant(Index,const Scalar&), setConstant(Index,Index,const Scalar&), setZero(), setOnes(), Constant(), class CwiseNullaryOp, setZero(), setOnes() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase::setConstant(const Scalar& val) +{ + return derived() = Constant(rows(), cols(), val); +} + +/** Resizes to the given \a size, and sets all coefficients in this expression to the given value \a val. + * + * \only_for_vectors + * + * Example: \include Matrix_setConstant_int.cpp + * Output: \verbinclude Matrix_setConstant_int.out + * + * \sa MatrixBase::setConstant(const Scalar&), setConstant(Index,Index,const Scalar&), class CwiseNullaryOp, MatrixBase::Constant(const Scalar&) + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& +PlainObjectBase::setConstant(Index size, const Scalar& val) +{ + resize(size); + return setConstant(val); +} + +/** Resizes to the given size, and sets all coefficients in this expression to the given value \a val. + * + * \param rows the new number of rows + * \param cols the new number of columns + * \param val the value to which all coefficients are set + * + * Example: \include Matrix_setConstant_int_int.cpp + * Output: \verbinclude Matrix_setConstant_int_int.out + * + * \sa MatrixBase::setConstant(const Scalar&), setConstant(Index,const Scalar&), class CwiseNullaryOp, MatrixBase::Constant(const Scalar&) + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& +PlainObjectBase::setConstant(Index rows, Index cols, const Scalar& val) +{ + resize(rows, cols); + return setConstant(val); +} + +/** Resizes to the given size, changing only the number of columns, and sets all + * coefficients in this expression to the given value \a val. For the parameter + * of type NoChange_t, just pass the special value \c NoChange. + * + * \sa MatrixBase::setConstant(const Scalar&), setConstant(Index,const Scalar&), class CwiseNullaryOp, MatrixBase::Constant(const Scalar&) + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& +PlainObjectBase::setConstant(NoChange_t, Index cols, const Scalar& val) +{ + return setConstant(rows(), cols, val); +} + +/** Resizes to the given size, changing only the number of rows, and sets all + * coefficients in this expression to the given value \a val. For the parameter + * of type NoChange_t, just pass the special value \c NoChange. + * + * \sa MatrixBase::setConstant(const Scalar&), setConstant(Index,const Scalar&), class CwiseNullaryOp, MatrixBase::Constant(const Scalar&) + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& +PlainObjectBase::setConstant(Index rows, NoChange_t, const Scalar& val) +{ + return setConstant(rows, cols(), val); +} + + +/** + * \brief Sets a linearly spaced vector. + * + * The function generates 'size' equally spaced values in the closed interval [low,high]. + * When size is set to 1, a vector of length 1 containing 'high' is returned. + * + * \only_for_vectors + * + * Example: \include DenseBase_setLinSpaced.cpp + * Output: \verbinclude DenseBase_setLinSpaced.out + * + * For integer scalar types, do not miss the explanations on the definition + * of \link LinSpaced(Index,const Scalar&,const Scalar&) even spacing \endlink. + * + * \sa LinSpaced(Index,const Scalar&,const Scalar&), CwiseNullaryOp + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase::setLinSpaced(Index newSize, const Scalar& low, const Scalar& high) +{ + EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) + return derived() = Derived::NullaryExpr(newSize, internal::linspaced_op(low,high,newSize)); +} + +/** + * \brief Sets a linearly spaced vector. + * + * The function fills \c *this with equally spaced values in the closed interval [low,high]. + * When size is set to 1, a vector of length 1 containing 'high' is returned. + * + * \only_for_vectors + * + * For integer scalar types, do not miss the explanations on the definition + * of \link LinSpaced(Index,const Scalar&,const Scalar&) even spacing \endlink. + * + * \sa LinSpaced(Index,const Scalar&,const Scalar&), setLinSpaced(Index, const Scalar&, const Scalar&), CwiseNullaryOp + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase::setLinSpaced(const Scalar& low, const Scalar& high) +{ + EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) + return setLinSpaced(size(), low, high); +} + +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase::setEqualSpaced(Index newSize, const Scalar& low, + const Scalar& step) { + EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) + return derived() = Derived::NullaryExpr(newSize, internal::equalspaced_op(low, step)); +} +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase::setEqualSpaced(const Scalar& low, + const Scalar& step) { + EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) + return setEqualSpaced(size(), low, step); +} + +// zero: + +/** \returns an expression of a zero matrix. + * + * The parameters \a rows and \a cols are the number of rows and of columns of + * the returned matrix. Must be compatible with this MatrixBase type. + * + * This variant is meant to be used for dynamic-size matrix types. For fixed-size types, + * it is redundant to pass \a rows and \a cols as arguments, so Zero() should be used + * instead. + * + * Example: \include MatrixBase_zero_int_int.cpp + * Output: \verbinclude MatrixBase_zero_int_int.out + * + * \sa Zero(), Zero(Index) + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase::ConstantReturnType +DenseBase::Zero(Index rows, Index cols) +{ + return Constant(rows, cols, Scalar(0)); +} + +/** \returns an expression of a zero vector. + * + * The parameter \a size is the size of the returned vector. + * Must be compatible with this MatrixBase type. + * + * \only_for_vectors + * + * This variant is meant to be used for dynamic-size vector types. For fixed-size types, + * it is redundant to pass \a size as argument, so Zero() should be used + * instead. + * + * Example: \include MatrixBase_zero_int.cpp + * Output: \verbinclude MatrixBase_zero_int.out + * + * \sa Zero(), Zero(Index,Index) + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase::ConstantReturnType +DenseBase::Zero(Index size) +{ + return Constant(size, Scalar(0)); +} + +/** \returns an expression of a fixed-size zero matrix or vector. + * + * This variant is only for fixed-size MatrixBase types. For dynamic-size types, you + * need to use the variants taking size arguments. + * + * Example: \include MatrixBase_zero.cpp + * Output: \verbinclude MatrixBase_zero.out + * + * \sa Zero(Index), Zero(Index,Index) + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase::ConstantReturnType +DenseBase::Zero() +{ + return Constant(Scalar(0)); +} + +/** \returns true if *this is approximately equal to the zero matrix, + * within the precision given by \a prec. + * + * Example: \include MatrixBase_isZero.cpp + * Output: \verbinclude MatrixBase_isZero.out + * + * \sa class CwiseNullaryOp, Zero() + */ +template +EIGEN_DEVICE_FUNC bool DenseBase::isZero(const RealScalar& prec) const +{ + typename internal::nested_eval::type self(derived()); + for(Index j = 0; j < cols(); ++j) + for(Index i = 0; i < rows(); ++i) + if(!internal::isMuchSmallerThan(self.coeff(i, j), static_cast(1), prec)) + return false; + return true; +} + +/** Sets all coefficients in this expression to zero. + * + * Example: \include MatrixBase_setZero.cpp + * Output: \verbinclude MatrixBase_setZero.out + * + * \sa class CwiseNullaryOp, Zero() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase::setZero() +{ + return setConstant(Scalar(0)); +} + +/** Resizes to the given \a size, and sets all coefficients in this expression to zero. + * + * \only_for_vectors + * + * Example: \include Matrix_setZero_int.cpp + * Output: \verbinclude Matrix_setZero_int.out + * + * \sa DenseBase::setZero(), setZero(Index,Index), class CwiseNullaryOp, DenseBase::Zero() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& +PlainObjectBase::setZero(Index newSize) +{ + resize(newSize); + return setConstant(Scalar(0)); +} + +/** Resizes to the given size, and sets all coefficients in this expression to zero. + * + * \param rows the new number of rows + * \param cols the new number of columns + * + * Example: \include Matrix_setZero_int_int.cpp + * Output: \verbinclude Matrix_setZero_int_int.out + * + * \sa DenseBase::setZero(), setZero(Index), class CwiseNullaryOp, DenseBase::Zero() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& +PlainObjectBase::setZero(Index rows, Index cols) +{ + resize(rows, cols); + return setConstant(Scalar(0)); +} + +/** Resizes to the given size, changing only the number of columns, and sets all + * coefficients in this expression to zero. For the parameter of type NoChange_t, + * just pass the special value \c NoChange. + * + * \sa DenseBase::setZero(), setZero(Index), setZero(Index, Index), setZero(Index, NoChange_t), class CwiseNullaryOp, DenseBase::Zero() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& +PlainObjectBase::setZero(NoChange_t, Index cols) +{ + return setZero(rows(), cols); +} + +/** Resizes to the given size, changing only the number of rows, and sets all + * coefficients in this expression to zero. For the parameter of type NoChange_t, + * just pass the special value \c NoChange. + * + * \sa DenseBase::setZero(), setZero(Index), setZero(Index, Index), setZero(NoChange_t, Index), class CwiseNullaryOp, DenseBase::Zero() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& +PlainObjectBase::setZero(Index rows, NoChange_t) +{ + return setZero(rows, cols()); +} + +// ones: + +/** \returns an expression of a matrix where all coefficients equal one. + * + * The parameters \a rows and \a cols are the number of rows and of columns of + * the returned matrix. Must be compatible with this MatrixBase type. + * + * This variant is meant to be used for dynamic-size matrix types. For fixed-size types, + * it is redundant to pass \a rows and \a cols as arguments, so Ones() should be used + * instead. + * + * Example: \include MatrixBase_ones_int_int.cpp + * Output: \verbinclude MatrixBase_ones_int_int.out + * + * \sa Ones(), Ones(Index), isOnes(), class Ones + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase::ConstantReturnType +DenseBase::Ones(Index rows, Index cols) +{ + return Constant(rows, cols, Scalar(1)); +} + +/** \returns an expression of a vector where all coefficients equal one. + * + * The parameter \a newSize is the size of the returned vector. + * Must be compatible with this MatrixBase type. + * + * \only_for_vectors + * + * This variant is meant to be used for dynamic-size vector types. For fixed-size types, + * it is redundant to pass \a size as argument, so Ones() should be used + * instead. + * + * Example: \include MatrixBase_ones_int.cpp + * Output: \verbinclude MatrixBase_ones_int.out + * + * \sa Ones(), Ones(Index,Index), isOnes(), class Ones + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase::ConstantReturnType +DenseBase::Ones(Index newSize) +{ + return Constant(newSize, Scalar(1)); +} + +/** \returns an expression of a fixed-size matrix or vector where all coefficients equal one. + * + * This variant is only for fixed-size MatrixBase types. For dynamic-size types, you + * need to use the variants taking size arguments. + * + * Example: \include MatrixBase_ones.cpp + * Output: \verbinclude MatrixBase_ones.out + * + * \sa Ones(Index), Ones(Index,Index), isOnes(), class Ones + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase::ConstantReturnType +DenseBase::Ones() +{ + return Constant(Scalar(1)); +} + +/** \returns true if *this is approximately equal to the matrix where all coefficients + * are equal to 1, within the precision given by \a prec. + * + * Example: \include MatrixBase_isOnes.cpp + * Output: \verbinclude MatrixBase_isOnes.out + * + * \sa class CwiseNullaryOp, Ones() + */ +template +EIGEN_DEVICE_FUNC bool DenseBase::isOnes +(const RealScalar& prec) const +{ + return isApproxToConstant(Scalar(1), prec); +} + +/** Sets all coefficients in this expression to one. + * + * Example: \include MatrixBase_setOnes.cpp + * Output: \verbinclude MatrixBase_setOnes.out + * + * \sa class CwiseNullaryOp, Ones() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase::setOnes() +{ + return setConstant(Scalar(1)); +} + +/** Resizes to the given \a newSize, and sets all coefficients in this expression to one. + * + * \only_for_vectors + * + * Example: \include Matrix_setOnes_int.cpp + * Output: \verbinclude Matrix_setOnes_int.out + * + * \sa MatrixBase::setOnes(), setOnes(Index,Index), class CwiseNullaryOp, MatrixBase::Ones() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& +PlainObjectBase::setOnes(Index newSize) +{ + resize(newSize); + return setConstant(Scalar(1)); +} + +/** Resizes to the given size, and sets all coefficients in this expression to one. + * + * \param rows the new number of rows + * \param cols the new number of columns + * + * Example: \include Matrix_setOnes_int_int.cpp + * Output: \verbinclude Matrix_setOnes_int_int.out + * + * \sa MatrixBase::setOnes(), setOnes(Index), class CwiseNullaryOp, MatrixBase::Ones() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& +PlainObjectBase::setOnes(Index rows, Index cols) +{ + resize(rows, cols); + return setConstant(Scalar(1)); +} + +/** Resizes to the given size, changing only the number of rows, and sets all + * coefficients in this expression to one. For the parameter of type NoChange_t, + * just pass the special value \c NoChange. + * + * \sa MatrixBase::setOnes(), setOnes(Index), setOnes(Index, Index), setOnes(NoChange_t, Index), class CwiseNullaryOp, MatrixBase::Ones() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& +PlainObjectBase::setOnes(Index rows, NoChange_t) +{ + return setOnes(rows, cols()); +} + +/** Resizes to the given size, changing only the number of columns, and sets all + * coefficients in this expression to one. For the parameter of type NoChange_t, + * just pass the special value \c NoChange. + * + * \sa MatrixBase::setOnes(), setOnes(Index), setOnes(Index, Index), setOnes(Index, NoChange_t) class CwiseNullaryOp, MatrixBase::Ones() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& +PlainObjectBase::setOnes(NoChange_t, Index cols) +{ + return setOnes(rows(), cols); +} + +// Identity: + +/** \returns an expression of the identity matrix (not necessarily square). + * + * The parameters \a rows and \a cols are the number of rows and of columns of + * the returned matrix. Must be compatible with this MatrixBase type. + * + * This variant is meant to be used for dynamic-size matrix types. For fixed-size types, + * it is redundant to pass \a rows and \a cols as arguments, so Identity() should be used + * instead. + * + * Example: \include MatrixBase_identity_int_int.cpp + * Output: \verbinclude MatrixBase_identity_int_int.out + * + * \sa Identity(), setIdentity(), isIdentity() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase::IdentityReturnType +MatrixBase::Identity(Index rows, Index cols) +{ + return DenseBase::NullaryExpr(rows, cols, internal::scalar_identity_op()); +} + +/** \returns an expression of the identity matrix (not necessarily square). + * + * This variant is only for fixed-size MatrixBase types. For dynamic-size types, you + * need to use the variant taking size arguments. + * + * Example: \include MatrixBase_identity.cpp + * Output: \verbinclude MatrixBase_identity.out + * + * \sa Identity(Index,Index), setIdentity(), isIdentity() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase::IdentityReturnType +MatrixBase::Identity() +{ + EIGEN_STATIC_ASSERT_FIXED_SIZE(Derived) + return MatrixBase::NullaryExpr(RowsAtCompileTime, ColsAtCompileTime, internal::scalar_identity_op()); +} + +/** \returns true if *this is approximately equal to the identity matrix + * (not necessarily square), + * within the precision given by \a prec. + * + * Example: \include MatrixBase_isIdentity.cpp + * Output: \verbinclude MatrixBase_isIdentity.out + * + * \sa class CwiseNullaryOp, Identity(), Identity(Index,Index), setIdentity() + */ +template +bool MatrixBase::isIdentity +(const RealScalar& prec) const +{ + typename internal::nested_eval::type self(derived()); + for(Index j = 0; j < cols(); ++j) + { + for(Index i = 0; i < rows(); ++i) + { + if(i == j) + { + if(!internal::isApprox(self.coeff(i, j), static_cast(1), prec)) + return false; + } + else + { + if(!internal::isMuchSmallerThan(self.coeff(i, j), static_cast(1), prec)) + return false; + } + } + } + return true; +} + +namespace internal { + +template=16)> +struct setIdentity_impl +{ + EIGEN_DEVICE_FUNC + static EIGEN_STRONG_INLINE Derived& run(Derived& m) + { + return m = Derived::Identity(m.rows(), m.cols()); + } +}; + +template +struct setIdentity_impl +{ + EIGEN_DEVICE_FUNC + static EIGEN_STRONG_INLINE Derived& run(Derived& m) + { + m.setZero(); + const Index size = numext::mini(m.rows(), m.cols()); + for(Index i = 0; i < size; ++i) m.coeffRef(i,i) = typename Derived::Scalar(1); + return m; + } +}; + +} // end namespace internal + +/** Writes the identity expression (not necessarily square) into *this. + * + * Example: \include MatrixBase_setIdentity.cpp + * Output: \verbinclude MatrixBase_setIdentity.out + * + * \sa class CwiseNullaryOp, Identity(), Identity(Index,Index), isIdentity() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& MatrixBase::setIdentity() +{ + return internal::setIdentity_impl::run(derived()); +} + +/** \brief Resizes to the given size, and writes the identity expression (not necessarily square) into *this. + * + * \param rows the new number of rows + * \param cols the new number of columns + * + * Example: \include Matrix_setIdentity_int_int.cpp + * Output: \verbinclude Matrix_setIdentity_int_int.out + * + * \sa MatrixBase::setIdentity(), class CwiseNullaryOp, MatrixBase::Identity() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& MatrixBase::setIdentity(Index rows, Index cols) +{ + derived().resize(rows, cols); + return setIdentity(); +} + +/** \returns an expression of the i-th unit (basis) vector. + * + * \only_for_vectors + * + * \sa MatrixBase::Unit(Index), MatrixBase::UnitX(), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase::BasisReturnType MatrixBase::Unit(Index newSize, Index i) +{ + EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) + return BasisReturnType(SquareMatrixType::Identity(newSize,newSize), i); +} + +/** \returns an expression of the i-th unit (basis) vector. + * + * \only_for_vectors + * + * This variant is for fixed-size vector only. + * + * \sa MatrixBase::Unit(Index,Index), MatrixBase::UnitX(), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase::BasisReturnType MatrixBase::Unit(Index i) +{ + EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) + return BasisReturnType(SquareMatrixType::Identity(),i); +} + +/** \returns an expression of the X axis unit vector (1{,0}^*) + * + * \only_for_vectors + * + * \sa MatrixBase::Unit(Index,Index), MatrixBase::Unit(Index), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase::BasisReturnType MatrixBase::UnitX() +{ return Derived::Unit(0); } + +/** \returns an expression of the Y axis unit vector (0,1{,0}^*) + * + * \only_for_vectors + * + * \sa MatrixBase::Unit(Index,Index), MatrixBase::Unit(Index), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase::BasisReturnType MatrixBase::UnitY() +{ return Derived::Unit(1); } + +/** \returns an expression of the Z axis unit vector (0,0,1{,0}^*) + * + * \only_for_vectors + * + * \sa MatrixBase::Unit(Index,Index), MatrixBase::Unit(Index), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase::BasisReturnType MatrixBase::UnitZ() +{ return Derived::Unit(2); } + +/** \returns an expression of the W axis unit vector (0,0,0,1) + * + * \only_for_vectors + * + * \sa MatrixBase::Unit(Index,Index), MatrixBase::Unit(Index), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase::BasisReturnType MatrixBase::UnitW() +{ return Derived::Unit(3); } + +/** \brief Set the coefficients of \c *this to the i-th unit (basis) vector + * + * \param i index of the unique coefficient to be set to 1 + * + * \only_for_vectors + * + * \sa MatrixBase::setIdentity(), class CwiseNullaryOp, MatrixBase::Unit(Index,Index) + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& MatrixBase::setUnit(Index i) +{ + EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived); + eigen_assert(i +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& MatrixBase::setUnit(Index newSize, Index i) +{ + EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived); + eigen_assert(i +// Copyright (C) 2006-2008 Benoit Jacob +// Copyright (C) 2016 Eugene Brevdo +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_CWISE_TERNARY_OP_H +#define EIGEN_CWISE_TERNARY_OP_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { +template +struct traits > { + // we must not inherit from traits since it has + // the potential to cause problems with MSVC + typedef remove_all_t Ancestor; + typedef typename traits::XprKind XprKind; + enum { + RowsAtCompileTime = traits::RowsAtCompileTime, + ColsAtCompileTime = traits::ColsAtCompileTime, + MaxRowsAtCompileTime = traits::MaxRowsAtCompileTime, + MaxColsAtCompileTime = traits::MaxColsAtCompileTime + }; + + // even though we require Arg1, Arg2, and Arg3 to have the same scalar type + // (see CwiseTernaryOp constructor), + // we still want to handle the case when the result type is different. + typedef typename result_of::type Scalar; + + typedef typename internal::traits::StorageKind StorageKind; + typedef typename internal::traits::StorageIndex StorageIndex; + + typedef typename Arg1::Nested Arg1Nested; + typedef typename Arg2::Nested Arg2Nested; + typedef typename Arg3::Nested Arg3Nested; + typedef std::remove_reference_t Arg1Nested_; + typedef std::remove_reference_t Arg2Nested_; + typedef std::remove_reference_t Arg3Nested_; + enum { Flags = Arg1Nested_::Flags & RowMajorBit }; +}; +} // end namespace internal + +template +class CwiseTernaryOpImpl; + +/** \class CwiseTernaryOp + * \ingroup Core_Module + * + * \brief Generic expression where a coefficient-wise ternary operator is + * applied to two expressions + * + * \tparam TernaryOp template functor implementing the operator + * \tparam Arg1Type the type of the first argument + * \tparam Arg2Type the type of the second argument + * \tparam Arg3Type the type of the third argument + * + * This class represents an expression where a coefficient-wise ternary + * operator is applied to three expressions. + * It is the return type of ternary operators, by which we mean only those + * ternary operators where + * all three arguments are Eigen expressions. + * For example, the return type of betainc(matrix1, matrix2, matrix3) is a + * CwiseTernaryOp. + * + * Most of the time, this is the only way that it is used, so you typically + * don't have to name + * CwiseTernaryOp types explicitly. + * + * \sa MatrixBase::ternaryExpr(const MatrixBase &, const + * MatrixBase &, const CustomTernaryOp &) const, class CwiseBinaryOp, + * class CwiseUnaryOp, class CwiseNullaryOp + */ +template +class CwiseTernaryOp : public CwiseTernaryOpImpl< + TernaryOp, Arg1Type, Arg2Type, Arg3Type, + typename internal::traits::StorageKind>, + internal::no_assignment_operator +{ + public: + typedef internal::remove_all_t Arg1; + typedef internal::remove_all_t Arg2; + typedef internal::remove_all_t Arg3; + + // require the sizes to match + EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Arg1, Arg2) + EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Arg1, Arg3) + + // The index types should match + EIGEN_STATIC_ASSERT((internal::is_same< + typename internal::traits::StorageKind, + typename internal::traits::StorageKind>::value), + STORAGE_KIND_MUST_MATCH) + EIGEN_STATIC_ASSERT((internal::is_same< + typename internal::traits::StorageKind, + typename internal::traits::StorageKind>::value), + STORAGE_KIND_MUST_MATCH) + + typedef typename CwiseTernaryOpImpl< + TernaryOp, Arg1Type, Arg2Type, Arg3Type, + typename internal::traits::StorageKind>::Base Base; + EIGEN_GENERIC_PUBLIC_INTERFACE(CwiseTernaryOp) + + typedef typename internal::ref_selector::type Arg1Nested; + typedef typename internal::ref_selector::type Arg2Nested; + typedef typename internal::ref_selector::type Arg3Nested; + typedef std::remove_reference_t Arg1Nested_; + typedef std::remove_reference_t Arg2Nested_; + typedef std::remove_reference_t Arg3Nested_; + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE CwiseTernaryOp(const Arg1& a1, const Arg2& a2, + const Arg3& a3, + const TernaryOp& func = TernaryOp()) + : m_arg1(a1), m_arg2(a2), m_arg3(a3), m_functor(func) { + eigen_assert(a1.rows() == a2.rows() && a1.cols() == a2.cols() && + a1.rows() == a3.rows() && a1.cols() == a3.cols()); + } + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Index rows() const { + // return the fixed size type if available to enable compile time + // optimizations + if (internal::traits>:: + RowsAtCompileTime == Dynamic && + internal::traits>:: + RowsAtCompileTime == Dynamic) + return m_arg3.rows(); + else if (internal::traits>:: + RowsAtCompileTime == Dynamic && + internal::traits>:: + RowsAtCompileTime == Dynamic) + return m_arg2.rows(); + else + return m_arg1.rows(); + } + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Index cols() const { + // return the fixed size type if available to enable compile time + // optimizations + if (internal::traits>:: + ColsAtCompileTime == Dynamic && + internal::traits>:: + ColsAtCompileTime == Dynamic) + return m_arg3.cols(); + else if (internal::traits>:: + ColsAtCompileTime == Dynamic && + internal::traits>:: + ColsAtCompileTime == Dynamic) + return m_arg2.cols(); + else + return m_arg1.cols(); + } + + /** \returns the first argument nested expression */ + EIGEN_DEVICE_FUNC + const Arg1Nested_& arg1() const { return m_arg1; } + /** \returns the first argument nested expression */ + EIGEN_DEVICE_FUNC + const Arg2Nested_& arg2() const { return m_arg2; } + /** \returns the third argument nested expression */ + EIGEN_DEVICE_FUNC + const Arg3Nested_& arg3() const { return m_arg3; } + /** \returns the functor representing the ternary operation */ + EIGEN_DEVICE_FUNC + const TernaryOp& functor() const { return m_functor; } + + protected: + Arg1Nested m_arg1; + Arg2Nested m_arg2; + Arg3Nested m_arg3; + const TernaryOp m_functor; +}; + +// Generic API dispatcher +template +class CwiseTernaryOpImpl + : public internal::generic_xpr_base< + CwiseTernaryOp >::type { + public: + typedef typename internal::generic_xpr_base< + CwiseTernaryOp >::type Base; +}; + +} // end namespace Eigen + +#endif // EIGEN_CWISE_TERNARY_OP_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/CwiseUnaryOp.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/CwiseUnaryOp.h new file mode 100644 index 0000000000000000000000000000000000000000..ff7d0b9482f191260a0427e25d352f9074123f75 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/CwiseUnaryOp.h @@ -0,0 +1,105 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008-2014 Gael Guennebaud +// Copyright (C) 2006-2008 Benoit Jacob +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_CWISE_UNARY_OP_H +#define EIGEN_CWISE_UNARY_OP_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { +template +struct traits > + : traits +{ + typedef typename result_of< + UnaryOp(const typename XprType::Scalar&) + >::type Scalar; + typedef typename XprType::Nested XprTypeNested; + typedef std::remove_reference_t XprTypeNested_; + enum { + Flags = XprTypeNested_::Flags & RowMajorBit + }; +}; +} + +template +class CwiseUnaryOpImpl; + +/** \class CwiseUnaryOp + * \ingroup Core_Module + * + * \brief Generic expression where a coefficient-wise unary operator is applied to an expression + * + * \tparam UnaryOp template functor implementing the operator + * \tparam XprType the type of the expression to which we are applying the unary operator + * + * This class represents an expression where a unary operator is applied to an expression. + * It is the return type of all operations taking exactly 1 input expression, regardless of the + * presence of other inputs such as scalars. For example, the operator* in the expression 3*matrix + * is considered unary, because only the right-hand side is an expression, and its + * return type is a specialization of CwiseUnaryOp. + * + * Most of the time, this is the only way that it is used, so you typically don't have to name + * CwiseUnaryOp types explicitly. + * + * \sa MatrixBase::unaryExpr(const CustomUnaryOp &) const, class CwiseBinaryOp, class CwiseNullaryOp + */ +template +class CwiseUnaryOp : public CwiseUnaryOpImpl::StorageKind>, internal::no_assignment_operator +{ + public: + + typedef typename CwiseUnaryOpImpl::StorageKind>::Base Base; + EIGEN_GENERIC_PUBLIC_INTERFACE(CwiseUnaryOp) + typedef typename internal::ref_selector::type XprTypeNested; + typedef internal::remove_all_t NestedExpression; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit CwiseUnaryOp(const XprType& xpr, const UnaryOp& func = UnaryOp()) + : m_xpr(xpr), m_functor(func) {} + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR + Index rows() const EIGEN_NOEXCEPT { return m_xpr.rows(); } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR + Index cols() const EIGEN_NOEXCEPT { return m_xpr.cols(); } + + /** \returns the functor representing the unary operation */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + const UnaryOp& functor() const { return m_functor; } + + /** \returns the nested expression */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + const internal::remove_all_t& + nestedExpression() const { return m_xpr; } + + /** \returns the nested expression */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + internal::remove_all_t& + nestedExpression() { return m_xpr; } + + protected: + XprTypeNested m_xpr; + const UnaryOp m_functor; +}; + +// Generic API dispatcher +template +class CwiseUnaryOpImpl + : public internal::generic_xpr_base >::type +{ +public: + typedef typename internal::generic_xpr_base >::type Base; +}; + +} // end namespace Eigen + +#endif // EIGEN_CWISE_UNARY_OP_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/CwiseUnaryView.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/CwiseUnaryView.h new file mode 100644 index 0000000000000000000000000000000000000000..b4539a6b2c9577e642abdd559134a0fb8c82a0a9 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/CwiseUnaryView.h @@ -0,0 +1,143 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2009-2010 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_CWISE_UNARY_VIEW_H +#define EIGEN_CWISE_UNARY_VIEW_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { +template +struct traits > + : traits +{ + typedef typename result_of< + ViewOp(const typename traits::Scalar&) + >::type Scalar; + typedef typename MatrixType::Nested MatrixTypeNested; + typedef remove_all_t MatrixTypeNested_; + enum { + FlagsLvalueBit = is_lvalue::value ? LvalueBit : 0, + Flags = traits::Flags & (RowMajorBit | FlagsLvalueBit | DirectAccessBit), // FIXME DirectAccessBit should not be handled by expressions + MatrixTypeInnerStride = inner_stride_at_compile_time::ret, + // need to cast the sizeof's from size_t to int explicitly, otherwise: + // "error: no integral type can represent all of the enumerator values + InnerStrideAtCompileTime = StrideType::InnerStrideAtCompileTime == 0 + ? (MatrixTypeInnerStride == Dynamic + ? int(Dynamic) + : int(MatrixTypeInnerStride) * int(sizeof(typename traits::Scalar) / sizeof(Scalar))) + : int(StrideType::InnerStrideAtCompileTime), + + OuterStrideAtCompileTime = StrideType::OuterStrideAtCompileTime == 0 + ? (outer_stride_at_compile_time::ret == Dynamic + ? int(Dynamic) + : outer_stride_at_compile_time::ret * int(sizeof(typename traits::Scalar) / sizeof(Scalar))) + : int(StrideType::OuterStrideAtCompileTime) + }; +}; +} + +template +class CwiseUnaryViewImpl; + +/** \class CwiseUnaryView + * \ingroup Core_Module + * + * \brief Generic lvalue expression of a coefficient-wise unary operator of a matrix or a vector + * + * \tparam ViewOp template functor implementing the view + * \tparam MatrixType the type of the matrix we are applying the unary operator + * + * This class represents a lvalue expression of a generic unary view operator of a matrix or a vector. + * It is the return type of real() and imag(), and most of the time this is the only way it is used. + * + * \sa MatrixBase::unaryViewExpr(const CustomUnaryOp &) const, class CwiseUnaryOp + */ +template +class CwiseUnaryView : public CwiseUnaryViewImpl::StorageKind> +{ + public: + + typedef typename CwiseUnaryViewImpl::StorageKind>::Base Base; + EIGEN_GENERIC_PUBLIC_INTERFACE(CwiseUnaryView) + typedef typename internal::ref_selector::non_const_type MatrixTypeNested; + typedef internal::remove_all_t NestedExpression; + + explicit EIGEN_DEVICE_FUNC inline CwiseUnaryView(MatrixType& mat, const ViewOp& func = ViewOp()) + : m_matrix(mat), m_functor(func) {} + + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(CwiseUnaryView) + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR + Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR + Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); } + + /** \returns the functor representing unary operation */ + EIGEN_DEVICE_FUNC const ViewOp& functor() const { return m_functor; } + + /** \returns the nested expression */ + EIGEN_DEVICE_FUNC const internal::remove_all_t& + nestedExpression() const { return m_matrix; } + + /** \returns the nested expression */ + EIGEN_DEVICE_FUNC std::remove_reference_t& + nestedExpression() { return m_matrix; } + + protected: + MatrixTypeNested m_matrix; + ViewOp m_functor; +}; + +// Generic API dispatcher +template +class CwiseUnaryViewImpl + : public internal::generic_xpr_base >::type +{ +public: + typedef typename internal::generic_xpr_base >::type Base; +}; + +template +class CwiseUnaryViewImpl + : public internal::dense_xpr_base< CwiseUnaryView >::type +{ + public: + + typedef CwiseUnaryView Derived; + typedef typename internal::dense_xpr_base< CwiseUnaryView >::type Base; + + EIGEN_DENSE_PUBLIC_INTERFACE(Derived) + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(CwiseUnaryViewImpl) + + EIGEN_DEVICE_FUNC inline Scalar* data() { return &(this->coeffRef(0)); } + EIGEN_DEVICE_FUNC inline const Scalar* data() const { return &(this->coeff(0)); } + + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index innerStride() const + { + return StrideType::InnerStrideAtCompileTime != 0 + ? int(StrideType::InnerStrideAtCompileTime) + : derived().nestedExpression().innerStride() * sizeof(typename internal::traits::Scalar) / sizeof(Scalar); + } + + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outerStride() const + { + return StrideType::OuterStrideAtCompileTime != 0 + ? int(StrideType::OuterStrideAtCompileTime) + : derived().nestedExpression().outerStride() * sizeof(typename internal::traits::Scalar) / sizeof(Scalar); + } + protected: + EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(CwiseUnaryViewImpl) +}; + +} // end namespace Eigen + +#endif // EIGEN_CWISE_UNARY_VIEW_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/DenseBase.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/DenseBase.h new file mode 100644 index 0000000000000000000000000000000000000000..aa045686be17452b849087953b1e2d267b10a4c1 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/DenseBase.h @@ -0,0 +1,702 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2007-2010 Benoit Jacob +// Copyright (C) 2008-2010 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_DENSEBASE_H +#define EIGEN_DENSEBASE_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +// The index type defined by EIGEN_DEFAULT_DENSE_INDEX_TYPE must be a signed type. +EIGEN_STATIC_ASSERT(NumTraits::IsSigned,THE_INDEX_TYPE_MUST_BE_A_SIGNED_TYPE) + +/** \class DenseBase + * \ingroup Core_Module + * + * \brief Base class for all dense matrices, vectors, and arrays + * + * This class is the base that is inherited by all dense objects (matrix, vector, arrays, + * and related expression types). The common Eigen API for dense objects is contained in this class. + * + * \tparam Derived is the derived type, e.g., a matrix type or an expression. + * + * This class can be extended with the help of the plugin mechanism described on the page + * \ref TopicCustomizing_Plugins by defining the preprocessor symbol \c EIGEN_DENSEBASE_PLUGIN. + * + * \sa \blank \ref TopicClassHierarchy + */ +template class DenseBase +#ifndef EIGEN_PARSED_BY_DOXYGEN + : public DenseCoeffsBase::value> +#else + : public DenseCoeffsBase +#endif // not EIGEN_PARSED_BY_DOXYGEN +{ + public: + + /** Inner iterator type to iterate over the coefficients of a row or column. + * \sa class InnerIterator + */ + typedef Eigen::InnerIterator InnerIterator; + + typedef typename internal::traits::StorageKind StorageKind; + + /** + * \brief The type used to store indices + * \details This typedef is relevant for types that store multiple indices such as + * PermutationMatrix or Transpositions, otherwise it defaults to Eigen::Index + * \sa \blank \ref TopicPreprocessorDirectives, Eigen::Index, SparseMatrixBase. + */ + typedef typename internal::traits::StorageIndex StorageIndex; + + /** The numeric type of the expression' coefficients, e.g. float, double, int or std::complex, etc. */ + typedef typename internal::traits::Scalar Scalar; + + /** The numeric type of the expression' coefficients, e.g. float, double, int or std::complex, etc. + * + * It is an alias for the Scalar type */ + typedef Scalar value_type; + + typedef typename NumTraits::Real RealScalar; + typedef DenseCoeffsBase::value> Base; + + using Base::derived; + using Base::const_cast_derived; + using Base::rows; + using Base::cols; + using Base::size; + using Base::rowIndexByOuterInner; + using Base::colIndexByOuterInner; + using Base::coeff; + using Base::coeffByOuterInner; + using Base::operator(); + using Base::operator[]; + using Base::x; + using Base::y; + using Base::z; + using Base::w; + using Base::stride; + using Base::innerStride; + using Base::outerStride; + using Base::rowStride; + using Base::colStride; + typedef typename Base::CoeffReturnType CoeffReturnType; + + enum { + + RowsAtCompileTime = internal::traits::RowsAtCompileTime, + /**< The number of rows at compile-time. This is just a copy of the value provided + * by the \a Derived type. If a value is not known at compile-time, + * it is set to the \a Dynamic constant. + * \sa MatrixBase::rows(), MatrixBase::cols(), ColsAtCompileTime, SizeAtCompileTime */ + + ColsAtCompileTime = internal::traits::ColsAtCompileTime, + /**< The number of columns at compile-time. This is just a copy of the value provided + * by the \a Derived type. If a value is not known at compile-time, + * it is set to the \a Dynamic constant. + * \sa MatrixBase::rows(), MatrixBase::cols(), RowsAtCompileTime, SizeAtCompileTime */ + + + SizeAtCompileTime = (internal::size_of_xpr_at_compile_time::ret), + /**< This is equal to the number of coefficients, i.e. the number of + * rows times the number of columns, or to \a Dynamic if this is not + * known at compile-time. \sa RowsAtCompileTime, ColsAtCompileTime */ + + MaxRowsAtCompileTime = internal::traits::MaxRowsAtCompileTime, + /**< This value is equal to the maximum possible number of rows that this expression + * might have. If this expression might have an arbitrarily high number of rows, + * this value is set to \a Dynamic. + * + * This value is useful to know when evaluating an expression, in order to determine + * whether it is possible to avoid doing a dynamic memory allocation. + * + * \sa RowsAtCompileTime, MaxColsAtCompileTime, MaxSizeAtCompileTime + */ + + MaxColsAtCompileTime = internal::traits::MaxColsAtCompileTime, + /**< This value is equal to the maximum possible number of columns that this expression + * might have. If this expression might have an arbitrarily high number of columns, + * this value is set to \a Dynamic. + * + * This value is useful to know when evaluating an expression, in order to determine + * whether it is possible to avoid doing a dynamic memory allocation. + * + * \sa ColsAtCompileTime, MaxRowsAtCompileTime, MaxSizeAtCompileTime + */ + + MaxSizeAtCompileTime = internal::size_at_compile_time(internal::traits::MaxRowsAtCompileTime, + internal::traits::MaxColsAtCompileTime), + /**< This value is equal to the maximum possible number of coefficients that this expression + * might have. If this expression might have an arbitrarily high number of coefficients, + * this value is set to \a Dynamic. + * + * This value is useful to know when evaluating an expression, in order to determine + * whether it is possible to avoid doing a dynamic memory allocation. + * + * \sa SizeAtCompileTime, MaxRowsAtCompileTime, MaxColsAtCompileTime + */ + + IsVectorAtCompileTime = internal::traits::RowsAtCompileTime == 1 + || internal::traits::ColsAtCompileTime == 1, + /**< This is set to true if either the number of rows or the number of + * columns is known at compile-time to be equal to 1. Indeed, in that case, + * we are dealing with a column-vector (if there is only one column) or with + * a row-vector (if there is only one row). */ + + NumDimensions = int(MaxSizeAtCompileTime) == 1 ? 0 : bool(IsVectorAtCompileTime) ? 1 : 2, + /**< This value is equal to Tensor::NumDimensions, i.e. 0 for scalars, 1 for vectors, + * and 2 for matrices. + */ + + Flags = internal::traits::Flags, + /**< This stores expression \ref flags flags which may or may not be inherited by new expressions + * constructed from this one. See the \ref flags "list of flags". + */ + + IsRowMajor = int(Flags) & RowMajorBit, /**< True if this expression has row-major storage order. */ + + InnerSizeAtCompileTime = int(IsVectorAtCompileTime) ? int(SizeAtCompileTime) + : int(IsRowMajor) ? int(ColsAtCompileTime) : int(RowsAtCompileTime), + + InnerStrideAtCompileTime = internal::inner_stride_at_compile_time::ret, + OuterStrideAtCompileTime = internal::outer_stride_at_compile_time::ret + }; + + typedef typename internal::find_best_packet::type PacketScalar; + + enum { IsPlainObjectBase = 0 }; + + /** The plain matrix type corresponding to this expression. + * \sa PlainObject */ + typedef Matrix::Scalar, + internal::traits::RowsAtCompileTime, + internal::traits::ColsAtCompileTime, + AutoAlign | (internal::traits::Flags&RowMajorBit ? RowMajor : ColMajor), + internal::traits::MaxRowsAtCompileTime, + internal::traits::MaxColsAtCompileTime + > PlainMatrix; + + /** The plain array type corresponding to this expression. + * \sa PlainObject */ + typedef Array::Scalar, + internal::traits::RowsAtCompileTime, + internal::traits::ColsAtCompileTime, + AutoAlign | (internal::traits::Flags&RowMajorBit ? RowMajor : ColMajor), + internal::traits::MaxRowsAtCompileTime, + internal::traits::MaxColsAtCompileTime + > PlainArray; + + /** \brief The plain matrix or array type corresponding to this expression. + * + * This is not necessarily exactly the return type of eval(). In the case of plain matrices, + * the return type of eval() is a const reference to a matrix, not a matrix! It is however guaranteed + * that the return type of eval() is either PlainObject or const PlainObject&. + */ + typedef std::conditional_t::XprKind,MatrixXpr >::value, + PlainMatrix, PlainArray> PlainObject; + + /** \returns the outer size. + * + * \note For a vector, this returns just 1. For a matrix (non-vector), this is the major dimension + * with respect to the \ref TopicStorageOrders "storage order", i.e., the number of columns for a + * column-major matrix, and the number of rows for a row-major matrix. */ + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + Index outerSize() const + { + return IsVectorAtCompileTime ? 1 + : int(IsRowMajor) ? this->rows() : this->cols(); + } + + /** \returns the inner size. + * + * \note For a vector, this is just the size. For a matrix (non-vector), this is the minor dimension + * with respect to the \ref TopicStorageOrders "storage order", i.e., the number of rows for a + * column-major matrix, and the number of columns for a row-major matrix. */ + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + Index innerSize() const + { + return IsVectorAtCompileTime ? this->size() + : int(IsRowMajor) ? this->cols() : this->rows(); + } + + /** Only plain matrices/arrays, not expressions, may be resized; therefore the only useful resize methods are + * Matrix::resize() and Array::resize(). The present method only asserts that the new size equals the old size, and does + * nothing else. + */ + EIGEN_DEVICE_FUNC + void resize(Index newSize) + { + EIGEN_ONLY_USED_FOR_DEBUG(newSize); + eigen_assert(newSize == this->size() + && "DenseBase::resize() does not actually allow to resize."); + } + /** Only plain matrices/arrays, not expressions, may be resized; therefore the only useful resize methods are + * Matrix::resize() and Array::resize(). The present method only asserts that the new size equals the old size, and does + * nothing else. + */ + EIGEN_DEVICE_FUNC + void resize(Index rows, Index cols) + { + EIGEN_ONLY_USED_FOR_DEBUG(rows); + EIGEN_ONLY_USED_FOR_DEBUG(cols); + eigen_assert(rows == this->rows() && cols == this->cols() + && "DenseBase::resize() does not actually allow to resize."); + } + +#ifndef EIGEN_PARSED_BY_DOXYGEN + /** \internal Represents a matrix with all coefficients equal to one another*/ + typedef CwiseNullaryOp,PlainObject> ConstantReturnType; + /** \internal \deprecated Represents a vector with linearly spaced coefficients that allows sequential access only. */ + EIGEN_DEPRECATED typedef CwiseNullaryOp,PlainObject> SequentialLinSpacedReturnType; + /** \internal Represents a vector with linearly spaced coefficients that allows random access. */ + typedef CwiseNullaryOp,PlainObject> RandomAccessLinSpacedReturnType; + /** \internal Represents a vector with equally spaced coefficients that allows random access. */ + typedef CwiseNullaryOp, PlainObject> RandomAccessEqualSpacedReturnType; + /** \internal the return type of MatrixBase::eigenvalues() */ + typedef Matrix::Scalar>::Real, internal::traits::ColsAtCompileTime, 1> EigenvaluesReturnType; + +#endif // not EIGEN_PARSED_BY_DOXYGEN + + /** Copies \a other into *this. \returns a reference to *this. */ + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Derived& operator=(const DenseBase& other); + + /** Special case of the template operator=, in order to prevent the compiler + * from generating a default operator= (issue hit with g++ 4.1) + */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Derived& operator=(const DenseBase& other); + + template + EIGEN_DEVICE_FUNC + Derived& operator=(const EigenBase &other); + + template + EIGEN_DEVICE_FUNC + Derived& operator+=(const EigenBase &other); + + template + EIGEN_DEVICE_FUNC + Derived& operator-=(const EigenBase &other); + + template + EIGEN_DEVICE_FUNC + Derived& operator=(const ReturnByValue& func); + + /** \internal + * Copies \a other into *this without evaluating other. \returns a reference to *this. */ + template + /** \deprecated */ + EIGEN_DEPRECATED EIGEN_DEVICE_FUNC + Derived& lazyAssign(const DenseBase& other); + + EIGEN_DEVICE_FUNC + CommaInitializer operator<< (const Scalar& s); + + template + /** \deprecated it now returns \c *this */ + EIGEN_DEPRECATED + const Derived& flagged() const + { return derived(); } + + template + EIGEN_DEVICE_FUNC + CommaInitializer operator<< (const DenseBase& other); + + typedef Transpose TransposeReturnType; + EIGEN_DEVICE_FUNC + TransposeReturnType transpose(); + typedef Transpose ConstTransposeReturnType; + EIGEN_DEVICE_FUNC + const ConstTransposeReturnType transpose() const; + EIGEN_DEVICE_FUNC + void transposeInPlace(); + + EIGEN_DEVICE_FUNC static const ConstantReturnType + Constant(Index rows, Index cols, const Scalar& value); + EIGEN_DEVICE_FUNC static const ConstantReturnType + Constant(Index size, const Scalar& value); + EIGEN_DEVICE_FUNC static const ConstantReturnType + Constant(const Scalar& value); + + EIGEN_DEPRECATED EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType + LinSpaced(Sequential_t, Index size, const Scalar& low, const Scalar& high); + EIGEN_DEPRECATED EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType + LinSpaced(Sequential_t, const Scalar& low, const Scalar& high); + + EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType + LinSpaced(Index size, const Scalar& low, const Scalar& high); + EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType + LinSpaced(const Scalar& low, const Scalar& high); + + EIGEN_DEVICE_FUNC static const RandomAccessEqualSpacedReturnType + EqualSpaced(Index size, const Scalar& low, const Scalar& step); + EIGEN_DEVICE_FUNC static const RandomAccessEqualSpacedReturnType + EqualSpaced(const Scalar& low, const Scalar& step); + + template EIGEN_DEVICE_FUNC + static const CwiseNullaryOp + NullaryExpr(Index rows, Index cols, const CustomNullaryOp& func); + template EIGEN_DEVICE_FUNC + static const CwiseNullaryOp + NullaryExpr(Index size, const CustomNullaryOp& func); + template EIGEN_DEVICE_FUNC + static const CwiseNullaryOp + NullaryExpr(const CustomNullaryOp& func); + + EIGEN_DEVICE_FUNC static const ConstantReturnType Zero(Index rows, Index cols); + EIGEN_DEVICE_FUNC static const ConstantReturnType Zero(Index size); + EIGEN_DEVICE_FUNC static const ConstantReturnType Zero(); + EIGEN_DEVICE_FUNC static const ConstantReturnType Ones(Index rows, Index cols); + EIGEN_DEVICE_FUNC static const ConstantReturnType Ones(Index size); + EIGEN_DEVICE_FUNC static const ConstantReturnType Ones(); + + EIGEN_DEVICE_FUNC void fill(const Scalar& value); + EIGEN_DEVICE_FUNC Derived& setConstant(const Scalar& value); + EIGEN_DEVICE_FUNC Derived& setLinSpaced(Index size, const Scalar& low, const Scalar& high); + EIGEN_DEVICE_FUNC Derived& setLinSpaced(const Scalar& low, const Scalar& high); + EIGEN_DEVICE_FUNC Derived& setEqualSpaced(Index size, const Scalar& low, const Scalar& step); + EIGEN_DEVICE_FUNC Derived& setEqualSpaced(const Scalar& low, const Scalar& step); + EIGEN_DEVICE_FUNC Derived& setZero(); + EIGEN_DEVICE_FUNC Derived& setOnes(); + EIGEN_DEVICE_FUNC Derived& setRandom(); + + template EIGEN_DEVICE_FUNC + bool isApprox(const DenseBase& other, + const RealScalar& prec = NumTraits::dummy_precision()) const; + EIGEN_DEVICE_FUNC + bool isMuchSmallerThan(const RealScalar& other, + const RealScalar& prec = NumTraits::dummy_precision()) const; + template EIGEN_DEVICE_FUNC + bool isMuchSmallerThan(const DenseBase& other, + const RealScalar& prec = NumTraits::dummy_precision()) const; + + EIGEN_DEVICE_FUNC bool isApproxToConstant(const Scalar& value, const RealScalar& prec = NumTraits::dummy_precision()) const; + EIGEN_DEVICE_FUNC bool isConstant(const Scalar& value, const RealScalar& prec = NumTraits::dummy_precision()) const; + EIGEN_DEVICE_FUNC bool isZero(const RealScalar& prec = NumTraits::dummy_precision()) const; + EIGEN_DEVICE_FUNC bool isOnes(const RealScalar& prec = NumTraits::dummy_precision()) const; + + EIGEN_DEVICE_FUNC inline bool hasNaN() const; + EIGEN_DEVICE_FUNC inline bool allFinite() const; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Derived& operator*=(const Scalar& other); + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Derived& operator/=(const Scalar& other); + + typedef internal::add_const_on_value_type_t::type> EvalReturnType; + /** \returns the matrix or vector obtained by evaluating this expression. + * + * Notice that in the case of a plain matrix or vector (not an expression) this function just returns + * a const reference, in order to avoid a useless copy. + * + * \warning Be careful with eval() and the auto C++ keyword, as detailed in this \link TopicPitfalls_auto_keyword page \endlink. + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE EvalReturnType eval() const + { + // Even though MSVC does not honor strong inlining when the return type + // is a dynamic matrix, we desperately need strong inlining for fixed + // size types on MSVC. + return typename internal::eval::type(derived()); + } + + /** swaps *this with the expression \a other. + * + */ + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + void swap(const DenseBase& other) + { + EIGEN_STATIC_ASSERT(!OtherDerived::IsPlainObjectBase,THIS_EXPRESSION_IS_NOT_A_LVALUE__IT_IS_READ_ONLY); + eigen_assert(rows()==other.rows() && cols()==other.cols()); + call_assignment(derived(), other.const_cast_derived(), internal::swap_assign_op()); + } + + /** swaps *this with the matrix or array \a other. + * + */ + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + void swap(PlainObjectBase& other) + { + eigen_assert(rows()==other.rows() && cols()==other.cols()); + call_assignment(derived(), other.derived(), internal::swap_assign_op()); + } + + EIGEN_DEVICE_FUNC inline const NestByValue nestByValue() const; + EIGEN_DEVICE_FUNC inline const ForceAlignedAccess forceAlignedAccess() const; + EIGEN_DEVICE_FUNC inline ForceAlignedAccess forceAlignedAccess(); + template EIGEN_DEVICE_FUNC + inline const std::conditional_t,Derived&> forceAlignedAccessIf() const; + template EIGEN_DEVICE_FUNC + inline std::conditional_t,Derived&> forceAlignedAccessIf(); + + EIGEN_DEVICE_FUNC Scalar sum() const; + EIGEN_DEVICE_FUNC Scalar mean() const; + EIGEN_DEVICE_FUNC Scalar trace() const; + + EIGEN_DEVICE_FUNC Scalar prod() const; + + template + EIGEN_DEVICE_FUNC typename internal::traits::Scalar minCoeff() const; + template + EIGEN_DEVICE_FUNC typename internal::traits::Scalar maxCoeff() const; + + + // By default, the fastest version with undefined NaN propagation semantics is + // used. + // TODO(rmlarsen): Replace with default template argument when we move to + // c++11 or beyond. + EIGEN_DEVICE_FUNC inline typename internal::traits::Scalar minCoeff() const { + return minCoeff(); + } + EIGEN_DEVICE_FUNC inline typename internal::traits::Scalar maxCoeff() const { + return maxCoeff(); + } + + template + EIGEN_DEVICE_FUNC + typename internal::traits::Scalar minCoeff(IndexType* row, IndexType* col) const; + template + EIGEN_DEVICE_FUNC + typename internal::traits::Scalar maxCoeff(IndexType* row, IndexType* col) const; + template + EIGEN_DEVICE_FUNC + typename internal::traits::Scalar minCoeff(IndexType* index) const; + template + EIGEN_DEVICE_FUNC + typename internal::traits::Scalar maxCoeff(IndexType* index) const; + + // TODO(rmlarsen): Replace these methods with a default template argument. + template + EIGEN_DEVICE_FUNC inline + typename internal::traits::Scalar minCoeff(IndexType* row, IndexType* col) const { + return minCoeff(row, col); + } + template + EIGEN_DEVICE_FUNC inline + typename internal::traits::Scalar maxCoeff(IndexType* row, IndexType* col) const { + return maxCoeff(row, col); + } + template + EIGEN_DEVICE_FUNC inline + typename internal::traits::Scalar minCoeff(IndexType* index) const { + return minCoeff(index); + } + template + EIGEN_DEVICE_FUNC inline + typename internal::traits::Scalar maxCoeff(IndexType* index) const { + return maxCoeff(index); + } + + template + EIGEN_DEVICE_FUNC + Scalar redux(const BinaryOp& func) const; + + template + EIGEN_DEVICE_FUNC + void visit(Visitor& func) const; + + /** \returns a WithFormat proxy object allowing to print a matrix the with given + * format \a fmt. + * + * See class IOFormat for some examples. + * + * \sa class IOFormat, class WithFormat + */ + inline const WithFormat format(const IOFormat& fmt) const + { + return WithFormat(derived(), fmt); + } + + /** \returns the unique coefficient of a 1x1 expression */ + EIGEN_DEVICE_FUNC + CoeffReturnType value() const + { + EIGEN_STATIC_ASSERT_SIZE_1x1(Derived) + eigen_assert(this->rows() == 1 && this->cols() == 1); + return derived().coeff(0,0); + } + + EIGEN_DEVICE_FUNC bool all() const; + EIGEN_DEVICE_FUNC bool any() const; + EIGEN_DEVICE_FUNC Index count() const; + + typedef VectorwiseOp RowwiseReturnType; + typedef const VectorwiseOp ConstRowwiseReturnType; + typedef VectorwiseOp ColwiseReturnType; + typedef const VectorwiseOp ConstColwiseReturnType; + + /** \returns a VectorwiseOp wrapper of *this for broadcasting and partial reductions + * + * Example: \include MatrixBase_rowwise.cpp + * Output: \verbinclude MatrixBase_rowwise.out + * + * \sa colwise(), class VectorwiseOp, \ref TutorialReductionsVisitorsBroadcasting + */ + //Code moved here due to a CUDA compiler bug + EIGEN_DEVICE_FUNC inline ConstRowwiseReturnType rowwise() const { + return ConstRowwiseReturnType(derived()); + } + EIGEN_DEVICE_FUNC RowwiseReturnType rowwise(); + + /** \returns a VectorwiseOp wrapper of *this broadcasting and partial reductions + * + * Example: \include MatrixBase_colwise.cpp + * Output: \verbinclude MatrixBase_colwise.out + * + * \sa rowwise(), class VectorwiseOp, \ref TutorialReductionsVisitorsBroadcasting + */ + EIGEN_DEVICE_FUNC inline ConstColwiseReturnType colwise() const { + return ConstColwiseReturnType(derived()); + } + EIGEN_DEVICE_FUNC ColwiseReturnType colwise(); + + typedef CwiseNullaryOp,PlainObject> RandomReturnType; + static const RandomReturnType Random(Index rows, Index cols); + static const RandomReturnType Random(Index size); + static const RandomReturnType Random(); + + template + inline EIGEN_DEVICE_FUNC + CwiseTernaryOp::Scalar, + typename DenseBase::Scalar, Scalar>, + ThenDerived, ElseDerived, Derived> + select(const DenseBase& thenMatrix, const DenseBase& elseMatrix) const; + + template + inline EIGEN_DEVICE_FUNC + CwiseTernaryOp::Scalar, + typename DenseBase::Scalar, Scalar>, + ThenDerived, typename DenseBase::ConstantReturnType, Derived> + select(const DenseBase& thenMatrix, + const typename DenseBase::Scalar& elseScalar) const; + + template + inline EIGEN_DEVICE_FUNC + CwiseTernaryOp::Scalar, + typename DenseBase::Scalar, Scalar>, + typename DenseBase::ConstantReturnType, ElseDerived, Derived> + select(const typename DenseBase::Scalar& thenScalar, + const DenseBase& elseMatrix) const; + + template RealScalar lpNorm() const; + + template + EIGEN_DEVICE_FUNC + const Replicate replicate() const; + /** + * \return an expression of the replication of \c *this + * + * Example: \include MatrixBase_replicate_int_int.cpp + * Output: \verbinclude MatrixBase_replicate_int_int.out + * + * \sa VectorwiseOp::replicate(), DenseBase::replicate(), class Replicate + */ + //Code moved here due to a CUDA compiler bug + EIGEN_DEVICE_FUNC + const Replicate replicate(Index rowFactor, Index colFactor) const + { + return Replicate(derived(), rowFactor, colFactor); + } + + typedef Reverse ReverseReturnType; + typedef const Reverse ConstReverseReturnType; + EIGEN_DEVICE_FUNC ReverseReturnType reverse(); + /** This is the const version of reverse(). */ + //Code moved here due to a CUDA compiler bug + EIGEN_DEVICE_FUNC ConstReverseReturnType reverse() const + { + return ConstReverseReturnType(derived()); + } + EIGEN_DEVICE_FUNC void reverseInPlace(); + + #ifdef EIGEN_PARSED_BY_DOXYGEN + /** STL-like RandomAccessIterator + * iterator type as returned by the begin() and end() methods. + */ + typedef random_access_iterator_type iterator; + /** This is the const version of iterator (aka read-only) */ + typedef random_access_iterator_type const_iterator; + #else + typedef std::conditional_t< (Flags&DirectAccessBit)==DirectAccessBit, + internal::pointer_based_stl_iterator, + internal::generic_randaccess_stl_iterator + > iterator_type; + + typedef std::conditional_t< (Flags&DirectAccessBit)==DirectAccessBit, + internal::pointer_based_stl_iterator, + internal::generic_randaccess_stl_iterator + > const_iterator_type; + + // Stl-style iterators are supported only for vectors. + + typedef std::conditional_t iterator; + + typedef std::conditional_t const_iterator; + #endif + + inline iterator begin(); + inline const_iterator begin() const; + inline const_iterator cbegin() const; + inline iterator end(); + inline const_iterator end() const; + inline const_iterator cend() const; + +#define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::DenseBase +#define EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL +#define EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(COND) +#define EIGEN_DOC_UNARY_ADDONS(X,Y) +# include "../plugins/CommonCwiseUnaryOps.h" +# include "../plugins/BlockMethods.h" +# include "../plugins/IndexedViewMethods.h" +# include "../plugins/ReshapedMethods.h" +# ifdef EIGEN_DENSEBASE_PLUGIN +# include EIGEN_DENSEBASE_PLUGIN +# endif +#undef EIGEN_CURRENT_STORAGE_BASE_CLASS +#undef EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL +#undef EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF +#undef EIGEN_DOC_UNARY_ADDONS + + // disable the use of evalTo for dense objects with a nice compilation error + template + EIGEN_DEVICE_FUNC + inline void evalTo(Dest& ) const + { + EIGEN_STATIC_ASSERT((internal::is_same::value),THE_EVAL_EVALTO_FUNCTION_SHOULD_NEVER_BE_CALLED_FOR_DENSE_OBJECTS); + } + + protected: + EIGEN_DEFAULT_COPY_CONSTRUCTOR(DenseBase) + /** Default constructor. Do nothing. */ + EIGEN_DEVICE_FUNC constexpr DenseBase() { + /* Just checks for self-consistency of the flags. + * Only do it when debugging Eigen, as this borders on paranoia and could slow compilation down + */ +#ifdef EIGEN_INTERNAL_DEBUGGING + EIGEN_STATIC_ASSERT((internal::check_implication(MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1, int(IsRowMajor)) + && internal::check_implication(MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1, int(!IsRowMajor))), + INVALID_STORAGE_ORDER_FOR_THIS_VECTOR_EXPRESSION) +#endif + } + + private: + EIGEN_DEVICE_FUNC explicit DenseBase(int); + EIGEN_DEVICE_FUNC DenseBase(int,int); + template EIGEN_DEVICE_FUNC explicit DenseBase(const DenseBase&); +}; + +} // end namespace Eigen + +#endif // EIGEN_DENSEBASE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/DenseCoeffsBase.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/DenseCoeffsBase.h new file mode 100644 index 0000000000000000000000000000000000000000..7f0bcf471808998027d628244b1bd302fb5189a9 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/DenseCoeffsBase.h @@ -0,0 +1,687 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2006-2010 Benoit Jacob +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_DENSECOEFFSBASE_H +#define EIGEN_DENSECOEFFSBASE_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { +template struct add_const_on_value_type_if_arithmetic +{ + typedef std::conditional_t::value, T, add_const_on_value_type_t> type; +}; +} + +/** \brief Base class providing read-only coefficient access to matrices and arrays. + * \ingroup Core_Module + * \tparam Derived Type of the derived class + * + * \note #ReadOnlyAccessors Constant indicating read-only access + * + * This class defines the \c operator() \c const function and friends, which can be used to read specific + * entries of a matrix or array. + * + * \sa DenseCoeffsBase, DenseCoeffsBase, + * \ref TopicClassHierarchy + */ +template +class DenseCoeffsBase : public EigenBase +{ + public: + typedef typename internal::traits::StorageKind StorageKind; + typedef typename internal::traits::Scalar Scalar; + typedef typename internal::packet_traits::type PacketScalar; + + // Explanation for this CoeffReturnType typedef. + // - This is the return type of the coeff() method. + // - The LvalueBit means exactly that we can offer a coeffRef() method, which means exactly that we can get references + // to coeffs, which means exactly that we can have coeff() return a const reference (as opposed to returning a value). + // - The is_arithmetic check is required since "const int", "const double", etc. will cause warnings on some systems + // while the declaration of "const T", where T is a non arithmetic type does not. Always returning "const Scalar&" is + // not possible, since the underlying expressions might not offer a valid address the reference could be referring to. + typedef std::conditional_t::Flags&LvalueBit), + const Scalar&, + std::conditional_t::value, Scalar, const Scalar> + > CoeffReturnType; + + typedef typename internal::add_const_on_value_type_if_arithmetic< + typename internal::packet_traits::type + >::type PacketReturnType; + + typedef EigenBase Base; + using Base::rows; + using Base::cols; + using Base::size; + using Base::derived; + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Index rowIndexByOuterInner(Index outer, Index inner) const + { + return int(Derived::RowsAtCompileTime) == 1 ? 0 + : int(Derived::ColsAtCompileTime) == 1 ? inner + : int(Derived::Flags)&RowMajorBit ? outer + : inner; + } + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Index colIndexByOuterInner(Index outer, Index inner) const + { + return int(Derived::ColsAtCompileTime) == 1 ? 0 + : int(Derived::RowsAtCompileTime) == 1 ? inner + : int(Derived::Flags)&RowMajorBit ? inner + : outer; + } + + /** Short version: don't use this function, use + * \link operator()(Index,Index) const \endlink instead. + * + * Long version: this function is similar to + * \link operator()(Index,Index) const \endlink, but without the assertion. + * Use this for limiting the performance cost of debugging code when doing + * repeated coefficient access. Only use this when it is guaranteed that the + * parameters \a row and \a col are in range. + * + * If EIGEN_INTERNAL_DEBUGGING is defined, an assertion will be made, making this + * function equivalent to \link operator()(Index,Index) const \endlink. + * + * \sa operator()(Index,Index) const, coeffRef(Index,Index), coeff(Index) const + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const + { + eigen_internal_assert(row >= 0 && row < rows() + && col >= 0 && col < cols()); + return internal::evaluator(derived()).coeff(row,col); + } + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE CoeffReturnType coeffByOuterInner(Index outer, Index inner) const + { + return coeff(rowIndexByOuterInner(outer, inner), + colIndexByOuterInner(outer, inner)); + } + + /** \returns the coefficient at given the given row and column. + * + * \sa operator()(Index,Index), operator[](Index) + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE CoeffReturnType operator()(Index row, Index col) const + { + eigen_assert(row >= 0 && row < rows() + && col >= 0 && col < cols()); + return coeff(row, col); + } + + /** Short version: don't use this function, use + * \link operator[](Index) const \endlink instead. + * + * Long version: this function is similar to + * \link operator[](Index) const \endlink, but without the assertion. + * Use this for limiting the performance cost of debugging code when doing + * repeated coefficient access. Only use this when it is guaranteed that the + * parameter \a index is in range. + * + * If EIGEN_INTERNAL_DEBUGGING is defined, an assertion will be made, making this + * function equivalent to \link operator[](Index) const \endlink. + * + * \sa operator[](Index) const, coeffRef(Index), coeff(Index,Index) const + */ + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE CoeffReturnType + coeff(Index index) const + { + EIGEN_STATIC_ASSERT(internal::evaluator::Flags & LinearAccessBit, + THIS_COEFFICIENT_ACCESSOR_TAKING_ONE_ACCESS_IS_ONLY_FOR_EXPRESSIONS_ALLOWING_LINEAR_ACCESS) + eigen_internal_assert(index >= 0 && index < size()); + return internal::evaluator(derived()).coeff(index); + } + + + /** \returns the coefficient at given index. + * + * This method is allowed only for vector expressions, and for matrix expressions having the LinearAccessBit. + * + * \sa operator[](Index), operator()(Index,Index) const, x() const, y() const, + * z() const, w() const + */ + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE CoeffReturnType + operator[](Index index) const + { + EIGEN_STATIC_ASSERT(Derived::IsVectorAtCompileTime, + THE_BRACKET_OPERATOR_IS_ONLY_FOR_VECTORS__USE_THE_PARENTHESIS_OPERATOR_INSTEAD) + eigen_assert(index >= 0 && index < size()); + return coeff(index); + } + + /** \returns the coefficient at given index. + * + * This is synonymous to operator[](Index) const. + * + * This method is allowed only for vector expressions, and for matrix expressions having the LinearAccessBit. + * + * \sa operator[](Index), operator()(Index,Index) const, x() const, y() const, + * z() const, w() const + */ + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE CoeffReturnType + operator()(Index index) const + { + eigen_assert(index >= 0 && index < size()); + return coeff(index); + } + + /** equivalent to operator[](0). */ + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE CoeffReturnType + x() const { return (*this)[0]; } + + /** equivalent to operator[](1). */ + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE CoeffReturnType + y() const + { + EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime==-1 || Derived::SizeAtCompileTime>=2, OUT_OF_RANGE_ACCESS); + return (*this)[1]; + } + + /** equivalent to operator[](2). */ + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE CoeffReturnType + z() const + { + EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime==-1 || Derived::SizeAtCompileTime>=3, OUT_OF_RANGE_ACCESS); + return (*this)[2]; + } + + /** equivalent to operator[](3). */ + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE CoeffReturnType + w() const + { + EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime==-1 || Derived::SizeAtCompileTime>=4, OUT_OF_RANGE_ACCESS); + return (*this)[3]; + } + + /** \internal + * \returns the packet of coefficients starting at the given row and column. It is your responsibility + * to ensure that a packet really starts there. This method is only available on expressions having the + * PacketAccessBit. + * + * The \a LoadMode parameter may have the value \a #Aligned or \a #Unaligned. Its effect is to select + * the appropriate vectorization instruction. Aligned access is faster, but is only possible for packets + * starting at an address which is a multiple of the packet size. + */ + + template + EIGEN_STRONG_INLINE PacketReturnType packet(Index row, Index col) const + { + typedef typename internal::packet_traits::type DefaultPacketType; + eigen_internal_assert(row >= 0 && row < rows() && col >= 0 && col < cols()); + return internal::evaluator(derived()).template packet(row,col); + } + + + /** \internal */ + template + EIGEN_STRONG_INLINE PacketReturnType packetByOuterInner(Index outer, Index inner) const + { + return packet(rowIndexByOuterInner(outer, inner), + colIndexByOuterInner(outer, inner)); + } + + /** \internal + * \returns the packet of coefficients starting at the given index. It is your responsibility + * to ensure that a packet really starts there. This method is only available on expressions having the + * PacketAccessBit and the LinearAccessBit. + * + * The \a LoadMode parameter may have the value \a #Aligned or \a #Unaligned. Its effect is to select + * the appropriate vectorization instruction. Aligned access is faster, but is only possible for packets + * starting at an address which is a multiple of the packet size. + */ + + template + EIGEN_STRONG_INLINE PacketReturnType packet(Index index) const + { + EIGEN_STATIC_ASSERT(internal::evaluator::Flags & LinearAccessBit, + THIS_COEFFICIENT_ACCESSOR_TAKING_ONE_ACCESS_IS_ONLY_FOR_EXPRESSIONS_ALLOWING_LINEAR_ACCESS) + typedef typename internal::packet_traits::type DefaultPacketType; + eigen_internal_assert(index >= 0 && index < size()); + return internal::evaluator(derived()).template packet(index); + } + + protected: + // explanation: DenseBase is doing "using ..." on the methods from DenseCoeffsBase. + // But some methods are only available in the DirectAccess case. + // So we add dummy methods here with these names, so that "using... " doesn't fail. + // It's not private so that the child class DenseBase can access them, and it's not public + // either since it's an implementation detail, so has to be protected. + void coeffRef(); + void coeffRefByOuterInner(); + void writePacket(); + void writePacketByOuterInner(); + void copyCoeff(); + void copyCoeffByOuterInner(); + void copyPacket(); + void copyPacketByOuterInner(); + void stride(); + void innerStride(); + void outerStride(); + void rowStride(); + void colStride(); +}; + +/** \brief Base class providing read/write coefficient access to matrices and arrays. + * \ingroup Core_Module + * \tparam Derived Type of the derived class + * + * \note #WriteAccessors Constant indicating read/write access + * + * This class defines the non-const \c operator() function and friends, which can be used to write specific + * entries of a matrix or array. This class inherits DenseCoeffsBase which + * defines the const variant for reading specific entries. + * + * \sa DenseCoeffsBase, \ref TopicClassHierarchy + */ +template +class DenseCoeffsBase : public DenseCoeffsBase +{ + public: + + typedef DenseCoeffsBase Base; + + typedef typename internal::traits::StorageKind StorageKind; + typedef typename internal::traits::Scalar Scalar; + typedef typename internal::packet_traits::type PacketScalar; + typedef typename NumTraits::Real RealScalar; + + using Base::coeff; + using Base::rows; + using Base::cols; + using Base::size; + using Base::derived; + using Base::rowIndexByOuterInner; + using Base::colIndexByOuterInner; + using Base::operator[]; + using Base::operator(); + using Base::x; + using Base::y; + using Base::z; + using Base::w; + + /** Short version: don't use this function, use + * \link operator()(Index,Index) \endlink instead. + * + * Long version: this function is similar to + * \link operator()(Index,Index) \endlink, but without the assertion. + * Use this for limiting the performance cost of debugging code when doing + * repeated coefficient access. Only use this when it is guaranteed that the + * parameters \a row and \a col are in range. + * + * If EIGEN_INTERNAL_DEBUGGING is defined, an assertion will be made, making this + * function equivalent to \link operator()(Index,Index) \endlink. + * + * \sa operator()(Index,Index), coeff(Index, Index) const, coeffRef(Index) + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Scalar& coeffRef(Index row, Index col) + { + eigen_internal_assert(row >= 0 && row < rows() + && col >= 0 && col < cols()); + return internal::evaluator(derived()).coeffRef(row,col); + } + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Scalar& + coeffRefByOuterInner(Index outer, Index inner) + { + return coeffRef(rowIndexByOuterInner(outer, inner), + colIndexByOuterInner(outer, inner)); + } + + /** \returns a reference to the coefficient at given the given row and column. + * + * \sa operator[](Index) + */ + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Scalar& + operator()(Index row, Index col) + { + eigen_assert(row >= 0 && row < rows() + && col >= 0 && col < cols()); + return coeffRef(row, col); + } + + + /** Short version: don't use this function, use + * \link operator[](Index) \endlink instead. + * + * Long version: this function is similar to + * \link operator[](Index) \endlink, but without the assertion. + * Use this for limiting the performance cost of debugging code when doing + * repeated coefficient access. Only use this when it is guaranteed that the + * parameters \a row and \a col are in range. + * + * If EIGEN_INTERNAL_DEBUGGING is defined, an assertion will be made, making this + * function equivalent to \link operator[](Index) \endlink. + * + * \sa operator[](Index), coeff(Index) const, coeffRef(Index,Index) + */ + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Scalar& + coeffRef(Index index) + { + EIGEN_STATIC_ASSERT(internal::evaluator::Flags & LinearAccessBit, + THIS_COEFFICIENT_ACCESSOR_TAKING_ONE_ACCESS_IS_ONLY_FOR_EXPRESSIONS_ALLOWING_LINEAR_ACCESS) + eigen_internal_assert(index >= 0 && index < size()); + return internal::evaluator(derived()).coeffRef(index); + } + + /** \returns a reference to the coefficient at given index. + * + * This method is allowed only for vector expressions, and for matrix expressions having the LinearAccessBit. + * + * \sa operator[](Index) const, operator()(Index,Index), x(), y(), z(), w() + */ + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Scalar& + operator[](Index index) + { + EIGEN_STATIC_ASSERT(Derived::IsVectorAtCompileTime, + THE_BRACKET_OPERATOR_IS_ONLY_FOR_VECTORS__USE_THE_PARENTHESIS_OPERATOR_INSTEAD) + eigen_assert(index >= 0 && index < size()); + return coeffRef(index); + } + + /** \returns a reference to the coefficient at given index. + * + * This is synonymous to operator[](Index). + * + * This method is allowed only for vector expressions, and for matrix expressions having the LinearAccessBit. + * + * \sa operator[](Index) const, operator()(Index,Index), x(), y(), z(), w() + */ + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Scalar& + operator()(Index index) + { + eigen_assert(index >= 0 && index < size()); + return coeffRef(index); + } + + /** equivalent to operator[](0). */ + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Scalar& + x() { return (*this)[0]; } + + /** equivalent to operator[](1). */ + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Scalar& + y() + { + EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime==-1 || Derived::SizeAtCompileTime>=2, OUT_OF_RANGE_ACCESS); + return (*this)[1]; + } + + /** equivalent to operator[](2). */ + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Scalar& + z() + { + EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime==-1 || Derived::SizeAtCompileTime>=3, OUT_OF_RANGE_ACCESS); + return (*this)[2]; + } + + /** equivalent to operator[](3). */ + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Scalar& + w() + { + EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime==-1 || Derived::SizeAtCompileTime>=4, OUT_OF_RANGE_ACCESS); + return (*this)[3]; + } +}; + +/** \brief Base class providing direct read-only coefficient access to matrices and arrays. + * \ingroup Core_Module + * \tparam Derived Type of the derived class + * + * \note #DirectAccessors Constant indicating direct access + * + * This class defines functions to work with strides which can be used to access entries directly. This class + * inherits DenseCoeffsBase which defines functions to access entries read-only using + * \c operator() . + * + * \sa \blank \ref TopicClassHierarchy + */ +template +class DenseCoeffsBase : public DenseCoeffsBase +{ + public: + + typedef DenseCoeffsBase Base; + typedef typename internal::traits::Scalar Scalar; + typedef typename NumTraits::Real RealScalar; + + using Base::rows; + using Base::cols; + using Base::size; + using Base::derived; + + /** \returns the pointer increment between two consecutive elements within a slice in the inner direction. + * + * \sa outerStride(), rowStride(), colStride() + */ + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index innerStride() const + { + return derived().innerStride(); + } + + /** \returns the pointer increment between two consecutive inner slices (for example, between two consecutive columns + * in a column-major matrix). + * + * \sa innerStride(), rowStride(), colStride() + */ + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index outerStride() const + { + return derived().outerStride(); + } + + // FIXME shall we remove it ? + EIGEN_CONSTEXPR inline Index stride() const + { + return Derived::IsVectorAtCompileTime ? innerStride() : outerStride(); + } + + /** \returns the pointer increment between two consecutive rows. + * + * \sa innerStride(), outerStride(), colStride() + */ + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index rowStride() const + { + return Derived::IsRowMajor ? outerStride() : innerStride(); + } + + /** \returns the pointer increment between two consecutive columns. + * + * \sa innerStride(), outerStride(), rowStride() + */ + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index colStride() const + { + return Derived::IsRowMajor ? innerStride() : outerStride(); + } +}; + +/** \brief Base class providing direct read/write coefficient access to matrices and arrays. + * \ingroup Core_Module + * \tparam Derived Type of the derived class + * + * \note #DirectWriteAccessors Constant indicating direct access + * + * This class defines functions to work with strides which can be used to access entries directly. This class + * inherits DenseCoeffsBase which defines functions to access entries read/write using + * \c operator(). + * + * \sa \blank \ref TopicClassHierarchy + */ +template +class DenseCoeffsBase + : public DenseCoeffsBase +{ + public: + + typedef DenseCoeffsBase Base; + typedef typename internal::traits::Scalar Scalar; + typedef typename NumTraits::Real RealScalar; + + using Base::rows; + using Base::cols; + using Base::size; + using Base::derived; + + /** \returns the pointer increment between two consecutive elements within a slice in the inner direction. + * + * \sa outerStride(), rowStride(), colStride() + */ + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index innerStride() const EIGEN_NOEXCEPT + { + return derived().innerStride(); + } + + /** \returns the pointer increment between two consecutive inner slices (for example, between two consecutive columns + * in a column-major matrix). + * + * \sa innerStride(), rowStride(), colStride() + */ + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index outerStride() const EIGEN_NOEXCEPT + { + return derived().outerStride(); + } + + // FIXME shall we remove it ? + EIGEN_CONSTEXPR inline Index stride() const EIGEN_NOEXCEPT + { + return Derived::IsVectorAtCompileTime ? innerStride() : outerStride(); + } + + /** \returns the pointer increment between two consecutive rows. + * + * \sa innerStride(), outerStride(), colStride() + */ + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index rowStride() const EIGEN_NOEXCEPT + { + return Derived::IsRowMajor ? outerStride() : innerStride(); + } + + /** \returns the pointer increment between two consecutive columns. + * + * \sa innerStride(), outerStride(), rowStride() + */ + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index colStride() const EIGEN_NOEXCEPT + { + return Derived::IsRowMajor ? innerStride() : outerStride(); + } +}; + +namespace internal { + +template +struct first_aligned_impl +{ + static EIGEN_CONSTEXPR inline Index run(const Derived&) EIGEN_NOEXCEPT + { return 0; } +}; + +template +struct first_aligned_impl +{ + static inline Index run(const Derived& m) + { + return internal::first_aligned(m.data(), m.size()); + } +}; + +/** \internal \returns the index of the first element of the array stored by \a m that is properly aligned with respect to \a Alignment for vectorization. + * + * \tparam Alignment requested alignment in Bytes. + * + * There is also the variant first_aligned(const Scalar*, Integer) defined in Memory.h. See it for more + * documentation. + */ +template +static inline Index first_aligned(const DenseBase& m) +{ + enum { ReturnZero = (int(evaluator::Alignment) >= Alignment) || !(Derived::Flags & DirectAccessBit) }; + return first_aligned_impl::run(m.derived()); +} + +template +static inline Index first_default_aligned(const DenseBase& m) +{ + typedef typename Derived::Scalar Scalar; + typedef typename packet_traits::type DefaultPacketType; + return internal::first_aligned::alignment),Derived>(m); +} + +template::ret> +struct inner_stride_at_compile_time +{ + enum { ret = traits::InnerStrideAtCompileTime }; +}; + +template +struct inner_stride_at_compile_time +{ + enum { ret = 0 }; +}; + +template::ret> +struct outer_stride_at_compile_time +{ + enum { ret = traits::OuterStrideAtCompileTime }; +}; + +template +struct outer_stride_at_compile_time +{ + enum { ret = 0 }; +}; + +} // end namespace internal + +} // end namespace Eigen + +#endif // EIGEN_DENSECOEFFSBASE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/DenseStorage.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/DenseStorage.h new file mode 100644 index 0000000000000000000000000000000000000000..11205fa4037d599f7985b9286adcdf1e69e0df0d --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/DenseStorage.h @@ -0,0 +1,688 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008 Gael Guennebaud +// Copyright (C) 2006-2009 Benoit Jacob +// Copyright (C) 2010-2013 Hauke Heibel +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_MATRIXSTORAGE_H +#define EIGEN_MATRIXSTORAGE_H + +#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN + #define EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(X) X; EIGEN_DENSE_STORAGE_CTOR_PLUGIN; +#else + #define EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(X) +#endif + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { + +struct constructor_without_unaligned_array_assert {}; + +template +EIGEN_DEVICE_FUNC constexpr void check_static_allocation_size() { +// if EIGEN_STACK_ALLOCATION_LIMIT is defined to 0, then no limit +#if EIGEN_STACK_ALLOCATION_LIMIT + EIGEN_STATIC_ASSERT(Size * sizeof(T) <= EIGEN_STACK_ALLOCATION_LIMIT, OBJECT_ALLOCATED_ON_STACK_IS_TOO_BIG); +#endif +} + +/** \internal + * Static array. If the MatrixOrArrayOptions require auto-alignment, the array will be automatically aligned: + * to 16 bytes boundary if the total size is a multiple of 16 bytes. + */ +template ::value > +struct plain_array +{ + T array[Size]; + + EIGEN_DEVICE_FUNC constexpr plain_array() { check_static_allocation_size(); } + + EIGEN_DEVICE_FUNC constexpr plain_array(constructor_without_unaligned_array_assert) { + check_static_allocation_size(); + } +}; + +#if defined(EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT) + #define EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(sizemask) +#else + #define EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(sizemask) \ + eigen_assert((internal::is_constant_evaluated() || (std::uintptr_t(array) & (sizemask)) == 0) \ + && "this assertion is explained here: " \ + "http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html" \ + " **** READ THIS WEB PAGE !!! ****"); +#endif + +template +struct plain_array +{ + EIGEN_ALIGN_TO_BOUNDARY(8) T array[Size]; + + EIGEN_DEVICE_FUNC constexpr plain_array() { + EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(7); + check_static_allocation_size(); + } + + EIGEN_DEVICE_FUNC constexpr plain_array(constructor_without_unaligned_array_assert) { + check_static_allocation_size(); + } +}; + +template +struct plain_array +{ + EIGEN_ALIGN_TO_BOUNDARY(16) T array[Size]; + + EIGEN_DEVICE_FUNC constexpr plain_array() { + EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(15); + check_static_allocation_size(); + } + + EIGEN_DEVICE_FUNC constexpr plain_array(constructor_without_unaligned_array_assert) { + check_static_allocation_size(); + } +}; + +template +struct plain_array +{ + EIGEN_ALIGN_TO_BOUNDARY(32) T array[Size]; + + EIGEN_DEVICE_FUNC constexpr plain_array() { + EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(31); + check_static_allocation_size(); + } + + EIGEN_DEVICE_FUNC constexpr plain_array(constructor_without_unaligned_array_assert) { + check_static_allocation_size(); + } +}; + +template +struct plain_array +{ + EIGEN_ALIGN_TO_BOUNDARY(64) T array[Size]; + + EIGEN_DEVICE_FUNC constexpr plain_array() { + EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(63); + check_static_allocation_size(); + } + + EIGEN_DEVICE_FUNC constexpr plain_array(constructor_without_unaligned_array_assert) { + check_static_allocation_size(); + } +}; + +template +struct plain_array +{ + T array[1]; + EIGEN_DEVICE_FUNC constexpr plain_array() {} + EIGEN_DEVICE_FUNC constexpr plain_array(constructor_without_unaligned_array_assert) {} +}; + +struct plain_array_helper { + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + static void copy(const plain_array& src, const Eigen::Index size, + plain_array& dst) { + smart_copy(src.array, src.array + size, dst.array); + } + + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + static void swap(plain_array& a, const Eigen::Index a_size, + plain_array& b, const Eigen::Index b_size) { + if (a_size < b_size) { + std::swap_ranges(b.array, b.array + a_size, a.array); + smart_move(b.array + a_size, b.array + b_size, a.array + a_size); + } else if (a_size > b_size) { + std::swap_ranges(a.array, a.array + b_size, b.array); + smart_move(a.array + b_size, a.array + a_size, b.array + b_size); + } else { + std::swap_ranges(a.array, a.array + a_size, b.array); + } + } +}; + +} // end namespace internal + +/** \internal + * + * \class DenseStorage + * \ingroup Core_Module + * + * \brief Stores the data of a matrix + * + * This class stores the data of fixed-size, dynamic-size or mixed matrices + * in a way as compact as possible. + * + * \sa Matrix + */ +template class DenseStorage; + +// purely fixed-size matrix +template class DenseStorage +{ + internal::plain_array m_data; + public: + constexpr EIGEN_DEVICE_FUNC DenseStorage() { + EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(Index size = Size) + } + EIGEN_DEVICE_FUNC explicit constexpr DenseStorage(internal::constructor_without_unaligned_array_assert) + : m_data(internal::constructor_without_unaligned_array_assert()) {} +#if defined(EIGEN_DENSE_STORAGE_CTOR_PLUGIN) + EIGEN_DEVICE_FUNC constexpr + DenseStorage(const DenseStorage& other) : m_data(other.m_data) { + EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(Index size = Size) + } +#else + EIGEN_DEVICE_FUNC constexpr DenseStorage(const DenseStorage&) = default; +#endif + EIGEN_DEVICE_FUNC constexpr DenseStorage& operator=(const DenseStorage&) = default; + EIGEN_DEVICE_FUNC constexpr DenseStorage(DenseStorage&&) = default; + EIGEN_DEVICE_FUNC constexpr DenseStorage& operator=(DenseStorage&&) = default; + EIGEN_DEVICE_FUNC constexpr DenseStorage(Index size, Index rows, Index cols) { + EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) + eigen_internal_assert(size == rows * cols && rows == Rows_ && cols == Cols_); + EIGEN_UNUSED_VARIABLE(size); + EIGEN_UNUSED_VARIABLE(rows); + EIGEN_UNUSED_VARIABLE(cols); + } + EIGEN_DEVICE_FUNC void swap(DenseStorage& other) { + numext::swap(m_data, other.m_data); + } + EIGEN_DEVICE_FUNC static constexpr Index rows(void) EIGEN_NOEXCEPT { return Rows_; } + EIGEN_DEVICE_FUNC static constexpr Index cols(void) EIGEN_NOEXCEPT { return Cols_; } + EIGEN_DEVICE_FUNC constexpr void conservativeResize(Index, Index, Index) {} + EIGEN_DEVICE_FUNC constexpr void resize(Index, Index, Index) {} + EIGEN_DEVICE_FUNC constexpr const T* data() const { return m_data.array; } + EIGEN_DEVICE_FUNC constexpr T* data() { return m_data.array; } +}; + +// null matrix +template +class DenseStorage +{ + public: + static_assert(Rows_ * Cols_ == 0, "The fixed number of rows times columns must equal the storage size."); + EIGEN_DEVICE_FUNC constexpr DenseStorage() {} + EIGEN_DEVICE_FUNC explicit constexpr DenseStorage(internal::constructor_without_unaligned_array_assert) {} + EIGEN_DEVICE_FUNC constexpr DenseStorage(const DenseStorage&) {} + EIGEN_DEVICE_FUNC constexpr DenseStorage& operator=(const DenseStorage&) { return *this; } + EIGEN_DEVICE_FUNC constexpr DenseStorage(Index,Index,Index) {} + EIGEN_DEVICE_FUNC constexpr void swap(DenseStorage& ) {} + EIGEN_DEVICE_FUNC static constexpr Index rows(void) EIGEN_NOEXCEPT {return Rows_;} + EIGEN_DEVICE_FUNC static constexpr Index cols(void) EIGEN_NOEXCEPT {return Cols_;} + EIGEN_DEVICE_FUNC constexpr void conservativeResize(Index,Index,Index) {} + EIGEN_DEVICE_FUNC constexpr void resize(Index,Index,Index) {} + EIGEN_DEVICE_FUNC constexpr const T *data() const { return 0; } + EIGEN_DEVICE_FUNC constexpr T *data() { return 0; } +}; + +// more specializations for null matrices; these are necessary to resolve ambiguities +template +class DenseStorage { + Index m_rows; + Index m_cols; + public: + EIGEN_DEVICE_FUNC DenseStorage() : m_rows(0), m_cols(0) {} + EIGEN_DEVICE_FUNC explicit DenseStorage(internal::constructor_without_unaligned_array_assert) : DenseStorage() {} + EIGEN_DEVICE_FUNC DenseStorage(const DenseStorage& other) : m_rows(other.m_rows), m_cols(other.m_cols) {} + EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage& other) { + m_rows = other.m_rows; + m_cols = other.m_cols; + return *this; + } + EIGEN_DEVICE_FUNC DenseStorage(Index, Index rows, Index cols) : m_rows(rows), m_cols(cols) { + eigen_assert(m_rows * m_cols == 0 && "The number of rows times columns must equal the storage size."); + } + EIGEN_DEVICE_FUNC void swap(DenseStorage& other) { + numext::swap(m_rows,other.m_rows); + numext::swap(m_cols,other.m_cols); + } + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT {return m_rows;} + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT {return m_cols;} + EIGEN_DEVICE_FUNC void conservativeResize(Index, Index rows, Index cols) { + m_rows = rows; + m_cols = cols; + eigen_assert(m_rows * m_cols == 0 && "The number of rows times columns must equal the storage size."); + } + EIGEN_DEVICE_FUNC void resize(Index, Index rows, Index cols) { + m_rows = rows; + m_cols = cols; + eigen_assert(m_rows * m_cols == 0 && "The number of rows times columns must equal the storage size."); + } + EIGEN_DEVICE_FUNC const T *data() const { return nullptr; } + EIGEN_DEVICE_FUNC T *data() { return nullptr; } +}; + +template +class DenseStorage { + Index m_cols; + public: + EIGEN_DEVICE_FUNC DenseStorage() : m_cols(0) {} + EIGEN_DEVICE_FUNC explicit DenseStorage(internal::constructor_without_unaligned_array_assert) : DenseStorage() {} + EIGEN_DEVICE_FUNC DenseStorage(const DenseStorage& other) : m_cols(other.m_cols) {} + EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage& other) { + m_cols = other.m_cols; + return *this; + } + EIGEN_DEVICE_FUNC DenseStorage(Index, Index, Index cols) : m_cols(cols) { + eigen_assert(Rows_ * m_cols == 0 && "The number of rows times columns must equal the storage size."); + } + EIGEN_DEVICE_FUNC void swap(DenseStorage& other) { + numext::swap(m_cols, other.m_cols); + } + EIGEN_DEVICE_FUNC static EIGEN_CONSTEXPR Index rows(void) EIGEN_NOEXCEPT {return Rows_;} + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols(void) const EIGEN_NOEXCEPT {return m_cols;} + EIGEN_DEVICE_FUNC void conservativeResize(Index, Index, Index cols) { + m_cols = cols; + eigen_assert(Rows_ * m_cols == 0 && "The number of rows times columns must equal the storage size."); + } + EIGEN_DEVICE_FUNC void resize(Index, Index, Index cols) { + m_cols = cols; + eigen_assert(Rows_ * m_cols == 0 && "The number of rows times columns must equal the storage size."); + } + EIGEN_DEVICE_FUNC const T *data() const { return nullptr; } + EIGEN_DEVICE_FUNC T *data() { return nullptr; } +}; + +template +class DenseStorage { + Index m_rows; + public: + EIGEN_DEVICE_FUNC DenseStorage() : m_rows(0) {} + EIGEN_DEVICE_FUNC explicit DenseStorage(internal::constructor_without_unaligned_array_assert) : DenseStorage() {} + EIGEN_DEVICE_FUNC DenseStorage(const DenseStorage& other) : m_rows(other.m_rows) {} + EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage& other) { + m_rows = other.m_rows; + return *this; + } + EIGEN_DEVICE_FUNC DenseStorage(Index, Index rows, Index) : m_rows(rows) { + eigen_assert(m_rows * Cols_ == 0 && "The number of rows times columns must equal the storage size."); + } + EIGEN_DEVICE_FUNC void swap(DenseStorage& other) { + numext::swap(m_rows, other.m_rows); + } + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows(void) const EIGEN_NOEXCEPT {return m_rows;} + EIGEN_DEVICE_FUNC static EIGEN_CONSTEXPR Index cols(void) EIGEN_NOEXCEPT {return Cols_;} + EIGEN_DEVICE_FUNC void conservativeResize(Index, Index rows, Index) { + m_rows = rows; + eigen_assert(m_rows * Cols_ == 0 && "The number of rows times columns must equal the storage size."); + } + EIGEN_DEVICE_FUNC void resize(Index, Index rows, Index) { + m_rows = rows; + eigen_assert(m_rows * Cols_ == 0 && "The number of rows times columns must equal the storage size."); + } + EIGEN_DEVICE_FUNC const T *data() const { return nullptr; } + EIGEN_DEVICE_FUNC T *data() { return nullptr; } +}; + +// dynamic-size matrix with fixed-size storage +template +class DenseStorage +{ + internal::plain_array m_data; + Index m_rows; + Index m_cols; + public: + EIGEN_DEVICE_FUNC constexpr DenseStorage() : m_data(), m_rows(0), m_cols(0) {} + EIGEN_DEVICE_FUNC explicit constexpr DenseStorage(internal::constructor_without_unaligned_array_assert) + : m_data(internal::constructor_without_unaligned_array_assert()), m_rows(0), m_cols(0) {} + EIGEN_DEVICE_FUNC constexpr DenseStorage(const DenseStorage& other) + : m_data(internal::constructor_without_unaligned_array_assert()), m_rows(other.m_rows), m_cols(other.m_cols) { + internal::plain_array_helper::copy(other.m_data, m_rows * m_cols, m_data); + } + EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage& other) + { + if (this != &other) + { + m_rows = other.m_rows; + m_cols = other.m_cols; + internal::plain_array_helper::copy(other.m_data, m_rows * m_cols, m_data); + } + return *this; + } + EIGEN_DEVICE_FUNC constexpr DenseStorage(Index, Index rows, Index cols) : m_rows(rows), m_cols(cols) {} + EIGEN_DEVICE_FUNC void swap(DenseStorage& other) + { + internal::plain_array_helper::swap(m_data, m_rows * m_cols, other.m_data, other.m_rows * other.m_cols); + numext::swap(m_rows,other.m_rows); + numext::swap(m_cols,other.m_cols); + } + EIGEN_DEVICE_FUNC constexpr Index rows() const { return m_rows; } + EIGEN_DEVICE_FUNC constexpr Index cols() const { return m_cols; } + EIGEN_DEVICE_FUNC constexpr void conservativeResize(Index, Index rows, Index cols) { + m_rows = rows; + m_cols = cols; + } + EIGEN_DEVICE_FUNC constexpr void resize(Index, Index rows, Index cols) { + m_rows = rows; + m_cols = cols; + } + EIGEN_DEVICE_FUNC constexpr const T* data() const { return m_data.array; } + EIGEN_DEVICE_FUNC constexpr T* data() { return m_data.array; } +}; + +// dynamic-size matrix with fixed-size storage and fixed width +template +class DenseStorage +{ + internal::plain_array m_data; + Index m_rows; + public: + EIGEN_DEVICE_FUNC constexpr DenseStorage() : m_rows(0) {} + EIGEN_DEVICE_FUNC explicit constexpr DenseStorage(internal::constructor_without_unaligned_array_assert) + : m_data(internal::constructor_without_unaligned_array_assert()), m_rows(0) {} + EIGEN_DEVICE_FUNC constexpr DenseStorage(const DenseStorage& other) + : m_data(internal::constructor_without_unaligned_array_assert()), m_rows(other.m_rows) { + internal::plain_array_helper::copy(other.m_data, m_rows * Cols_, m_data); + } + + EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage& other) + { + if (this != &other) + { + m_rows = other.m_rows; + internal::plain_array_helper::copy(other.m_data, m_rows * Cols_, m_data); + } + return *this; + } + EIGEN_DEVICE_FUNC constexpr DenseStorage(Index, Index rows, Index) : m_rows(rows) {} + EIGEN_DEVICE_FUNC void swap(DenseStorage& other) + { + internal::plain_array_helper::swap(m_data, m_rows * Cols_, other.m_data, other.m_rows * Cols_); + numext::swap(m_rows, other.m_rows); + } + EIGEN_DEVICE_FUNC constexpr Index rows(void) const EIGEN_NOEXCEPT { return m_rows; } + EIGEN_DEVICE_FUNC constexpr Index cols(void) const EIGEN_NOEXCEPT { return Cols_; } + EIGEN_DEVICE_FUNC constexpr void conservativeResize(Index, Index rows, Index) { m_rows = rows; } + EIGEN_DEVICE_FUNC constexpr void resize(Index, Index rows, Index) { m_rows = rows; } + EIGEN_DEVICE_FUNC constexpr const T* data() const { return m_data.array; } + EIGEN_DEVICE_FUNC constexpr T* data() { return m_data.array; } +}; + +// dynamic-size matrix with fixed-size storage and fixed height +template +class DenseStorage +{ + internal::plain_array m_data; + Index m_cols; + public: + EIGEN_DEVICE_FUNC constexpr DenseStorage() : m_cols(0) {} + EIGEN_DEVICE_FUNC explicit constexpr DenseStorage(internal::constructor_without_unaligned_array_assert) + : m_data(internal::constructor_without_unaligned_array_assert()), m_cols(0) {} + EIGEN_DEVICE_FUNC constexpr DenseStorage(const DenseStorage& other) + : m_data(internal::constructor_without_unaligned_array_assert()), m_cols(other.m_cols) { + internal::plain_array_helper::copy(other.m_data, Rows_ * m_cols, m_data); + } + EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage& other) + { + if (this != &other) + { + m_cols = other.m_cols; + internal::plain_array_helper::copy(other.m_data, Rows_ * m_cols, m_data); + } + return *this; + } + EIGEN_DEVICE_FUNC DenseStorage(Index, Index, Index cols) : m_cols(cols) {} + EIGEN_DEVICE_FUNC void swap(DenseStorage& other) { + internal::plain_array_helper::swap(m_data, Rows_ * m_cols, other.m_data, Rows_ * other.m_cols); + numext::swap(m_cols, other.m_cols); + } + EIGEN_DEVICE_FUNC constexpr Index rows(void) const EIGEN_NOEXCEPT { return Rows_; } + EIGEN_DEVICE_FUNC constexpr Index cols(void) const EIGEN_NOEXCEPT { return m_cols; } + EIGEN_DEVICE_FUNC constexpr void conservativeResize(Index, Index, Index cols) { m_cols = cols; } + EIGEN_DEVICE_FUNC constexpr void resize(Index, Index, Index cols) { m_cols = cols; } + EIGEN_DEVICE_FUNC constexpr const T* data() const { return m_data.array; } + EIGEN_DEVICE_FUNC constexpr T* data() { return m_data.array; } +}; + +// purely dynamic matrix. +template +class DenseStorage +{ + T *m_data; + Index m_rows; + Index m_cols; + public: + EIGEN_DEVICE_FUNC constexpr DenseStorage() : m_data(0), m_rows(0), m_cols(0) {} + EIGEN_DEVICE_FUNC explicit constexpr DenseStorage(internal::constructor_without_unaligned_array_assert) + : m_data(0), m_rows(0), m_cols(0) {} + EIGEN_DEVICE_FUNC DenseStorage(Index size, Index rows, Index cols) + : m_data(internal::conditional_aligned_new_auto(size)), + m_rows(rows), + m_cols(cols) { + EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) + eigen_internal_assert(size==rows*cols && rows>=0 && cols >=0); + } + EIGEN_DEVICE_FUNC DenseStorage(const DenseStorage& other) + : m_data(internal::conditional_aligned_new_auto(other.m_rows*other.m_cols)) + , m_rows(other.m_rows) + , m_cols(other.m_cols) + { + EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(Index size = m_rows*m_cols) + internal::smart_copy(other.m_data, other.m_data+other.m_rows*other.m_cols, m_data); + } + EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage& other) + { + if (this != &other) + { + DenseStorage tmp(other); + this->swap(tmp); + } + return *this; + } + EIGEN_DEVICE_FUNC + DenseStorage(DenseStorage&& other) EIGEN_NOEXCEPT + : m_data(std::move(other.m_data)) + , m_rows(std::move(other.m_rows)) + , m_cols(std::move(other.m_cols)) + { + other.m_data = nullptr; + other.m_rows = 0; + other.m_cols = 0; + } + EIGEN_DEVICE_FUNC + DenseStorage& operator=(DenseStorage&& other) EIGEN_NOEXCEPT + { + numext::swap(m_data, other.m_data); + numext::swap(m_rows, other.m_rows); + numext::swap(m_cols, other.m_cols); + return *this; + } + EIGEN_DEVICE_FUNC ~DenseStorage() { internal::conditional_aligned_delete_auto(m_data, m_rows*m_cols); } + EIGEN_DEVICE_FUNC void swap(DenseStorage& other) + { + numext::swap(m_data,other.m_data); + numext::swap(m_rows,other.m_rows); + numext::swap(m_cols,other.m_cols); + } + EIGEN_DEVICE_FUNC Index rows(void) const EIGEN_NOEXCEPT {return m_rows;} + EIGEN_DEVICE_FUNC Index cols(void) const EIGEN_NOEXCEPT {return m_cols;} + void conservativeResize(Index size, Index rows, Index cols) + { + m_data = internal::conditional_aligned_realloc_new_auto(m_data, size, m_rows*m_cols); + m_rows = rows; + m_cols = cols; + } + EIGEN_DEVICE_FUNC void resize(Index size, Index rows, Index cols) + { + if(size != m_rows*m_cols) + { + internal::conditional_aligned_delete_auto(m_data, m_rows*m_cols); + if (size>0) // >0 and not simply !=0 to let the compiler knows that size cannot be negative + m_data = internal::conditional_aligned_new_auto(size); + else + m_data = 0; + EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) + } + m_rows = rows; + m_cols = cols; + } + EIGEN_DEVICE_FUNC const T *data() const { return m_data; } + EIGEN_DEVICE_FUNC T *data() { return m_data; } +}; + +// matrix with dynamic width and fixed height (so that matrix has dynamic size). +template +class DenseStorage { + T *m_data; + Index m_cols; + public: + EIGEN_DEVICE_FUNC constexpr DenseStorage() : m_data(0), m_cols(0) {} + explicit constexpr DenseStorage(internal::constructor_without_unaligned_array_assert) : m_data(0), m_cols(0) {} + EIGEN_DEVICE_FUNC DenseStorage(Index size, Index rows, Index cols) + : m_data(internal::conditional_aligned_new_auto(size)), m_cols(cols) { + EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) + eigen_internal_assert(size==rows*cols && rows==Rows_ && cols >=0); + EIGEN_UNUSED_VARIABLE(rows); + } + EIGEN_DEVICE_FUNC DenseStorage(const DenseStorage& other) + : m_data(internal::conditional_aligned_new_auto(Rows_*other.m_cols)) + , m_cols(other.m_cols) + { + EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(Index size = m_cols*Rows_) + internal::smart_copy(other.m_data, other.m_data+Rows_*m_cols, m_data); + } + EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage& other) + { + if (this != &other) + { + DenseStorage tmp(other); + this->swap(tmp); + } + return *this; + } + EIGEN_DEVICE_FUNC + DenseStorage(DenseStorage&& other) EIGEN_NOEXCEPT + : m_data(std::move(other.m_data)) + , m_cols(std::move(other.m_cols)) + { + other.m_data = nullptr; + other.m_cols = 0; + } + EIGEN_DEVICE_FUNC + DenseStorage& operator=(DenseStorage&& other) EIGEN_NOEXCEPT + { + numext::swap(m_data, other.m_data); + numext::swap(m_cols, other.m_cols); + return *this; + } + EIGEN_DEVICE_FUNC ~DenseStorage() { internal::conditional_aligned_delete_auto(m_data, Rows_*m_cols); } + EIGEN_DEVICE_FUNC void swap(DenseStorage& other) { + numext::swap(m_data,other.m_data); + numext::swap(m_cols,other.m_cols); + } + EIGEN_DEVICE_FUNC static constexpr Index rows(void) EIGEN_NOEXCEPT { return Rows_; } + EIGEN_DEVICE_FUNC Index cols(void) const EIGEN_NOEXCEPT {return m_cols;} + EIGEN_DEVICE_FUNC void conservativeResize(Index size, Index, Index cols) + { + m_data = internal::conditional_aligned_realloc_new_auto(m_data, size, Rows_*m_cols); + m_cols = cols; + } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index size, Index, Index cols) + { + if(size != Rows_*m_cols) + { + internal::conditional_aligned_delete_auto(m_data, Rows_*m_cols); + if (size>0) // >0 and not simply !=0 to let the compiler knows that size cannot be negative + m_data = internal::conditional_aligned_new_auto(size); + else + m_data = 0; + EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) + } + m_cols = cols; + } + EIGEN_DEVICE_FUNC const T *data() const { return m_data; } + EIGEN_DEVICE_FUNC T *data() { return m_data; } +}; + +// matrix with dynamic height and fixed width (so that matrix has dynamic size). +template +class DenseStorage +{ + T *m_data; + Index m_rows; + public: + EIGEN_DEVICE_FUNC constexpr DenseStorage() : m_data(0), m_rows(0) {} + explicit constexpr DenseStorage(internal::constructor_without_unaligned_array_assert) : m_data(0), m_rows(0) {} + EIGEN_DEVICE_FUNC constexpr DenseStorage(Index size, Index rows, Index cols) + : m_data(internal::conditional_aligned_new_auto(size)), m_rows(rows) { + EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) + eigen_internal_assert(size==rows*cols && rows>=0 && cols == Cols_); + EIGEN_UNUSED_VARIABLE(cols); + } + EIGEN_DEVICE_FUNC DenseStorage(const DenseStorage& other) + : m_data(internal::conditional_aligned_new_auto(other.m_rows*Cols_)) + , m_rows(other.m_rows) + { + EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(Index size = m_rows*Cols_) + internal::smart_copy(other.m_data, other.m_data+other.m_rows*Cols_, m_data); + } + EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage& other) + { + if (this != &other) + { + DenseStorage tmp(other); + this->swap(tmp); + } + return *this; + } + EIGEN_DEVICE_FUNC + DenseStorage(DenseStorage&& other) EIGEN_NOEXCEPT + : m_data(std::move(other.m_data)) + , m_rows(std::move(other.m_rows)) + { + other.m_data = nullptr; + other.m_rows = 0; + } + EIGEN_DEVICE_FUNC + DenseStorage& operator=(DenseStorage&& other) EIGEN_NOEXCEPT + { + numext::swap(m_data, other.m_data); + numext::swap(m_rows, other.m_rows); + return *this; + } + EIGEN_DEVICE_FUNC ~DenseStorage() { internal::conditional_aligned_delete_auto(m_data, Cols_*m_rows); } + EIGEN_DEVICE_FUNC void swap(DenseStorage& other) { + numext::swap(m_data,other.m_data); + numext::swap(m_rows,other.m_rows); + } + EIGEN_DEVICE_FUNC Index rows(void) const EIGEN_NOEXCEPT {return m_rows;} + EIGEN_DEVICE_FUNC static constexpr Index cols(void) { return Cols_; } + void conservativeResize(Index size, Index rows, Index) + { + m_data = internal::conditional_aligned_realloc_new_auto(m_data, size, m_rows*Cols_); + m_rows = rows; + } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index size, Index rows, Index) + { + if(size != m_rows*Cols_) + { + internal::conditional_aligned_delete_auto(m_data, Cols_*m_rows); + if (size>0) // >0 and not simply !=0 to let the compiler knows that size cannot be negative + m_data = internal::conditional_aligned_new_auto(size); + else + m_data = 0; + EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) + } + m_rows = rows; + } + EIGEN_DEVICE_FUNC const T *data() const { return m_data; } + EIGEN_DEVICE_FUNC T *data() { return m_data; } +}; + +} // end namespace Eigen + +#endif // EIGEN_MATRIX_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Diagonal.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Diagonal.h new file mode 100644 index 0000000000000000000000000000000000000000..4af17dd39230bd7b90f95e7baaaad0c5999a7140 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Diagonal.h @@ -0,0 +1,261 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2007-2009 Benoit Jacob +// Copyright (C) 2009-2010 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_DIAGONAL_H +#define EIGEN_DIAGONAL_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +/** \class Diagonal + * \ingroup Core_Module + * + * \brief Expression of a diagonal/subdiagonal/superdiagonal in a matrix + * + * \tparam MatrixType the type of the object in which we are taking a sub/main/super diagonal + * \tparam DiagIndex the index of the sub/super diagonal. The default is 0 and it means the main diagonal. + * A positive value means a superdiagonal, a negative value means a subdiagonal. + * You can also use DynamicIndex so the index can be set at runtime. + * + * The matrix is not required to be square. + * + * This class represents an expression of the main diagonal, or any sub/super diagonal + * of a square matrix. It is the return type of MatrixBase::diagonal() and MatrixBase::diagonal(Index) and most of the + * time this is the only way it is used. + * + * \sa MatrixBase::diagonal(), MatrixBase::diagonal(Index) + */ + +namespace internal { +template +struct traits > + : traits +{ + typedef typename ref_selector::type MatrixTypeNested; + typedef std::remove_reference_t MatrixTypeNested_; + typedef typename MatrixType::StorageKind StorageKind; + enum { + RowsAtCompileTime = (int(DiagIndex) == DynamicIndex || int(MatrixType::SizeAtCompileTime) == Dynamic) ? Dynamic + : (plain_enum_min(MatrixType::RowsAtCompileTime - plain_enum_max(-DiagIndex, 0), + MatrixType::ColsAtCompileTime - plain_enum_max( DiagIndex, 0))), + ColsAtCompileTime = 1, + MaxRowsAtCompileTime = int(MatrixType::MaxSizeAtCompileTime) == Dynamic ? Dynamic + : DiagIndex == DynamicIndex ? min_size_prefer_fixed(MatrixType::MaxRowsAtCompileTime, + MatrixType::MaxColsAtCompileTime) + : (plain_enum_min(MatrixType::MaxRowsAtCompileTime - plain_enum_max(-DiagIndex, 0), + MatrixType::MaxColsAtCompileTime - plain_enum_max( DiagIndex, 0))), + MaxColsAtCompileTime = 1, + MaskLvalueBit = is_lvalue::value ? LvalueBit : 0, + Flags = (unsigned int)MatrixTypeNested_::Flags & (RowMajorBit | MaskLvalueBit | DirectAccessBit) & ~RowMajorBit, // FIXME DirectAccessBit should not be handled by expressions + MatrixTypeOuterStride = outer_stride_at_compile_time::ret, + InnerStrideAtCompileTime = MatrixTypeOuterStride == Dynamic ? Dynamic : MatrixTypeOuterStride+1, + OuterStrideAtCompileTime = 0 + }; +}; +} + +template class Diagonal + : public internal::dense_xpr_base< Diagonal >::type +{ + public: + + enum { DiagIndex = DiagIndex_ }; + typedef typename internal::dense_xpr_base::type Base; + EIGEN_DENSE_PUBLIC_INTERFACE(Diagonal) + + EIGEN_DEVICE_FUNC + explicit inline Diagonal(MatrixType& matrix, Index a_index = DiagIndex) : m_matrix(matrix), m_index(a_index) + { + eigen_assert( a_index <= m_matrix.cols() && -a_index <= m_matrix.rows() ); + } + + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Diagonal) + + EIGEN_DEVICE_FUNC + inline Index rows() const + { + return m_index.value()<0 ? numext::mini(m_matrix.cols(),m_matrix.rows()+m_index.value()) + : numext::mini(m_matrix.rows(),m_matrix.cols()-m_index.value()); + } + + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index cols() const EIGEN_NOEXCEPT { return 1; } + + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index innerStride() const EIGEN_NOEXCEPT { + return m_matrix.outerStride() + 1; + } + + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index outerStride() const EIGEN_NOEXCEPT { return 0; } + + typedef std::conditional_t< + internal::is_lvalue::value, + Scalar, + const Scalar + > ScalarWithConstIfNotLvalue; + + EIGEN_DEVICE_FUNC + inline ScalarWithConstIfNotLvalue* data() { return &(m_matrix.coeffRef(rowOffset(), colOffset())); } + EIGEN_DEVICE_FUNC + inline const Scalar* data() const { return &(m_matrix.coeffRef(rowOffset(), colOffset())); } + + EIGEN_DEVICE_FUNC + inline Scalar& coeffRef(Index row, Index) + { + EIGEN_STATIC_ASSERT_LVALUE(MatrixType) + return m_matrix.coeffRef(row+rowOffset(), row+colOffset()); + } + + EIGEN_DEVICE_FUNC + inline const Scalar& coeffRef(Index row, Index) const + { + return m_matrix.coeffRef(row+rowOffset(), row+colOffset()); + } + + EIGEN_DEVICE_FUNC + inline CoeffReturnType coeff(Index row, Index) const + { + return m_matrix.coeff(row+rowOffset(), row+colOffset()); + } + + EIGEN_DEVICE_FUNC + inline Scalar& coeffRef(Index idx) + { + EIGEN_STATIC_ASSERT_LVALUE(MatrixType) + return m_matrix.coeffRef(idx+rowOffset(), idx+colOffset()); + } + + EIGEN_DEVICE_FUNC + inline const Scalar& coeffRef(Index idx) const + { + return m_matrix.coeffRef(idx+rowOffset(), idx+colOffset()); + } + + EIGEN_DEVICE_FUNC + inline CoeffReturnType coeff(Index idx) const + { + return m_matrix.coeff(idx+rowOffset(), idx+colOffset()); + } + + EIGEN_DEVICE_FUNC + inline const internal::remove_all_t& + nestedExpression() const + { + return m_matrix; + } + + EIGEN_DEVICE_FUNC + inline Index index() const + { + return m_index.value(); + } + + protected: + typename internal::ref_selector::non_const_type m_matrix; + const internal::variable_if_dynamicindex m_index; + + private: + // some compilers may fail to optimize std::max etc in case of compile-time constants... + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR + Index absDiagIndex() const EIGEN_NOEXCEPT { return m_index.value()>0 ? m_index.value() : -m_index.value(); } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR + Index rowOffset() const EIGEN_NOEXCEPT { return m_index.value()>0 ? 0 : -m_index.value(); } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR + Index colOffset() const EIGEN_NOEXCEPT { return m_index.value()>0 ? m_index.value() : 0; } + // trigger a compile-time error if someone try to call packet + template typename MatrixType::PacketReturnType packet(Index) const; + template typename MatrixType::PacketReturnType packet(Index,Index) const; +}; + +/** \returns an expression of the main diagonal of the matrix \c *this + * + * \c *this is not required to be square. + * + * Example: \include MatrixBase_diagonal.cpp + * Output: \verbinclude MatrixBase_diagonal.out + * + * \sa class Diagonal */ +template +EIGEN_DEVICE_FUNC inline typename MatrixBase::DiagonalReturnType +MatrixBase::diagonal() +{ + return DiagonalReturnType(derived()); +} + +/** This is the const version of diagonal(). */ +template +EIGEN_DEVICE_FUNC inline +const typename MatrixBase::ConstDiagonalReturnType +MatrixBase::diagonal() const +{ + return ConstDiagonalReturnType(derived()); +} + +/** \returns an expression of the \a DiagIndex-th sub or super diagonal of the matrix \c *this + * + * \c *this is not required to be square. + * + * The template parameter \a DiagIndex represent a super diagonal if \a DiagIndex > 0 + * and a sub diagonal otherwise. \a DiagIndex == 0 is equivalent to the main diagonal. + * + * Example: \include MatrixBase_diagonal_int.cpp + * Output: \verbinclude MatrixBase_diagonal_int.out + * + * \sa MatrixBase::diagonal(), class Diagonal */ +template +EIGEN_DEVICE_FUNC inline Diagonal +MatrixBase::diagonal(Index index) +{ + return Diagonal(derived(), index); +} + +/** This is the const version of diagonal(Index). */ +template +EIGEN_DEVICE_FUNC inline const Diagonal +MatrixBase::diagonal(Index index) const +{ + return Diagonal(derived(), index); +} + +/** \returns an expression of the \a DiagIndex-th sub or super diagonal of the matrix \c *this + * + * \c *this is not required to be square. + * + * The template parameter \a DiagIndex represent a super diagonal if \a DiagIndex > 0 + * and a sub diagonal otherwise. \a DiagIndex == 0 is equivalent to the main diagonal. + * + * Example: \include MatrixBase_diagonal_template_int.cpp + * Output: \verbinclude MatrixBase_diagonal_template_int.out + * + * \sa MatrixBase::diagonal(), class Diagonal */ +template +template +EIGEN_DEVICE_FUNC +inline Diagonal +MatrixBase::diagonal() +{ + return Diagonal(derived()); +} + +/** This is the const version of diagonal(). */ +template +template +EIGEN_DEVICE_FUNC +inline const Diagonal +MatrixBase::diagonal() const +{ + return Diagonal(derived()); +} + +} // end namespace Eigen + +#endif // EIGEN_DIAGONAL_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/DiagonalMatrix.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/DiagonalMatrix.h new file mode 100644 index 0000000000000000000000000000000000000000..3c389b972d9b0cba2c43ffad6614d8efb0794a77 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/DiagonalMatrix.h @@ -0,0 +1,450 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2009 Gael Guennebaud +// Copyright (C) 2007-2009 Benoit Jacob +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_DIAGONALMATRIX_H +#define EIGEN_DIAGONALMATRIX_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +/** \class DiagonalBase + * \ingroup Core_Module + * + * \brief Base class for diagonal matrices and expressions + * + * This is the base class that is inherited by diagonal matrix and related expression + * types, which internally use a vector for storing the diagonal entries. Diagonal + * types always represent square matrices. + * + * \tparam Derived is the derived type, a DiagonalMatrix or DiagonalWrapper. + * + * \sa class DiagonalMatrix, class DiagonalWrapper + */ +template +class DiagonalBase : public EigenBase +{ + public: + typedef typename internal::traits::DiagonalVectorType DiagonalVectorType; + typedef typename DiagonalVectorType::Scalar Scalar; + typedef typename DiagonalVectorType::RealScalar RealScalar; + typedef typename internal::traits::StorageKind StorageKind; + typedef typename internal::traits::StorageIndex StorageIndex; + + enum { + RowsAtCompileTime = DiagonalVectorType::SizeAtCompileTime, + ColsAtCompileTime = DiagonalVectorType::SizeAtCompileTime, + MaxRowsAtCompileTime = DiagonalVectorType::MaxSizeAtCompileTime, + MaxColsAtCompileTime = DiagonalVectorType::MaxSizeAtCompileTime, + IsVectorAtCompileTime = 0, + Flags = NoPreferredStorageOrderBit + }; + + typedef Matrix DenseMatrixType; + typedef DenseMatrixType DenseType; + typedef DiagonalMatrix PlainObject; + + /** \returns a reference to the derived object. */ + EIGEN_DEVICE_FUNC + inline const Derived& derived() const { return *static_cast(this); } + /** \returns a const reference to the derived object. */ + EIGEN_DEVICE_FUNC + inline Derived& derived() { return *static_cast(this); } + + /** + * Constructs a dense matrix from \c *this. Note, this directly returns a dense matrix type, + * not an expression. + * \returns A dense matrix, with its diagonal entries set from the the derived object. */ + EIGEN_DEVICE_FUNC + DenseMatrixType toDenseMatrix() const { return derived(); } + + /** \returns a reference to the derived object's vector of diagonal coefficients. */ + EIGEN_DEVICE_FUNC + inline const DiagonalVectorType& diagonal() const { return derived().diagonal(); } + /** \returns a const reference to the derived object's vector of diagonal coefficients. */ + EIGEN_DEVICE_FUNC + inline DiagonalVectorType& diagonal() { return derived().diagonal(); } + + /** \returns the value of the coefficient as if \c *this was a dense matrix. */ + EIGEN_DEVICE_FUNC + inline Scalar coeff(Index row, Index col) const { + eigen_assert(row >= 0 && col >= 0 && row < rows() && col <= cols()); + return row == col ? diagonal().coeff(row) : Scalar(0); + } + + /** \returns the number of rows. */ + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index rows() const { return diagonal().size(); } + /** \returns the number of columns. */ + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index cols() const { return diagonal().size(); } + + /** \returns the diagonal matrix product of \c *this by the dense matrix, \a matrix */ + template + EIGEN_DEVICE_FUNC + const Product + operator*(const MatrixBase &matrix) const + { + return Product(derived(),matrix.derived()); + } + + template + using DiagonalProductReturnType = DiagonalWrapper; + + /** \returns the diagonal matrix product of \c *this by the diagonal matrix \a other */ + template + EIGEN_DEVICE_FUNC const DiagonalProductReturnType operator*( + const DiagonalBase& other) const { + return diagonal().cwiseProduct(other.diagonal()).asDiagonal(); + } + + using DiagonalInverseReturnType = + DiagonalWrapper, const DiagonalVectorType>>; + + /** \returns the inverse \c *this. Computed as the coefficient-wise inverse of the diagonal. */ + EIGEN_DEVICE_FUNC + inline const DiagonalInverseReturnType inverse() const { return diagonal().cwiseInverse().asDiagonal(); } + + using DiagonalScaleReturnType = + DiagonalWrapper; + + /** \returns the product of \c *this by the scalar \a scalar */ + EIGEN_DEVICE_FUNC + inline const DiagonalScaleReturnType operator*(const Scalar& scalar) const { + return (diagonal() * scalar).asDiagonal(); + } + + using ScaleDiagonalReturnType = + DiagonalWrapper; + + /** \returns the product of a scalar and the diagonal matrix \a other */ + EIGEN_DEVICE_FUNC + friend inline const ScaleDiagonalReturnType operator*(const Scalar& scalar, const DiagonalBase& other) { + return (scalar * other.diagonal()).asDiagonal(); + } + + template + using DiagonalSumReturnType = DiagonalWrapper; + + /** \returns the sum of \c *this and the diagonal matrix \a other */ + template + EIGEN_DEVICE_FUNC inline const DiagonalSumReturnType operator+( + const DiagonalBase& other) const { + return (diagonal() + other.diagonal()).asDiagonal(); + } + + template + using DiagonalDifferenceReturnType = DiagonalWrapper; + + /** \returns the difference of \c *this and the diagonal matrix \a other */ + template + EIGEN_DEVICE_FUNC inline const DiagonalDifferenceReturnType operator-( + const DiagonalBase& other) const { + return (diagonal() - other.diagonal()).asDiagonal(); + } +}; + +/** \class DiagonalMatrix + * \ingroup Core_Module + * + * \brief Represents a diagonal matrix with its storage + * + * \tparam Scalar_ the type of coefficients + * \tparam SizeAtCompileTime the dimension of the matrix, or Dynamic + * \tparam MaxSizeAtCompileTime the dimension of the matrix, or Dynamic. This parameter is optional and defaults + * to SizeAtCompileTime. Most of the time, you do not need to specify it. + * + * \sa class DiagonalBase, class DiagonalWrapper + */ + +namespace internal { +template +struct traits > + : traits > +{ + typedef Matrix DiagonalVectorType; + typedef DiagonalShape StorageKind; + enum { + Flags = LvalueBit | NoPreferredStorageOrderBit | NestByRefBit + }; +}; +} +template +class DiagonalMatrix + : public DiagonalBase > +{ + public: + #ifndef EIGEN_PARSED_BY_DOXYGEN + typedef typename internal::traits::DiagonalVectorType DiagonalVectorType; + typedef const DiagonalMatrix& Nested; + typedef Scalar_ Scalar; + typedef typename internal::traits::StorageKind StorageKind; + typedef typename internal::traits::StorageIndex StorageIndex; + #endif + + protected: + + DiagonalVectorType m_diagonal; + + public: + + /** const version of diagonal(). */ + EIGEN_DEVICE_FUNC + inline const DiagonalVectorType& diagonal() const { return m_diagonal; } + /** \returns a reference to the stored vector of diagonal coefficients. */ + EIGEN_DEVICE_FUNC + inline DiagonalVectorType& diagonal() { return m_diagonal; } + + /** Default constructor without initialization */ + EIGEN_DEVICE_FUNC + inline DiagonalMatrix() {} + + /** Constructs a diagonal matrix with given dimension */ + EIGEN_DEVICE_FUNC + explicit inline DiagonalMatrix(Index dim) : m_diagonal(dim) {} + + /** 2D constructor. */ + EIGEN_DEVICE_FUNC + inline DiagonalMatrix(const Scalar& x, const Scalar& y) : m_diagonal(x,y) {} + + /** 3D constructor. */ + EIGEN_DEVICE_FUNC + inline DiagonalMatrix(const Scalar& x, const Scalar& y, const Scalar& z) : m_diagonal(x,y,z) {} + + /** \brief Construct a diagonal matrix with fixed size from an arbitrary number of coefficients. + * + * \warning To construct a diagonal matrix of fixed size, the number of values passed to this + * constructor must match the fixed dimension of \c *this. + * + * \sa DiagonalMatrix(const Scalar&, const Scalar&) + * \sa DiagonalMatrix(const Scalar&, const Scalar&, const Scalar&) + */ + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + DiagonalMatrix(const Scalar& a0, const Scalar& a1, const Scalar& a2, const ArgTypes&... args) + : m_diagonal(a0, a1, a2, args...) {} + + /** \brief Constructs a DiagonalMatrix and initializes it by elements given by an initializer list of initializer + * lists \cpp11 + */ + EIGEN_DEVICE_FUNC + explicit EIGEN_STRONG_INLINE DiagonalMatrix(const std::initializer_list>& list) + : m_diagonal(list) {} + + /** \brief Constructs a DiagonalMatrix from an r-value diagonal vector type */ + EIGEN_DEVICE_FUNC + explicit inline DiagonalMatrix(DiagonalVectorType&& diag) : m_diagonal(std::move(diag)) {} + + /** Copy constructor. */ + template + EIGEN_DEVICE_FUNC + inline DiagonalMatrix(const DiagonalBase& other) : m_diagonal(other.diagonal()) {} + + #ifndef EIGEN_PARSED_BY_DOXYGEN + /** copy constructor. prevent a default copy constructor from hiding the other templated constructor */ + inline DiagonalMatrix(const DiagonalMatrix& other) : m_diagonal(other.diagonal()) {} + #endif + + /** generic constructor from expression of the diagonal coefficients */ + template + EIGEN_DEVICE_FUNC + explicit inline DiagonalMatrix(const MatrixBase& other) : m_diagonal(other) + {} + + /** Copy operator. */ + template + EIGEN_DEVICE_FUNC + DiagonalMatrix& operator=(const DiagonalBase& other) + { + m_diagonal = other.diagonal(); + return *this; + } + + #ifndef EIGEN_PARSED_BY_DOXYGEN + /** This is a special case of the templated operator=. Its purpose is to + * prevent a default operator= from hiding the templated operator=. + */ + EIGEN_DEVICE_FUNC + DiagonalMatrix& operator=(const DiagonalMatrix& other) + { + m_diagonal = other.diagonal(); + return *this; + } + #endif + + typedef DiagonalWrapper, DiagonalVectorType>> + InitializeReturnType; + + /** Initializes a diagonal matrix of size SizeAtCompileTime with coefficients set to zero */ + EIGEN_DEVICE_FUNC + static const InitializeReturnType Zero() { return DiagonalVectorType::Zero().asDiagonal(); } + /** Initializes a diagonal matrix of size dim with coefficients set to zero */ + EIGEN_DEVICE_FUNC + static const InitializeReturnType Zero(Index size) { return DiagonalVectorType::Zero(size).asDiagonal(); } + /** Initializes a identity matrix of size SizeAtCompileTime */ + EIGEN_DEVICE_FUNC + static const InitializeReturnType Identity() { return DiagonalVectorType::Ones().asDiagonal(); } + /** Initializes a identity matrix of size dim */ + EIGEN_DEVICE_FUNC + static const InitializeReturnType Identity(Index size) { return DiagonalVectorType::Ones(size).asDiagonal(); } + + /** Resizes to given size. */ + EIGEN_DEVICE_FUNC + inline void resize(Index size) { m_diagonal.resize(size); } + /** Sets all coefficients to zero. */ + EIGEN_DEVICE_FUNC + inline void setZero() { m_diagonal.setZero(); } + /** Resizes and sets all coefficients to zero. */ + EIGEN_DEVICE_FUNC + inline void setZero(Index size) { m_diagonal.setZero(size); } + /** Sets this matrix to be the identity matrix of the current size. */ + EIGEN_DEVICE_FUNC + inline void setIdentity() { m_diagonal.setOnes(); } + /** Sets this matrix to be the identity matrix of the given size. */ + EIGEN_DEVICE_FUNC + inline void setIdentity(Index size) { m_diagonal.setOnes(size); } +}; + +/** \class DiagonalWrapper + * \ingroup Core_Module + * + * \brief Expression of a diagonal matrix + * + * \tparam DiagonalVectorType_ the type of the vector of diagonal coefficients + * + * This class is an expression of a diagonal matrix, but not storing its own vector of diagonal coefficients, + * instead wrapping an existing vector expression. It is the return type of MatrixBase::asDiagonal() + * and most of the time this is the only way that it is used. + * + * \sa class DiagonalMatrix, class DiagonalBase, MatrixBase::asDiagonal() + */ + +namespace internal { +template +struct traits > +{ + typedef DiagonalVectorType_ DiagonalVectorType; + typedef typename DiagonalVectorType::Scalar Scalar; + typedef typename DiagonalVectorType::StorageIndex StorageIndex; + typedef DiagonalShape StorageKind; + typedef typename traits::XprKind XprKind; + enum { + RowsAtCompileTime = DiagonalVectorType::SizeAtCompileTime, + ColsAtCompileTime = DiagonalVectorType::SizeAtCompileTime, + MaxRowsAtCompileTime = DiagonalVectorType::MaxSizeAtCompileTime, + MaxColsAtCompileTime = DiagonalVectorType::MaxSizeAtCompileTime, + Flags = (traits::Flags & LvalueBit) | NoPreferredStorageOrderBit + }; +}; +} + +template +class DiagonalWrapper + : public DiagonalBase >, internal::no_assignment_operator +{ + public: + #ifndef EIGEN_PARSED_BY_DOXYGEN + typedef DiagonalVectorType_ DiagonalVectorType; + typedef DiagonalWrapper Nested; + #endif + + /** Constructor from expression of diagonal coefficients to wrap. */ + EIGEN_DEVICE_FUNC + explicit inline DiagonalWrapper(DiagonalVectorType& a_diagonal) : m_diagonal(a_diagonal) {} + + /** \returns a const reference to the wrapped expression of diagonal coefficients. */ + EIGEN_DEVICE_FUNC + const DiagonalVectorType& diagonal() const { return m_diagonal; } + + protected: + typename DiagonalVectorType::Nested m_diagonal; +}; + +/** \returns a pseudo-expression of a diagonal matrix with *this as vector of diagonal coefficients + * + * \only_for_vectors + * + * Example: \include MatrixBase_asDiagonal.cpp + * Output: \verbinclude MatrixBase_asDiagonal.out + * + * \sa class DiagonalWrapper, class DiagonalMatrix, diagonal(), isDiagonal() + **/ +template +EIGEN_DEVICE_FUNC inline const DiagonalWrapper +MatrixBase::asDiagonal() const +{ + return DiagonalWrapper(derived()); +} + +/** \returns true if *this is approximately equal to a diagonal matrix, + * within the precision given by \a prec. + * + * Example: \include MatrixBase_isDiagonal.cpp + * Output: \verbinclude MatrixBase_isDiagonal.out + * + * \sa asDiagonal() + */ +template +bool MatrixBase::isDiagonal(const RealScalar& prec) const +{ + if(cols() != rows()) return false; + RealScalar maxAbsOnDiagonal = static_cast(-1); + for(Index j = 0; j < cols(); ++j) + { + RealScalar absOnDiagonal = numext::abs(coeff(j,j)); + if(absOnDiagonal > maxAbsOnDiagonal) maxAbsOnDiagonal = absOnDiagonal; + } + for(Index j = 0; j < cols(); ++j) + for(Index i = 0; i < j; ++i) + { + if(!internal::isMuchSmallerThan(coeff(i, j), maxAbsOnDiagonal, prec)) return false; + if(!internal::isMuchSmallerThan(coeff(j, i), maxAbsOnDiagonal, prec)) return false; + } + return true; +} + +namespace internal { + +template<> struct storage_kind_to_shape { typedef DiagonalShape Shape; }; + +struct Diagonal2Dense {}; + +template<> struct AssignmentKind { typedef Diagonal2Dense Kind; }; + +// Diagonal matrix to Dense assignment +template< typename DstXprType, typename SrcXprType, typename Functor> +struct Assignment +{ + static void run(DstXprType &dst, const SrcXprType &src, const internal::assign_op &/*func*/) + { + Index dstRows = src.rows(); + Index dstCols = src.cols(); + if((dst.rows()!=dstRows) || (dst.cols()!=dstCols)) + dst.resize(dstRows, dstCols); + + dst.setZero(); + dst.diagonal() = src.diagonal(); + } + + static void run(DstXprType &dst, const SrcXprType &src, const internal::add_assign_op &/*func*/) + { dst.diagonal() += src.diagonal(); } + + static void run(DstXprType &dst, const SrcXprType &src, const internal::sub_assign_op &/*func*/) + { dst.diagonal() -= src.diagonal(); } +}; + +} // namespace internal + +} // end namespace Eigen + +#endif // EIGEN_DIAGONALMATRIX_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/DiagonalProduct.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/DiagonalProduct.h new file mode 100644 index 0000000000000000000000000000000000000000..3cd34ba3f8ddb176652e628fff505b0dd6614e2a --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/DiagonalProduct.h @@ -0,0 +1,30 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008 Gael Guennebaud +// Copyright (C) 2007-2009 Benoit Jacob +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_DIAGONALPRODUCT_H +#define EIGEN_DIAGONALPRODUCT_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +/** \returns the diagonal matrix product of \c *this by the diagonal matrix \a diagonal. + */ +template +template +EIGEN_DEVICE_FUNC inline const Product +MatrixBase::operator*(const DiagonalBase &a_diagonal) const +{ + return Product(derived(),a_diagonal.derived()); +} + +} // end namespace Eigen + +#endif // EIGEN_DIAGONALPRODUCT_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Dot.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Dot.h new file mode 100644 index 0000000000000000000000000000000000000000..139e2ca98b1f57726a39940e670aa8c2d7be4163 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Dot.h @@ -0,0 +1,316 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2006-2008, 2010 Benoit Jacob +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_DOT_H +#define EIGEN_DOT_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { + +// helper function for dot(). The problem is that if we put that in the body of dot(), then upon calling dot +// with mismatched types, the compiler emits errors about failing to instantiate cwiseProduct BEFORE +// looking at the static assertions. Thus this is a trick to get better compile errors. +template +struct dot_nocheck +{ + typedef scalar_conj_product_op::Scalar,typename traits::Scalar> conj_prod; + typedef typename conj_prod::result_type ResScalar; + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE + static ResScalar run(const MatrixBase& a, const MatrixBase& b) + { + return a.template binaryExpr(b).sum(); + } +}; + +template +struct dot_nocheck +{ + typedef scalar_conj_product_op::Scalar,typename traits::Scalar> conj_prod; + typedef typename conj_prod::result_type ResScalar; + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE + static ResScalar run(const MatrixBase& a, const MatrixBase& b) + { + return a.transpose().template binaryExpr(b).sum(); + } +}; + +} // end namespace internal + +/** \fn MatrixBase::dot + * \returns the dot product of *this with other. + * + * \only_for_vectors + * + * \note If the scalar type is complex numbers, then this function returns the hermitian + * (sesquilinear) dot product, conjugate-linear in the first variable and linear in the + * second variable. + * + * \sa squaredNorm(), norm() + */ +template +template +EIGEN_DEVICE_FUNC +EIGEN_STRONG_INLINE +typename ScalarBinaryOpTraits::Scalar,typename internal::traits::Scalar>::ReturnType +MatrixBase::dot(const MatrixBase& other) const +{ + EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) + EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived) + EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(Derived,OtherDerived) +#if !(defined(EIGEN_NO_STATIC_ASSERT) && defined(EIGEN_NO_DEBUG)) + EIGEN_CHECK_BINARY_COMPATIBILIY( + Eigen::internal::scalar_conj_product_op, + Scalar, typename OtherDerived::Scalar); +#endif + + eigen_assert(size() == other.size()); + + return internal::dot_nocheck::run(*this, other); +} + +//---------- implementation of L2 norm and related functions ---------- + +/** \returns, for vectors, the squared \em l2 norm of \c *this, and for matrices the squared Frobenius norm. + * In both cases, it consists in the sum of the square of all the matrix entries. + * For vectors, this is also equals to the dot product of \c *this with itself. + * + * \sa dot(), norm(), lpNorm() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename NumTraits::Scalar>::Real MatrixBase::squaredNorm() const +{ + return numext::real((*this).cwiseAbs2().sum()); +} + +/** \returns, for vectors, the \em l2 norm of \c *this, and for matrices the Frobenius norm. + * In both cases, it consists in the square root of the sum of the square of all the matrix entries. + * For vectors, this is also equals to the square root of the dot product of \c *this with itself. + * + * \sa lpNorm(), dot(), squaredNorm() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename NumTraits::Scalar>::Real MatrixBase::norm() const +{ + return numext::sqrt(squaredNorm()); +} + +/** \returns an expression of the quotient of \c *this by its own norm. + * + * \warning If the input vector is too small (i.e., this->norm()==0), + * then this function returns a copy of the input. + * + * \only_for_vectors + * + * \sa norm(), normalize() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase::PlainObject +MatrixBase::normalized() const +{ + typedef typename internal::nested_eval::type Nested_; + Nested_ n(derived()); + RealScalar z = n.squaredNorm(); + // NOTE: after extensive benchmarking, this conditional does not impact performance, at least on recent x86 CPU + if(z>RealScalar(0)) + return n / numext::sqrt(z); + else + return n; +} + +/** Normalizes the vector, i.e. divides it by its own norm. + * + * \only_for_vectors + * + * \warning If the input vector is too small (i.e., this->norm()==0), then \c *this is left unchanged. + * + * \sa norm(), normalized() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void MatrixBase::normalize() +{ + RealScalar z = squaredNorm(); + // NOTE: after extensive benchmarking, this conditional does not impact performance, at least on recent x86 CPU + if(z>RealScalar(0)) + derived() /= numext::sqrt(z); +} + +/** \returns an expression of the quotient of \c *this by its own norm while avoiding underflow and overflow. + * + * \only_for_vectors + * + * This method is analogue to the normalized() method, but it reduces the risk of + * underflow and overflow when computing the norm. + * + * \warning If the input vector is too small (i.e., this->norm()==0), + * then this function returns a copy of the input. + * + * \sa stableNorm(), stableNormalize(), normalized() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase::PlainObject +MatrixBase::stableNormalized() const +{ + typedef typename internal::nested_eval::type Nested_; + Nested_ n(derived()); + RealScalar w = n.cwiseAbs().maxCoeff(); + RealScalar z = (n/w).squaredNorm(); + if(z>RealScalar(0)) + return n / (numext::sqrt(z)*w); + else + return n; +} + +/** Normalizes the vector while avoid underflow and overflow + * + * \only_for_vectors + * + * This method is analogue to the normalize() method, but it reduces the risk of + * underflow and overflow when computing the norm. + * + * \warning If the input vector is too small (i.e., this->norm()==0), then \c *this is left unchanged. + * + * \sa stableNorm(), stableNormalized(), normalize() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void MatrixBase::stableNormalize() +{ + RealScalar w = cwiseAbs().maxCoeff(); + RealScalar z = (derived()/w).squaredNorm(); + if(z>RealScalar(0)) + derived() /= numext::sqrt(z)*w; +} + +//---------- implementation of other norms ---------- + +namespace internal { + +template +struct lpNorm_selector +{ + typedef typename NumTraits::Scalar>::Real RealScalar; + EIGEN_DEVICE_FUNC + static inline RealScalar run(const MatrixBase& m) + { + EIGEN_USING_STD(pow) + return pow(m.cwiseAbs().array().pow(p).sum(), RealScalar(1)/p); + } +}; + +template +struct lpNorm_selector +{ + EIGEN_DEVICE_FUNC + static inline typename NumTraits::Scalar>::Real run(const MatrixBase& m) + { + return m.cwiseAbs().sum(); + } +}; + +template +struct lpNorm_selector +{ + EIGEN_DEVICE_FUNC + static inline typename NumTraits::Scalar>::Real run(const MatrixBase& m) + { + return m.norm(); + } +}; + +template +struct lpNorm_selector +{ + typedef typename NumTraits::Scalar>::Real RealScalar; + EIGEN_DEVICE_FUNC + static inline RealScalar run(const MatrixBase& m) + { + if(Derived::SizeAtCompileTime==0 || (Derived::SizeAtCompileTime==Dynamic && m.size()==0)) + return RealScalar(0); + return m.cwiseAbs().maxCoeff(); + } +}; + +} // end namespace internal + +/** \returns the \b coefficient-wise \f$ \ell^p \f$ norm of \c *this, that is, returns the p-th root of the sum of the p-th powers of the absolute values + * of the coefficients of \c *this. If \a p is the special value \a Eigen::Infinity, this function returns the \f$ \ell^\infty \f$ + * norm, that is the maximum of the absolute values of the coefficients of \c *this. + * + * In all cases, if \c *this is empty, then the value 0 is returned. + * + * \note For matrices, this function does not compute the operator-norm. That is, if \c *this is a matrix, then its coefficients are interpreted as a 1D vector. Nonetheless, you can easily compute the 1-norm and \f$\infty\f$-norm matrix operator norms using \link TutorialReductionsVisitorsBroadcastingReductionsNorm partial reductions \endlink. + * + * \sa norm() + */ +template +template +#ifndef EIGEN_PARSED_BY_DOXYGEN +EIGEN_DEVICE_FUNC inline typename NumTraits::Scalar>::Real +#else +EIGEN_DEVICE_FUNC MatrixBase::RealScalar +#endif +MatrixBase::lpNorm() const +{ + return internal::lpNorm_selector::run(*this); +} + +//---------- implementation of isOrthogonal / isUnitary ---------- + +/** \returns true if *this is approximately orthogonal to \a other, + * within the precision given by \a prec. + * + * Example: \include MatrixBase_isOrthogonal.cpp + * Output: \verbinclude MatrixBase_isOrthogonal.out + */ +template +template +bool MatrixBase::isOrthogonal +(const MatrixBase& other, const RealScalar& prec) const +{ + typename internal::nested_eval::type nested(derived()); + typename internal::nested_eval::type otherNested(other.derived()); + return numext::abs2(nested.dot(otherNested)) <= prec * prec * nested.squaredNorm() * otherNested.squaredNorm(); +} + +/** \returns true if *this is approximately an unitary matrix, + * within the precision given by \a prec. In the case where the \a Scalar + * type is real numbers, a unitary matrix is an orthogonal matrix, whence the name. + * + * \note This can be used to check whether a family of vectors forms an orthonormal basis. + * Indeed, \c m.isUnitary() returns true if and only if the columns (equivalently, the rows) of m form an + * orthonormal basis. + * + * Example: \include MatrixBase_isUnitary.cpp + * Output: \verbinclude MatrixBase_isUnitary.out + */ +template +bool MatrixBase::isUnitary(const RealScalar& prec) const +{ + typename internal::nested_eval::type self(derived()); + for(Index i = 0; i < cols(); ++i) + { + if(!internal::isApprox(self.col(i).squaredNorm(), static_cast(1), prec)) + return false; + for(Index j = 0; j < i; ++j) + if(!internal::isMuchSmallerThan(self.col(i).dot(self.col(j)), static_cast(1), prec)) + return false; + } + return true; +} + +} // end namespace Eigen + +#endif // EIGEN_DOT_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/EigenBase.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/EigenBase.h new file mode 100644 index 0000000000000000000000000000000000000000..105488dca0f9fc51dbfcc885a03f21b8b26ba725 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/EigenBase.h @@ -0,0 +1,162 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2009 Benoit Jacob +// Copyright (C) 2009 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_EIGENBASE_H +#define EIGEN_EIGENBASE_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +/** \class EigenBase + * \ingroup Core_Module + * + * Common base class for all classes T such that MatrixBase has an operator=(T) and a constructor MatrixBase(T). + * + * In other words, an EigenBase object is an object that can be copied into a MatrixBase. + * + * Besides MatrixBase-derived classes, this also includes special matrix classes such as diagonal matrices, etc. + * + * Notice that this class is trivial, it is only used to disambiguate overloaded functions. + * + * \sa \blank \ref TopicClassHierarchy + */ +template struct EigenBase +{ +// typedef typename internal::plain_matrix_type::type PlainObject; + + /** \brief The interface type of indices + * \details To change this, \c \#define the preprocessor symbol \c EIGEN_DEFAULT_DENSE_INDEX_TYPE. + * \sa StorageIndex, \ref TopicPreprocessorDirectives. + * DEPRECATED: Since Eigen 3.3, its usage is deprecated. Use Eigen::Index instead. + * Deprecation is not marked with a doxygen comment because there are too many existing usages to add the deprecation attribute. + */ + typedef Eigen::Index Index; + + // FIXME is it needed? + typedef typename internal::traits::StorageKind StorageKind; + + /** \returns a reference to the derived object */ + EIGEN_DEVICE_FUNC + Derived& derived() { return *static_cast(this); } + /** \returns a const reference to the derived object */ + EIGEN_DEVICE_FUNC + const Derived& derived() const { return *static_cast(this); } + + EIGEN_DEVICE_FUNC + inline Derived& const_cast_derived() const + { return *static_cast(const_cast(this)); } + EIGEN_DEVICE_FUNC + inline const Derived& const_derived() const + { return *static_cast(this); } + + /** \returns the number of rows. \sa cols(), RowsAtCompileTime */ + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index rows() const EIGEN_NOEXCEPT { return derived().rows(); } + /** \returns the number of columns. \sa rows(), ColsAtCompileTime*/ + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index cols() const EIGEN_NOEXCEPT { return derived().cols(); } + /** \returns the number of coefficients, which is rows()*cols(). + * \sa rows(), cols(), SizeAtCompileTime. */ + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index size() const EIGEN_NOEXCEPT { return rows() * cols(); } + + /** \internal Don't use it, but do the equivalent: \code dst = *this; \endcode */ + template + EIGEN_DEVICE_FUNC + inline void evalTo(Dest& dst) const + { derived().evalTo(dst); } + + /** \internal Don't use it, but do the equivalent: \code dst += *this; \endcode */ + template + EIGEN_DEVICE_FUNC + inline void addTo(Dest& dst) const + { + // This is the default implementation, + // derived class can reimplement it in a more optimized way. + typename Dest::PlainObject res(rows(),cols()); + evalTo(res); + dst += res; + } + + /** \internal Don't use it, but do the equivalent: \code dst -= *this; \endcode */ + template + EIGEN_DEVICE_FUNC + inline void subTo(Dest& dst) const + { + // This is the default implementation, + // derived class can reimplement it in a more optimized way. + typename Dest::PlainObject res(rows(),cols()); + evalTo(res); + dst -= res; + } + + /** \internal Don't use it, but do the equivalent: \code dst.applyOnTheRight(*this); \endcode */ + template + EIGEN_DEVICE_FUNC inline void applyThisOnTheRight(Dest& dst) const + { + // This is the default implementation, + // derived class can reimplement it in a more optimized way. + dst = dst * this->derived(); + } + + /** \internal Don't use it, but do the equivalent: \code dst.applyOnTheLeft(*this); \endcode */ + template + EIGEN_DEVICE_FUNC inline void applyThisOnTheLeft(Dest& dst) const + { + // This is the default implementation, + // derived class can reimplement it in a more optimized way. + dst = this->derived() * dst; + } + +}; + +/*************************************************************************** +* Implementation of matrix base methods +***************************************************************************/ + +/** \brief Copies the generic expression \a other into *this. + * + * \details The expression must provide a (templated) evalTo(Derived& dst) const + * function which does the actual job. In practice, this allows any user to write + * its own special matrix without having to modify MatrixBase + * + * \returns a reference to *this. + */ +template +template +EIGEN_DEVICE_FUNC +Derived& DenseBase::operator=(const EigenBase &other) +{ + call_assignment(derived(), other.derived()); + return derived(); +} + +template +template +EIGEN_DEVICE_FUNC +Derived& DenseBase::operator+=(const EigenBase &other) +{ + call_assignment(derived(), other.derived(), internal::add_assign_op()); + return derived(); +} + +template +template +EIGEN_DEVICE_FUNC +Derived& DenseBase::operator-=(const EigenBase &other) +{ + call_assignment(derived(), other.derived(), internal::sub_assign_op()); + return derived(); +} + +} // end namespace Eigen + +#endif // EIGEN_EIGENBASE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/ForceAlignedAccess.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/ForceAlignedAccess.h new file mode 100644 index 0000000000000000000000000000000000000000..b00785e3d27290b04dd67e771ce567fa0cb928a2 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/ForceAlignedAccess.h @@ -0,0 +1,152 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2009-2010 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_FORCEALIGNEDACCESS_H +#define EIGEN_FORCEALIGNEDACCESS_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +/** \class ForceAlignedAccess + * \ingroup Core_Module + * + * \brief Enforce aligned packet loads and stores regardless of what is requested + * + * \param ExpressionType the type of the object of which we are forcing aligned packet access + * + * This class is the return type of MatrixBase::forceAlignedAccess() + * and most of the time this is the only way it is used. + * + * \sa MatrixBase::forceAlignedAccess() + */ + +namespace internal { +template +struct traits > : public traits +{}; +} + +template class ForceAlignedAccess + : public internal::dense_xpr_base< ForceAlignedAccess >::type +{ + public: + + typedef typename internal::dense_xpr_base::type Base; + EIGEN_DENSE_PUBLIC_INTERFACE(ForceAlignedAccess) + + EIGEN_DEVICE_FUNC explicit inline ForceAlignedAccess(const ExpressionType& matrix) : m_expression(matrix) {} + + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index rows() const EIGEN_NOEXCEPT { return m_expression.rows(); } + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index cols() const EIGEN_NOEXCEPT { return m_expression.cols(); } + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index outerStride() const EIGEN_NOEXCEPT { return m_expression.outerStride(); } + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index innerStride() const EIGEN_NOEXCEPT { return m_expression.innerStride(); } + + EIGEN_DEVICE_FUNC inline const CoeffReturnType coeff(Index row, Index col) const + { + return m_expression.coeff(row, col); + } + + EIGEN_DEVICE_FUNC inline Scalar& coeffRef(Index row, Index col) + { + return m_expression.const_cast_derived().coeffRef(row, col); + } + + EIGEN_DEVICE_FUNC inline const CoeffReturnType coeff(Index index) const + { + return m_expression.coeff(index); + } + + EIGEN_DEVICE_FUNC inline Scalar& coeffRef(Index index) + { + return m_expression.const_cast_derived().coeffRef(index); + } + + template + inline const PacketScalar packet(Index row, Index col) const + { + return m_expression.template packet(row, col); + } + + template + inline void writePacket(Index row, Index col, const PacketScalar& x) + { + m_expression.const_cast_derived().template writePacket(row, col, x); + } + + template + inline const PacketScalar packet(Index index) const + { + return m_expression.template packet(index); + } + + template + inline void writePacket(Index index, const PacketScalar& x) + { + m_expression.const_cast_derived().template writePacket(index, x); + } + + EIGEN_DEVICE_FUNC operator const ExpressionType&() const { return m_expression; } + + protected: + const ExpressionType& m_expression; + + private: + ForceAlignedAccess& operator=(const ForceAlignedAccess&); +}; + +/** \returns an expression of *this with forced aligned access + * \sa forceAlignedAccessIf(),class ForceAlignedAccess + */ +template +inline const ForceAlignedAccess +MatrixBase::forceAlignedAccess() const +{ + return ForceAlignedAccess(derived()); +} + +/** \returns an expression of *this with forced aligned access + * \sa forceAlignedAccessIf(), class ForceAlignedAccess + */ +template +inline ForceAlignedAccess +MatrixBase::forceAlignedAccess() +{ + return ForceAlignedAccess(derived()); +} + +/** \returns an expression of *this with forced aligned access if \a Enable is true. + * \sa forceAlignedAccess(), class ForceAlignedAccess + */ +template +template +inline add_const_on_value_type_t,Derived&>> +MatrixBase::forceAlignedAccessIf() const +{ + return derived(); // FIXME This should not work but apparently is never used +} + +/** \returns an expression of *this with forced aligned access if \a Enable is true. + * \sa forceAlignedAccess(), class ForceAlignedAccess + */ +template +template +inline std::conditional_t,Derived&> +MatrixBase::forceAlignedAccessIf() +{ + return derived(); // FIXME This should not work but apparently is never used +} + +} // end namespace Eigen + +#endif // EIGEN_FORCEALIGNEDACCESS_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Fuzzy.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Fuzzy.h new file mode 100644 index 0000000000000000000000000000000000000000..1842b47639ad5806558fdeb11e597fefd623dedb --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Fuzzy.h @@ -0,0 +1,157 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2006-2008 Benoit Jacob +// Copyright (C) 2008 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_FUZZY_H +#define EIGEN_FUZZY_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal +{ + +template::IsInteger> +struct isApprox_selector +{ + EIGEN_DEVICE_FUNC + static bool run(const Derived& x, const OtherDerived& y, const typename Derived::RealScalar& prec) + { + typename internal::nested_eval::type nested(x); + typename internal::nested_eval::type otherNested(y); + return (nested.matrix() - otherNested.matrix()).cwiseAbs2().sum() <= prec * prec * numext::mini(nested.cwiseAbs2().sum(), otherNested.cwiseAbs2().sum()); + } +}; + +template +struct isApprox_selector +{ + EIGEN_DEVICE_FUNC + static bool run(const Derived& x, const OtherDerived& y, const typename Derived::RealScalar&) + { + return x.matrix() == y.matrix(); + } +}; + +template::IsInteger> +struct isMuchSmallerThan_object_selector +{ + EIGEN_DEVICE_FUNC + static bool run(const Derived& x, const OtherDerived& y, const typename Derived::RealScalar& prec) + { + return x.cwiseAbs2().sum() <= numext::abs2(prec) * y.cwiseAbs2().sum(); + } +}; + +template +struct isMuchSmallerThan_object_selector +{ + EIGEN_DEVICE_FUNC + static bool run(const Derived& x, const OtherDerived&, const typename Derived::RealScalar&) + { + return x.matrix() == Derived::Zero(x.rows(), x.cols()).matrix(); + } +}; + +template::IsInteger> +struct isMuchSmallerThan_scalar_selector +{ + EIGEN_DEVICE_FUNC + static bool run(const Derived& x, const typename Derived::RealScalar& y, const typename Derived::RealScalar& prec) + { + return x.cwiseAbs2().sum() <= numext::abs2(prec * y); + } +}; + +template +struct isMuchSmallerThan_scalar_selector +{ + EIGEN_DEVICE_FUNC + static bool run(const Derived& x, const typename Derived::RealScalar&, const typename Derived::RealScalar&) + { + return x.matrix() == Derived::Zero(x.rows(), x.cols()).matrix(); + } +}; + +} // end namespace internal + + +/** \returns \c true if \c *this is approximately equal to \a other, within the precision + * determined by \a prec. + * + * \note The fuzzy compares are done multiplicatively. Two vectors \f$ v \f$ and \f$ w \f$ + * are considered to be approximately equal within precision \f$ p \f$ if + * \f[ \Vert v - w \Vert \leqslant p\,\min(\Vert v\Vert, \Vert w\Vert). \f] + * For matrices, the comparison is done using the Hilbert-Schmidt norm (aka Frobenius norm + * L2 norm). + * + * \note Because of the multiplicativeness of this comparison, one can't use this function + * to check whether \c *this is approximately equal to the zero matrix or vector. + * Indeed, \c isApprox(zero) returns false unless \c *this itself is exactly the zero matrix + * or vector. If you want to test whether \c *this is zero, use internal::isMuchSmallerThan(const + * RealScalar&, RealScalar) instead. + * + * \sa internal::isMuchSmallerThan(const RealScalar&, RealScalar) const + */ +template +template +EIGEN_DEVICE_FUNC bool DenseBase::isApprox( + const DenseBase& other, + const RealScalar& prec +) const +{ + return internal::isApprox_selector::run(derived(), other.derived(), prec); +} + +/** \returns \c true if the norm of \c *this is much smaller than \a other, + * within the precision determined by \a prec. + * + * \note The fuzzy compares are done multiplicatively. A vector \f$ v \f$ is + * considered to be much smaller than \f$ x \f$ within precision \f$ p \f$ if + * \f[ \Vert v \Vert \leqslant p\,\vert x\vert. \f] + * + * For matrices, the comparison is done using the Hilbert-Schmidt norm. For this reason, + * the value of the reference scalar \a other should come from the Hilbert-Schmidt norm + * of a reference matrix of same dimensions. + * + * \sa isApprox(), isMuchSmallerThan(const DenseBase&, RealScalar) const + */ +template +EIGEN_DEVICE_FUNC bool DenseBase::isMuchSmallerThan( + const typename NumTraits::Real& other, + const RealScalar& prec +) const +{ + return internal::isMuchSmallerThan_scalar_selector::run(derived(), other, prec); +} + +/** \returns \c true if the norm of \c *this is much smaller than the norm of \a other, + * within the precision determined by \a prec. + * + * \note The fuzzy compares are done multiplicatively. A vector \f$ v \f$ is + * considered to be much smaller than a vector \f$ w \f$ within precision \f$ p \f$ if + * \f[ \Vert v \Vert \leqslant p\,\Vert w\Vert. \f] + * For matrices, the comparison is done using the Hilbert-Schmidt norm. + * + * \sa isApprox(), isMuchSmallerThan(const RealScalar&, RealScalar) const + */ +template +template +EIGEN_DEVICE_FUNC bool DenseBase::isMuchSmallerThan( + const DenseBase& other, + const RealScalar& prec +) const +{ + return internal::isMuchSmallerThan_object_selector::run(derived(), other.derived(), prec); +} + +} // end namespace Eigen + +#endif // EIGEN_FUZZY_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/GeneralProduct.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/GeneralProduct.h new file mode 100644 index 0000000000000000000000000000000000000000..9f693baa2c90912f235d6127a8e3b3359bacb225 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/GeneralProduct.h @@ -0,0 +1,467 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2006-2008 Benoit Jacob +// Copyright (C) 2008-2011 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_GENERAL_PRODUCT_H +#define EIGEN_GENERAL_PRODUCT_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +enum { + Large = 2, + Small = 3 +}; + +// Define the threshold value to fallback from the generic matrix-matrix product +// implementation (heavy) to the lightweight coeff-based product one. +// See generic_product_impl +// in products/GeneralMatrixMatrix.h for more details. +// TODO This threshold should also be used in the compile-time selector below. +#ifndef EIGEN_GEMM_TO_COEFFBASED_THRESHOLD +// This default value has been obtained on a Haswell architecture. +#define EIGEN_GEMM_TO_COEFFBASED_THRESHOLD 20 +#endif + +namespace internal { + +template struct product_type_selector; + +template struct product_size_category +{ + enum { + #ifndef EIGEN_GPU_COMPILE_PHASE + is_large = MaxSize == Dynamic || + Size >= EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD || + (Size==Dynamic && MaxSize>=EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD), + #else + is_large = 0, + #endif + value = is_large ? Large + : Size == 1 ? 1 + : Small + }; +}; + +template struct product_type +{ + typedef remove_all_t Lhs_; + typedef remove_all_t Rhs_; + enum { + MaxRows = traits::MaxRowsAtCompileTime, + Rows = traits::RowsAtCompileTime, + MaxCols = traits::MaxColsAtCompileTime, + Cols = traits::ColsAtCompileTime, + MaxDepth = min_size_prefer_fixed(traits::MaxColsAtCompileTime, + traits::MaxRowsAtCompileTime), + Depth = min_size_prefer_fixed(traits::ColsAtCompileTime, + traits::RowsAtCompileTime) + }; + + // the splitting into different lines of code here, introducing the _select enums and the typedef below, + // is to work around an internal compiler error with gcc 4.1 and 4.2. +private: + enum { + rows_select = product_size_category::value, + cols_select = product_size_category::value, + depth_select = product_size_category::value + }; + typedef product_type_selector selector; + +public: + enum { + value = selector::ret, + ret = selector::ret + }; +#ifdef EIGEN_DEBUG_PRODUCT + static void debug() + { + EIGEN_DEBUG_VAR(Rows); + EIGEN_DEBUG_VAR(Cols); + EIGEN_DEBUG_VAR(Depth); + EIGEN_DEBUG_VAR(rows_select); + EIGEN_DEBUG_VAR(cols_select); + EIGEN_DEBUG_VAR(depth_select); + EIGEN_DEBUG_VAR(value); + } +#endif +}; + +/* The following allows to select the kind of product at compile time + * based on the three dimensions of the product. + * This is a compile time mapping from {1,Small,Large}^3 -> {product types} */ +// FIXME I'm not sure the current mapping is the ideal one. +template struct product_type_selector { enum { ret = OuterProduct }; }; +template struct product_type_selector { enum { ret = LazyCoeffBasedProductMode }; }; +template struct product_type_selector<1, N, 1> { enum { ret = LazyCoeffBasedProductMode }; }; +template struct product_type_selector<1, 1, Depth> { enum { ret = InnerProduct }; }; +template<> struct product_type_selector<1, 1, 1> { enum { ret = InnerProduct }; }; +template<> struct product_type_selector { enum { ret = CoeffBasedProductMode }; }; +template<> struct product_type_selector<1, Small,Small> { enum { ret = CoeffBasedProductMode }; }; +template<> struct product_type_selector { enum { ret = CoeffBasedProductMode }; }; +template<> struct product_type_selector { enum { ret = LazyCoeffBasedProductMode }; }; +template<> struct product_type_selector { enum { ret = LazyCoeffBasedProductMode }; }; +template<> struct product_type_selector { enum { ret = LazyCoeffBasedProductMode }; }; +template<> struct product_type_selector<1, Large,Small> { enum { ret = CoeffBasedProductMode }; }; +template<> struct product_type_selector<1, Large,Large> { enum { ret = GemvProduct }; }; +template<> struct product_type_selector<1, Small,Large> { enum { ret = CoeffBasedProductMode }; }; +template<> struct product_type_selector { enum { ret = CoeffBasedProductMode }; }; +template<> struct product_type_selector { enum { ret = GemvProduct }; }; +template<> struct product_type_selector { enum { ret = CoeffBasedProductMode }; }; +template<> struct product_type_selector { enum { ret = GemmProduct }; }; +template<> struct product_type_selector { enum { ret = GemmProduct }; }; +template<> struct product_type_selector { enum { ret = GemmProduct }; }; +template<> struct product_type_selector { enum { ret = GemmProduct }; }; +template<> struct product_type_selector { enum { ret = CoeffBasedProductMode }; }; +template<> struct product_type_selector { enum { ret = CoeffBasedProductMode }; }; +template<> struct product_type_selector { enum { ret = GemmProduct }; }; + +} // end namespace internal + +/*********************************************************************** +* Implementation of Inner Vector Vector Product +***********************************************************************/ + +// FIXME : maybe the "inner product" could return a Scalar +// instead of a 1x1 matrix ?? +// Pro: more natural for the user +// Cons: this could be a problem if in a meta unrolled algorithm a matrix-matrix +// product ends up to a row-vector times col-vector product... To tackle this use +// case, we could have a specialization for Block with: operator=(Scalar x); + +/*********************************************************************** +* Implementation of Outer Vector Vector Product +***********************************************************************/ + +/*********************************************************************** +* Implementation of General Matrix Vector Product +***********************************************************************/ + +/* According to the shape/flags of the matrix we have to distinghish 3 different cases: + * 1 - the matrix is col-major, BLAS compatible and M is large => call fast BLAS-like colmajor routine + * 2 - the matrix is row-major, BLAS compatible and N is large => call fast BLAS-like rowmajor routine + * 3 - all other cases are handled using a simple loop along the outer-storage direction. + * Therefore we need a lower level meta selector. + * Furthermore, if the matrix is the rhs, then the product has to be transposed. + */ +namespace internal { + +template +struct gemv_dense_selector; + +} // end namespace internal + +namespace internal { + +template struct gemv_static_vector_if; + +template +struct gemv_static_vector_if +{ + EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Scalar* data() { eigen_internal_assert(false && "should never be called"); return 0; } +}; + +template +struct gemv_static_vector_if +{ + EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Scalar* data() { return 0; } +}; + +template +struct gemv_static_vector_if +{ + enum { + ForceAlignment = internal::packet_traits::Vectorizable, + PacketSize = internal::packet_traits::size + }; + #if EIGEN_MAX_STATIC_ALIGN_BYTES!=0 + internal::plain_array m_data; + EIGEN_STRONG_INLINE Scalar* data() { return m_data.array; } + #else + // Some architectures cannot align on the stack, + // => let's manually enforce alignment by allocating more data and return the address of the first aligned element. + internal::plain_array m_data; + EIGEN_STRONG_INLINE Scalar* data() { + return ForceAlignment + ? reinterpret_cast((std::uintptr_t(m_data.array) & ~(std::size_t(EIGEN_MAX_ALIGN_BYTES-1))) + EIGEN_MAX_ALIGN_BYTES) + : m_data.array; + } + #endif +}; + +// The vector is on the left => transposition +template +struct gemv_dense_selector +{ + template + static void run(const Lhs &lhs, const Rhs &rhs, Dest& dest, const typename Dest::Scalar& alpha) + { + Transpose destT(dest); + enum { OtherStorageOrder = StorageOrder == RowMajor ? ColMajor : RowMajor }; + gemv_dense_selector + ::run(rhs.transpose(), lhs.transpose(), destT, alpha); + } +}; + +template<> struct gemv_dense_selector +{ + template + static inline void run(const Lhs &lhs, const Rhs &rhs, Dest& dest, const typename Dest::Scalar& alpha) + { + typedef typename Lhs::Scalar LhsScalar; + typedef typename Rhs::Scalar RhsScalar; + typedef typename Dest::Scalar ResScalar; + + typedef internal::blas_traits LhsBlasTraits; + typedef typename LhsBlasTraits::DirectLinearAccessType ActualLhsType; + typedef internal::blas_traits RhsBlasTraits; + typedef typename RhsBlasTraits::DirectLinearAccessType ActualRhsType; + + typedef Map, plain_enum_min(AlignedMax, internal::packet_traits::size)> MappedDest; + + ActualLhsType actualLhs = LhsBlasTraits::extract(lhs); + ActualRhsType actualRhs = RhsBlasTraits::extract(rhs); + + ResScalar actualAlpha = combine_scalar_factors(alpha, lhs, rhs); + + // make sure Dest is a compile-time vector type (bug 1166) + typedef std::conditional_t ActualDest; + + enum { + // FIXME find a way to allow an inner stride on the result if packet_traits::size==1 + // on, the other hand it is good for the cache to pack the vector anyways... + EvalToDestAtCompileTime = (ActualDest::InnerStrideAtCompileTime==1), + ComplexByReal = (NumTraits::IsComplex) && (!NumTraits::IsComplex), + MightCannotUseDest = ((!EvalToDestAtCompileTime) || ComplexByReal) && (ActualDest::MaxSizeAtCompileTime!=0) + }; + + typedef const_blas_data_mapper LhsMapper; + typedef const_blas_data_mapper RhsMapper; + RhsScalar compatibleAlpha = get_factor::run(actualAlpha); + + if(!MightCannotUseDest) + { + // shortcut if we are sure to be able to use dest directly, + // this ease the compiler to generate cleaner and more optimzized code for most common cases + general_matrix_vector_product + ::run( + actualLhs.rows(), actualLhs.cols(), + LhsMapper(actualLhs.data(), actualLhs.outerStride()), + RhsMapper(actualRhs.data(), actualRhs.innerStride()), + dest.data(), 1, + compatibleAlpha); + } + else + { + gemv_static_vector_if static_dest; + + const bool alphaIsCompatible = (!ComplexByReal) || (numext::is_exactly_zero(numext::imag(actualAlpha))); + const bool evalToDest = EvalToDestAtCompileTime && alphaIsCompatible; + + ei_declare_aligned_stack_constructed_variable(ResScalar,actualDestPtr,dest.size(), + evalToDest ? dest.data() : static_dest.data()); + + if(!evalToDest) + { + #ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN + Index size = dest.size(); + EIGEN_DENSE_STORAGE_CTOR_PLUGIN + #endif + if(!alphaIsCompatible) + { + MappedDest(actualDestPtr, dest.size()).setZero(); + compatibleAlpha = RhsScalar(1); + } + else + MappedDest(actualDestPtr, dest.size()) = dest; + } + + general_matrix_vector_product + ::run( + actualLhs.rows(), actualLhs.cols(), + LhsMapper(actualLhs.data(), actualLhs.outerStride()), + RhsMapper(actualRhs.data(), actualRhs.innerStride()), + actualDestPtr, 1, + compatibleAlpha); + + if (!evalToDest) + { + if(!alphaIsCompatible) + dest.matrix() += actualAlpha * MappedDest(actualDestPtr, dest.size()); + else + dest = MappedDest(actualDestPtr, dest.size()); + } + } + } +}; + +template<> struct gemv_dense_selector +{ + template + static void run(const Lhs &lhs, const Rhs &rhs, Dest& dest, const typename Dest::Scalar& alpha) + { + typedef typename Lhs::Scalar LhsScalar; + typedef typename Rhs::Scalar RhsScalar; + typedef typename Dest::Scalar ResScalar; + + typedef internal::blas_traits LhsBlasTraits; + typedef typename LhsBlasTraits::DirectLinearAccessType ActualLhsType; + typedef internal::blas_traits RhsBlasTraits; + typedef typename RhsBlasTraits::DirectLinearAccessType ActualRhsType; + typedef internal::remove_all_t ActualRhsTypeCleaned; + + std::add_const_t actualLhs = LhsBlasTraits::extract(lhs); + std::add_const_t actualRhs = RhsBlasTraits::extract(rhs); + + ResScalar actualAlpha = combine_scalar_factors(alpha, lhs, rhs); + + enum { + // FIXME find a way to allow an inner stride on the result if packet_traits::size==1 + // on, the other hand it is good for the cache to pack the vector anyways... + DirectlyUseRhs = ActualRhsTypeCleaned::InnerStrideAtCompileTime==1 || ActualRhsTypeCleaned::MaxSizeAtCompileTime==0 + }; + + gemv_static_vector_if static_rhs; + + ei_declare_aligned_stack_constructed_variable(RhsScalar,actualRhsPtr,actualRhs.size(), + DirectlyUseRhs ? const_cast(actualRhs.data()) : static_rhs.data()); + + if(!DirectlyUseRhs) + { + #ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN + Index size = actualRhs.size(); + EIGEN_DENSE_STORAGE_CTOR_PLUGIN + #endif + Map(actualRhsPtr, actualRhs.size()) = actualRhs; + } + + typedef const_blas_data_mapper LhsMapper; + typedef const_blas_data_mapper RhsMapper; + general_matrix_vector_product + ::run( + actualLhs.rows(), actualLhs.cols(), + LhsMapper(actualLhs.data(), actualLhs.outerStride()), + RhsMapper(actualRhsPtr, 1), + dest.data(), dest.col(0).innerStride(), //NOTE if dest is not a vector at compile-time, then dest.innerStride() might be wrong. (bug 1166) + actualAlpha); + } +}; + +template<> struct gemv_dense_selector +{ + template + static void run(const Lhs &lhs, const Rhs &rhs, Dest& dest, const typename Dest::Scalar& alpha) + { + EIGEN_STATIC_ASSERT((!nested_eval::Evaluate),EIGEN_INTERNAL_COMPILATION_ERROR_OR_YOU_MADE_A_PROGRAMMING_MISTAKE); + // TODO if rhs is large enough it might be beneficial to make sure that dest is sequentially stored in memory, otherwise use a temp + typename nested_eval::type actual_rhs(rhs); + const Index size = rhs.rows(); + for(Index k=0; k struct gemv_dense_selector +{ + template + static void run(const Lhs &lhs, const Rhs &rhs, Dest& dest, const typename Dest::Scalar& alpha) + { + EIGEN_STATIC_ASSERT((!nested_eval::Evaluate),EIGEN_INTERNAL_COMPILATION_ERROR_OR_YOU_MADE_A_PROGRAMMING_MISTAKE); + typename nested_eval::type actual_rhs(rhs); + const Index rows = dest.rows(); + for(Index i=0; i +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE +const Product +MatrixBase::operator*(const MatrixBase &other) const +{ + // A note regarding the function declaration: In MSVC, this function will sometimes + // not be inlined since DenseStorage is an unwindable object for dynamic + // matrices and product types are holding a member to store the result. + // Thus it does not help tagging this function with EIGEN_STRONG_INLINE. + enum { + ProductIsValid = Derived::ColsAtCompileTime==Dynamic + || OtherDerived::RowsAtCompileTime==Dynamic + || int(Derived::ColsAtCompileTime)==int(OtherDerived::RowsAtCompileTime), + AreVectors = Derived::IsVectorAtCompileTime && OtherDerived::IsVectorAtCompileTime, + SameSizes = EIGEN_PREDICATE_SAME_MATRIX_SIZE(Derived,OtherDerived) + }; + // note to the lost user: + // * for a dot product use: v1.dot(v2) + // * for a coeff-wise product use: v1.cwiseProduct(v2) + EIGEN_STATIC_ASSERT(ProductIsValid || !(AreVectors && SameSizes), + INVALID_VECTOR_VECTOR_PRODUCT__IF_YOU_WANTED_A_DOT_OR_COEFF_WISE_PRODUCT_YOU_MUST_USE_THE_EXPLICIT_FUNCTIONS) + EIGEN_STATIC_ASSERT(ProductIsValid || !(SameSizes && !AreVectors), + INVALID_MATRIX_PRODUCT__IF_YOU_WANTED_A_COEFF_WISE_PRODUCT_YOU_MUST_USE_THE_EXPLICIT_FUNCTION) + EIGEN_STATIC_ASSERT(ProductIsValid || SameSizes, INVALID_MATRIX_PRODUCT) +#ifdef EIGEN_DEBUG_PRODUCT + internal::product_type::debug(); +#endif + + return Product(derived(), other.derived()); +} + +/** \returns an expression of the matrix product of \c *this and \a other without implicit evaluation. + * + * The returned product will behave like any other expressions: the coefficients of the product will be + * computed once at a time as requested. This might be useful in some extremely rare cases when only + * a small and no coherent fraction of the result's coefficients have to be computed. + * + * \warning This version of the matrix product can be much much slower. So use it only if you know + * what you are doing and that you measured a true speed improvement. + * + * \sa operator*(const MatrixBase&) + */ +template +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE +const Product +MatrixBase::lazyProduct(const MatrixBase &other) const +{ + enum { + ProductIsValid = Derived::ColsAtCompileTime==Dynamic + || OtherDerived::RowsAtCompileTime==Dynamic + || int(Derived::ColsAtCompileTime)==int(OtherDerived::RowsAtCompileTime), + AreVectors = Derived::IsVectorAtCompileTime && OtherDerived::IsVectorAtCompileTime, + SameSizes = EIGEN_PREDICATE_SAME_MATRIX_SIZE(Derived,OtherDerived) + }; + // note to the lost user: + // * for a dot product use: v1.dot(v2) + // * for a coeff-wise product use: v1.cwiseProduct(v2) + EIGEN_STATIC_ASSERT(ProductIsValid || !(AreVectors && SameSizes), + INVALID_VECTOR_VECTOR_PRODUCT__IF_YOU_WANTED_A_DOT_OR_COEFF_WISE_PRODUCT_YOU_MUST_USE_THE_EXPLICIT_FUNCTIONS) + EIGEN_STATIC_ASSERT(ProductIsValid || !(SameSizes && !AreVectors), + INVALID_MATRIX_PRODUCT__IF_YOU_WANTED_A_COEFF_WISE_PRODUCT_YOU_MUST_USE_THE_EXPLICIT_FUNCTION) + EIGEN_STATIC_ASSERT(ProductIsValid || SameSizes, INVALID_MATRIX_PRODUCT) + + return Product(derived(), other.derived()); +} + +} // end namespace Eigen + +#endif // EIGEN_PRODUCT_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/GenericPacketMath.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/GenericPacketMath.h new file mode 100644 index 0000000000000000000000000000000000000000..f3d607aeb0aa6de1429018cb5972a54ecc2fff93 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/GenericPacketMath.h @@ -0,0 +1,1392 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008 Gael Guennebaud +// Copyright (C) 2006-2008 Benoit Jacob +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_GENERIC_PACKET_MATH_H +#define EIGEN_GENERIC_PACKET_MATH_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { + +/** \internal + * \file GenericPacketMath.h + * + * Default implementation for types not supported by the vectorization. + * In practice these functions are provided to make easier the writing + * of generic vectorized code. + */ + +#ifndef EIGEN_DEBUG_ALIGNED_LOAD +#define EIGEN_DEBUG_ALIGNED_LOAD +#endif + +#ifndef EIGEN_DEBUG_UNALIGNED_LOAD +#define EIGEN_DEBUG_UNALIGNED_LOAD +#endif + +#ifndef EIGEN_DEBUG_ALIGNED_STORE +#define EIGEN_DEBUG_ALIGNED_STORE +#endif + +#ifndef EIGEN_DEBUG_UNALIGNED_STORE +#define EIGEN_DEBUG_UNALIGNED_STORE +#endif + +struct default_packet_traits +{ + enum { + HasAdd = 1, + HasSub = 1, + HasShift = 1, + HasMul = 1, + HasNegate = 1, + HasAbs = 1, + HasArg = 0, + HasAbs2 = 1, + HasAbsDiff = 0, + HasMin = 1, + HasMax = 1, + HasConj = 1, + HasSetLinear = 1, + HasSign = 1, + HasBlend = 0, + // This flag is used to indicate whether packet comparison is supported. + // pcmp_eq, pcmp_lt and pcmp_le should be defined for it to be true. + HasCmp = 0, + + HasDiv = 0, + HasReciprocal = 0, + HasSqrt = 0, + HasRsqrt = 0, + HasExp = 0, + HasExpm1 = 0, + HasLog = 0, + HasLog1p = 0, + HasLog10 = 0, + HasPow = 0, + + HasSin = 0, + HasCos = 0, + HasTan = 0, + HasASin = 0, + HasACos = 0, + HasATan = 0, + HasATanh = 0, + HasSinh = 0, + HasCosh = 0, + HasTanh = 0, + HasLGamma = 0, + HasDiGamma = 0, + HasZeta = 0, + HasPolygamma = 0, + HasErf = 0, + HasErfc = 0, + HasNdtri = 0, + HasBessel = 0, + HasIGamma = 0, + HasIGammaDerA = 0, + HasGammaSampleDerAlpha = 0, + HasIGammac = 0, + HasBetaInc = 0, + + HasRound = 0, + HasRint = 0, + HasFloor = 0, + HasCeil = 0 + }; +}; + +template struct packet_traits : default_packet_traits +{ + typedef T type; + typedef T half; + enum { + Vectorizable = 0, + size = 1, + AlignedOnScalar = 0, + }; + enum { + HasAdd = 0, + HasSub = 0, + HasMul = 0, + HasNegate = 0, + HasAbs = 0, + HasAbs2 = 0, + HasMin = 0, + HasMax = 0, + HasConj = 0, + HasSetLinear = 0 + }; +}; + +template struct packet_traits : packet_traits { }; + +template struct unpacket_traits +{ + typedef T type; + typedef T half; + enum + { + size = 1, + alignment = 1, + vectorizable = false, + masked_load_available=false, + masked_store_available=false + }; +}; + +template struct unpacket_traits : unpacket_traits { }; + +/** \internal A convenience utility for determining if the type is a scalar. + * This is used to enable some generic packet implementations. + */ +template +struct is_scalar { + using Scalar = typename unpacket_traits::type; + enum { value = internal::is_same::value }; +}; + +// automatically and succinctly define combinations of pcast when +// 1) the packets are the same type, or +// 2) the packets differ only in sign. +// In both of these cases, preinterpret (bit_cast) is equivalent to pcast (static_cast) +template ::value && is_scalar::value> +struct is_degenerate_helper : is_same {}; +template <> +struct is_degenerate_helper : std::true_type {}; +template <> +struct is_degenerate_helper : std::true_type {}; +template <> +struct is_degenerate_helper : std::true_type {}; +template <> +struct is_degenerate_helper : std::true_type {}; + +template +struct is_degenerate_helper { + using SrcScalar = typename unpacket_traits::type; + static constexpr int SrcSize = unpacket_traits::size; + using TgtScalar = typename unpacket_traits::type; + static constexpr int TgtSize = unpacket_traits::size; + static constexpr bool value = is_degenerate_helper::value && (SrcSize == TgtSize); +}; + +// is_degenerate::value == is_degenerate::value +template +struct is_degenerate { + static constexpr bool value = + is_degenerate_helper::value || is_degenerate_helper::value; +}; + +template +struct is_half { + using Scalar = typename unpacket_traits::type; + static constexpr int Size = unpacket_traits::size; + using DefaultPacket = typename packet_traits::type; + static constexpr int DefaultSize = unpacket_traits::size; + static constexpr bool value = Size < DefaultSize; +}; + +template +struct type_casting_traits { + enum { + VectorizedCast = + is_degenerate::value && packet_traits::Vectorizable && packet_traits::Vectorizable, + SrcCoeffRatio = 1, + TgtCoeffRatio = 1 + }; +}; + +// provides a succint template to define vectorized casting traits with respect to the largest accessible packet types +template +struct vectorized_type_casting_traits { + enum : int { + DefaultSrcPacketSize = packet_traits::size, + DefaultTgtPacketSize = packet_traits::size, + VectorizedCast = 1, + SrcCoeffRatio = plain_enum_max(DefaultTgtPacketSize / DefaultSrcPacketSize, 1), + TgtCoeffRatio = plain_enum_max(DefaultSrcPacketSize / DefaultTgtPacketSize, 1) + }; +}; + +/** \internal Wrapper to ensure that multiple packet types can map to the same + same underlying vector type. */ +template +struct eigen_packet_wrapper +{ + EIGEN_ALWAYS_INLINE operator T&() { return m_val; } + EIGEN_ALWAYS_INLINE operator const T&() const { return m_val; } + EIGEN_ALWAYS_INLINE eigen_packet_wrapper() = default; + EIGEN_ALWAYS_INLINE eigen_packet_wrapper(const T &v) : m_val(v) {} + EIGEN_ALWAYS_INLINE eigen_packet_wrapper& operator=(const T &v) { + m_val = v; + return *this; + } + + T m_val; +}; + +template ::value> +struct preinterpret_generic; + +template +struct preinterpret_generic { + // the packets are not the same, attempt scalar bit_cast + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Target run(const Packet& a) { + return numext::bit_cast(a); + } +}; + +template +struct preinterpret_generic { + // the packets are the same type: do nothing + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet run(const Packet& a) { return a; } +}; + +/** \internal \returns reinterpret_cast(a) */ +template +EIGEN_DEVICE_FUNC inline Target preinterpret(const Packet& a) { + return preinterpret_generic::run(a); +} + +template ::value, bool TgtIsHalf = is_half::value> +struct pcast_generic; + +template +struct pcast_generic { + // the packets are not degenerate: attempt scalar static_cast + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TgtPacket run(const SrcPacket& a) { + return cast_impl::run(a); + } +}; + +template +struct pcast_generic { + // the packets are the same: do nothing + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet run(const Packet& a) { return a; } +}; + +template +struct pcast_generic { + // the packets are degenerate: preinterpret is equivalent to pcast + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TgtPacket run(const SrcPacket& a) { return preinterpret(a); } +}; + + + +/** \internal \returns static_cast(a) (coeff-wise) */ +template +EIGEN_DEVICE_FUNC inline TgtPacket pcast(const SrcPacket& a) { + return pcast_generic::run(a); +} +template +EIGEN_DEVICE_FUNC inline TgtPacket pcast(const SrcPacket& a, const SrcPacket& b) { + return pcast_generic::run(a, b); +} +template +EIGEN_DEVICE_FUNC inline TgtPacket pcast(const SrcPacket& a, const SrcPacket& b, const SrcPacket& c, + const SrcPacket& d) { + return pcast_generic::run(a, b, c, d); +} +template +EIGEN_DEVICE_FUNC inline TgtPacket pcast(const SrcPacket& a, const SrcPacket& b, const SrcPacket& c, const SrcPacket& d, + const SrcPacket& e, const SrcPacket& f, const SrcPacket& g, + const SrcPacket& h) { + return pcast_generic::run(a, b, c, d, e, f, g, h); +} + +template +struct pcast_generic { + // TgtPacket is a half packet of some other type + // perform cast and truncate result + using DefaultTgtPacket = typename is_half::DefaultPacket; + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TgtPacket run(const SrcPacket& a) { + return preinterpret(pcast(a)); + } +}; + +/** \internal \returns a + b (coeff-wise) */ +template EIGEN_DEVICE_FUNC inline Packet +padd(const Packet& a, const Packet& b) { return a+b; } +// Avoid compiler warning for boolean algebra. +template<> EIGEN_DEVICE_FUNC inline bool +padd(const bool& a, const bool& b) { return a || b; } + +/** \internal \returns a packet version of \a *from, (un-aligned masked add) + * There is no generic implementation. We only have implementations for specialized + * cases. Generic case should not be called. + */ +template EIGEN_DEVICE_FUNC inline +std::enable_if_t::masked_fpops_available, Packet> +padd(const Packet& a, const Packet& b, typename unpacket_traits::mask_t umask); + + +/** \internal \returns a - b (coeff-wise) */ +template EIGEN_DEVICE_FUNC inline Packet +psub(const Packet& a, const Packet& b) { return a-b; } + +/** \internal \returns -a (coeff-wise) */ +template EIGEN_DEVICE_FUNC inline Packet +pnegate(const Packet& a) { return -a; } + +template<> EIGEN_DEVICE_FUNC inline bool +pnegate(const bool& a) { return !a; } + +/** \internal \returns conj(a) (coeff-wise) */ +template EIGEN_DEVICE_FUNC inline Packet +pconj(const Packet& a) { return numext::conj(a); } + +/** \internal \returns a * b (coeff-wise) */ +template EIGEN_DEVICE_FUNC inline Packet +pmul(const Packet& a, const Packet& b) { return a*b; } +// Avoid compiler warning for boolean algebra. +template<> EIGEN_DEVICE_FUNC inline bool +pmul(const bool& a, const bool& b) { return a && b; } + +/** \internal \returns a / b (coeff-wise) */ +template EIGEN_DEVICE_FUNC inline Packet +pdiv(const Packet& a, const Packet& b) { return a/b; } + +// In the generic case, memset to all one bits. +template +struct ptrue_impl { + static EIGEN_DEVICE_FUNC inline Packet run(const Packet& /*a*/){ + Packet b; + memset(static_cast(&b), 0xff, sizeof(Packet)); + return b; + } +}; + +// For non-trivial scalars, set to Scalar(1) (i.e. a non-zero value). +// Although this is technically not a valid bitmask, the scalar path for pselect +// uses a comparison to zero, so this should still work in most cases. We don't +// have another option, since the scalar type requires initialization. +template +struct ptrue_impl::value && NumTraits::RequireInitialization> > { + static EIGEN_DEVICE_FUNC inline T run(const T& /*a*/){ + return T(1); + } +}; + +/** \internal \returns one bits. */ +template EIGEN_DEVICE_FUNC inline Packet +ptrue(const Packet& a) { + return ptrue_impl::run(a); +} + +// In the general case, memset to zero. +template +struct pzero_impl { + static EIGEN_DEVICE_FUNC inline Packet run(const Packet& /*a*/) { + Packet b; + memset(static_cast(&b), 0x00, sizeof(Packet)); + return b; + } +}; + +// For scalars, explicitly set to Scalar(0), since the underlying representation +// for zero may not consist of all-zero bits. +template +struct pzero_impl::value>> { + static EIGEN_DEVICE_FUNC inline T run(const T& /*a*/) { + return T(0); + } +}; + +/** \internal \returns packet of zeros */ +template EIGEN_DEVICE_FUNC inline Packet +pzero(const Packet& a) { + return pzero_impl::run(a); +} + +/** \internal \returns a <= b as a bit mask */ +template EIGEN_DEVICE_FUNC inline Packet +pcmp_le(const Packet& a, const Packet& b) { return a<=b ? ptrue(a) : pzero(a); } + +/** \internal \returns a < b as a bit mask */ +template EIGEN_DEVICE_FUNC inline Packet +pcmp_lt(const Packet& a, const Packet& b) { return a EIGEN_DEVICE_FUNC inline Packet +pcmp_eq(const Packet& a, const Packet& b) { return a==b ? ptrue(a) : pzero(a); } + +/** \internal \returns a < b or a==NaN or b==NaN as a bit mask */ +template EIGEN_DEVICE_FUNC inline Packet +pcmp_lt_or_nan(const Packet& a, const Packet& b) { return a>=b ? pzero(a) : ptrue(a); } + +template +struct bit_and { + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE T operator()(const T& a, const T& b) const { + return a & b; + } +}; + +template +struct bit_or { + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE T operator()(const T& a, const T& b) const { + return a | b; + } +}; + +template +struct bit_xor { + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE T operator()(const T& a, const T& b) const { + return a ^ b; + } +}; + +template +struct bit_not { + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE T operator()(const T& a) const { + return ~a; + } +}; + +// Use operators &, |, ^, ~. +template +struct operator_bitwise_helper { + EIGEN_DEVICE_FUNC static inline T bitwise_and(const T& a, const T& b) { return bit_and()(a, b); } + EIGEN_DEVICE_FUNC static inline T bitwise_or(const T& a, const T& b) { return bit_or()(a, b); } + EIGEN_DEVICE_FUNC static inline T bitwise_xor(const T& a, const T& b) { return bit_xor()(a, b); } + EIGEN_DEVICE_FUNC static inline T bitwise_not(const T& a) { return bit_not()(a); } +}; + +// Apply binary operations byte-by-byte +template +struct bytewise_bitwise_helper { + EIGEN_DEVICE_FUNC static inline T bitwise_and(const T& a, const T& b) { + return binary(a, b, bit_and()); + } + EIGEN_DEVICE_FUNC static inline T bitwise_or(const T& a, const T& b) { + return binary(a, b, bit_or()); + } + EIGEN_DEVICE_FUNC static inline T bitwise_xor(const T& a, const T& b) { + return binary(a, b, bit_xor()); + } + EIGEN_DEVICE_FUNC static inline T bitwise_not(const T& a) { + return unary(a,bit_not()); + } + + private: + template + EIGEN_DEVICE_FUNC static inline T unary(const T& a, Op op) { + const unsigned char* a_ptr = reinterpret_cast(&a); + T c; + unsigned char* c_ptr = reinterpret_cast(&c); + for (size_t i = 0; i < sizeof(T); ++i) { + *c_ptr++ = op(*a_ptr++); + } + return c; + } + + template + EIGEN_DEVICE_FUNC static inline T binary(const T& a, const T& b, Op op) { + const unsigned char* a_ptr = reinterpret_cast(&a); + const unsigned char* b_ptr = reinterpret_cast(&b); + T c; + unsigned char* c_ptr = reinterpret_cast(&c); + for (size_t i = 0; i < sizeof(T); ++i) { + *c_ptr++ = op(*a_ptr++, *b_ptr++); + } + return c; + } +}; + +// In the general case, use byte-by-byte manipulation. +template +struct bitwise_helper : public bytewise_bitwise_helper {}; + +// For integers or non-trivial scalars, use binary operators. +template +struct bitwise_helper::value && (NumTraits::IsInteger || NumTraits::RequireInitialization)> + > : public operator_bitwise_helper {}; + +/** \internal \returns the bitwise and of \a a and \a b */ +template EIGEN_DEVICE_FUNC inline Packet +pand(const Packet& a, const Packet& b) { + return bitwise_helper::bitwise_and(a, b); +} + +/** \internal \returns the bitwise or of \a a and \a b */ +template EIGEN_DEVICE_FUNC inline Packet +por(const Packet& a, const Packet& b) { + return bitwise_helper::bitwise_or(a, b); +} + +/** \internal \returns the bitwise xor of \a a and \a b */ +template EIGEN_DEVICE_FUNC inline Packet +pxor(const Packet& a, const Packet& b) { + return bitwise_helper::bitwise_xor(a, b); +} + +/** \internal \returns the bitwise not of \a a */ +template EIGEN_DEVICE_FUNC inline Packet +pnot(const Packet& a) { + return bitwise_helper::bitwise_not(a); +} + +/** \internal \returns the bitwise and of \a a and not \a b */ +template EIGEN_DEVICE_FUNC inline Packet +pandnot(const Packet& a, const Packet& b) { return pand(a, pnot(b)); } + +/** \internal \returns isnan(a) */ +template EIGEN_DEVICE_FUNC inline Packet +pisnan(const Packet& a) { + return pandnot(ptrue(a), pcmp_eq(a, a)); +} + +// In the general case, use bitwise select. +template +struct pselect_impl { + static EIGEN_DEVICE_FUNC inline Packet run(const Packet& mask, const Packet& a, const Packet& b) { + return por(pand(a,mask),pandnot(b,mask)); + } +}; + +// For scalars, use ternary select. +template +struct pselect_impl::value> > { + static EIGEN_DEVICE_FUNC inline Packet run(const Packet& mask, const Packet& a, const Packet& b) { + return numext::equal_strict(mask, Packet(0)) ? b : a; + } +}; + +/** \internal \returns \a or \b for each field in packet according to \mask */ +template EIGEN_DEVICE_FUNC inline Packet +pselect(const Packet& mask, const Packet& a, const Packet& b) { + return pselect_impl::run(mask, a, b); +} + +template<> EIGEN_DEVICE_FUNC inline bool pselect( + const bool& cond, const bool& a, const bool& b) { + return cond ? a : b; +} + +/** \internal \returns the min or of \a a and \a b (coeff-wise) + If either \a a or \a b are NaN, the result is implementation defined. */ +template +struct pminmax_impl { + template + static EIGEN_DEVICE_FUNC inline Packet run(const Packet& a, const Packet& b, Op op) { + return op(a,b); + } +}; + +/** \internal \returns the min or max of \a a and \a b (coeff-wise) + If either \a a or \a b are NaN, NaN is returned. */ +template<> +struct pminmax_impl { + template + static EIGEN_DEVICE_FUNC inline Packet run(const Packet& a, const Packet& b, Op op) { + Packet not_nan_mask_a = pcmp_eq(a, a); + Packet not_nan_mask_b = pcmp_eq(b, b); + return pselect(not_nan_mask_a, + pselect(not_nan_mask_b, op(a, b), b), + a); + } +}; + +/** \internal \returns the min or max of \a a and \a b (coeff-wise) + If both \a a and \a b are NaN, NaN is returned. + Equivalent to std::fmin(a, b). */ +template<> +struct pminmax_impl { + template + static EIGEN_DEVICE_FUNC inline Packet run(const Packet& a, const Packet& b, Op op) { + Packet not_nan_mask_a = pcmp_eq(a, a); + Packet not_nan_mask_b = pcmp_eq(b, b); + return pselect(not_nan_mask_a, + pselect(not_nan_mask_b, op(a, b), a), + b); + } +}; + + +#ifndef SYCL_DEVICE_ONLY +#define EIGEN_BINARY_OP_NAN_PROPAGATION(Type, Func) Func +#else +#define EIGEN_BINARY_OP_NAN_PROPAGATION(Type, Func) \ +[](const Type& a, const Type& b) { \ + return Func(a, b);} +#endif + +/** \internal \returns the min of \a a and \a b (coeff-wise). + If \a a or \b b is NaN, the return value is implementation defined. */ +template EIGEN_DEVICE_FUNC inline Packet +pmin(const Packet& a, const Packet& b) { return numext::mini(a,b); } + +/** \internal \returns the min of \a a and \a b (coeff-wise). + NaNPropagation determines the NaN propagation semantics. */ +template +EIGEN_DEVICE_FUNC inline Packet pmin(const Packet& a, const Packet& b) { + return pminmax_impl::run(a, b, EIGEN_BINARY_OP_NAN_PROPAGATION(Packet, (pmin))); +} + +/** \internal \returns the max of \a a and \a b (coeff-wise) + If \a a or \b b is NaN, the return value is implementation defined. */ +template EIGEN_DEVICE_FUNC inline Packet +pmax(const Packet& a, const Packet& b) { return numext::maxi(a, b); } + +/** \internal \returns the max of \a a and \a b (coeff-wise). + NaNPropagation determines the NaN propagation semantics. */ +template +EIGEN_DEVICE_FUNC inline Packet pmax(const Packet& a, const Packet& b) { + return pminmax_impl::run(a, b, EIGEN_BINARY_OP_NAN_PROPAGATION(Packet,(pmax))); +} + +/** \internal \returns the absolute value of \a a */ +template EIGEN_DEVICE_FUNC inline Packet +pabs(const Packet& a) { return numext::abs(a); } +template<> EIGEN_DEVICE_FUNC inline unsigned int +pabs(const unsigned int& a) { return a; } +template<> EIGEN_DEVICE_FUNC inline unsigned long +pabs(const unsigned long& a) { return a; } +template<> EIGEN_DEVICE_FUNC inline unsigned long long +pabs(const unsigned long long& a) { return a; } + +/** \internal \returns the addsub value of \a a,b */ +template EIGEN_DEVICE_FUNC inline Packet +paddsub(const Packet& a, const Packet& b) { + return pselect(peven_mask(a), padd(a, b), psub(a, b)); + } + +/** \internal \returns the phase angle of \a a */ +template EIGEN_DEVICE_FUNC inline Packet +parg(const Packet& a) { using numext::arg; return arg(a); } + + +/** \internal \returns \a a arithmetically shifted by N bits to the right */ +template EIGEN_DEVICE_FUNC inline int +parithmetic_shift_right(const int& a) { return a >> N; } +template EIGEN_DEVICE_FUNC inline long int +parithmetic_shift_right(const long int& a) { return a >> N; } + +/** \internal \returns \a a logically shifted by N bits to the right */ +template EIGEN_DEVICE_FUNC inline int +plogical_shift_right(const int& a) { return static_cast(static_cast(a) >> N); } +template EIGEN_DEVICE_FUNC inline long int +plogical_shift_right(const long int& a) { return static_cast(static_cast(a) >> N); } + +/** \internal \returns \a a shifted by N bits to the left */ +template EIGEN_DEVICE_FUNC inline int +plogical_shift_left(const int& a) { return a << N; } +template EIGEN_DEVICE_FUNC inline long int +plogical_shift_left(const long int& a) { return a << N; } + +/** \internal \returns the significant and exponent of the underlying floating point numbers + * See https://en.cppreference.com/w/cpp/numeric/math/frexp + */ +template +EIGEN_DEVICE_FUNC inline Packet pfrexp(const Packet& a, Packet& exponent) { + int exp; + EIGEN_USING_STD(frexp); + Packet result = static_cast(frexp(a, &exp)); + exponent = static_cast(exp); + return result; +} + +/** \internal \returns a * 2^((int)exponent) + * See https://en.cppreference.com/w/cpp/numeric/math/ldexp + */ +template EIGEN_DEVICE_FUNC inline Packet +pldexp(const Packet &a, const Packet &exponent) { + EIGEN_USING_STD(ldexp) + return static_cast(ldexp(a, static_cast(exponent))); +} + +/** \internal \returns the min of \a a and \a b (coeff-wise) */ +template EIGEN_DEVICE_FUNC inline Packet +pabsdiff(const Packet& a, const Packet& b) { return pselect(pcmp_lt(a, b), psub(b, a), psub(a, b)); } + +/** \internal \returns a packet version of \a *from, from must be properly aligned */ +template EIGEN_DEVICE_FUNC inline Packet +pload(const typename unpacket_traits::type* from) { return *from; } + +/** \internal \returns n elements of a packet version of \a *from, from must be properly aligned + * offset indicates the starting element in which to load and + * offset + n <= unpacket_traits::size + * All elements before offset and after the last element loaded will initialized with zero */ +template EIGEN_DEVICE_FUNC inline Packet +pload_partial(const typename unpacket_traits::type* from, const Index n, const Index offset = 0) +{ + const Index packet_size = unpacket_traits::size; + eigen_assert(n + offset <= packet_size && "number of elements plus offset will read past end of packet"); + typedef typename unpacket_traits::type Scalar; + EIGEN_ALIGN_MAX Scalar elements[packet_size] = { Scalar(0) }; + for (Index i = offset; i < numext::mini(n+offset,packet_size); i++) { + elements[i] = from[i-offset]; + } + return pload(elements); +} + +/** \internal \returns a packet version of \a *from, (un-aligned load) */ +template EIGEN_DEVICE_FUNC inline Packet +ploadu(const typename unpacket_traits::type* from) { return *from; } + +/** \internal \returns n elements of a packet version of \a *from, (un-aligned load) + * All elements after the last element loaded will initialized with zero */ +template EIGEN_DEVICE_FUNC inline Packet +ploadu_partial(const typename unpacket_traits::type* from, const Index n, const Index offset = 0) +{ + const Index packet_size = unpacket_traits::size; + eigen_assert(n + offset <= packet_size && "number of elements plus offset will read past end of packet"); + typedef typename unpacket_traits::type Scalar; + EIGEN_ALIGN_MAX Scalar elements[packet_size] = { Scalar(0) }; + for (Index i = offset; i < numext::mini(n+offset,packet_size); i++) { + elements[i] = from[i-offset]; + } + return pload(elements); +} + +/** \internal \returns a packet version of \a *from, (un-aligned masked load) + * There is no generic implementation. We only have implementations for specialized + * cases. Generic case should not be called. + */ +template EIGEN_DEVICE_FUNC inline +std::enable_if_t::masked_load_available, Packet> +ploadu(const typename unpacket_traits::type* from, typename unpacket_traits::mask_t umask); + +/** \internal \returns a packet with constant coefficients \a a, e.g.: (a,a,a,a) */ +template EIGEN_DEVICE_FUNC inline Packet +pset1(const typename unpacket_traits::type& a) { return a; } + +/** \internal \returns a packet with constant coefficients set from bits */ +template EIGEN_DEVICE_FUNC inline Packet +pset1frombits(BitsType a); + +/** \internal \returns a packet with constant coefficients \a a[0], e.g.: (a[0],a[0],a[0],a[0]) */ +template EIGEN_DEVICE_FUNC inline Packet +pload1(const typename unpacket_traits::type *a) { return pset1(*a); } + +/** \internal \returns a packet with elements of \a *from duplicated. + * For instance, for a packet of 8 elements, 4 scalars will be read from \a *from and + * duplicated to form: {from[0],from[0],from[1],from[1],from[2],from[2],from[3],from[3]} + * Currently, this function is only used for scalar * complex products. + */ +template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet +ploaddup(const typename unpacket_traits::type* from) { return *from; } + +/** \internal \returns a packet with elements of \a *from quadrupled. + * For instance, for a packet of 8 elements, 2 scalars will be read from \a *from and + * replicated to form: {from[0],from[0],from[0],from[0],from[1],from[1],from[1],from[1]} + * Currently, this function is only used in matrix products. + * For packet-size smaller or equal to 4, this function is equivalent to pload1 + */ +template EIGEN_DEVICE_FUNC inline Packet +ploadquad(const typename unpacket_traits::type* from) +{ return pload1(from); } + +/** \internal equivalent to + * \code + * a0 = pload1(a+0); + * a1 = pload1(a+1); + * a2 = pload1(a+2); + * a3 = pload1(a+3); + * \endcode + * \sa pset1, pload1, ploaddup, pbroadcast2 + */ +template EIGEN_DEVICE_FUNC +inline void pbroadcast4(const typename unpacket_traits::type *a, + Packet& a0, Packet& a1, Packet& a2, Packet& a3) +{ + a0 = pload1(a+0); + a1 = pload1(a+1); + a2 = pload1(a+2); + a3 = pload1(a+3); +} + +/** \internal equivalent to + * \code + * a0 = pload1(a+0); + * a1 = pload1(a+1); + * \endcode + * \sa pset1, pload1, ploaddup, pbroadcast4 + */ +template EIGEN_DEVICE_FUNC +inline void pbroadcast2(const typename unpacket_traits::type *a, + Packet& a0, Packet& a1) +{ + a0 = pload1(a+0); + a1 = pload1(a+1); +} + +/** \internal \brief Returns a packet with coefficients (a,a+1,...,a+packet_size-1). */ +template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet +plset(const typename unpacket_traits::type& a) { return a; } + +/** \internal \returns a packet with constant coefficients \a a, e.g.: (x, 0, x, 0), + where x is the value of all 1-bits. */ +template EIGEN_DEVICE_FUNC inline Packet +peven_mask(const Packet& /*a*/) { + typedef typename unpacket_traits::type Scalar; + const size_t n = unpacket_traits::size; + EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) Scalar elements[n]; + for(size_t i = 0; i < n; ++i) { + memset(elements+i, ((i & 1) == 0 ? 0xff : 0), sizeof(Scalar)); + } + return ploadu(elements); +} + + +/** \internal copy the packet \a from to \a *to, \a to must be properly aligned */ +template EIGEN_DEVICE_FUNC inline void pstore(Scalar* to, const Packet& from) +{ (*to) = from; } + +/** \internal copy n elements of the packet \a from to \a *to, \a to must be properly aligned + * offset indicates the starting element in which to store and + * offset + n <= unpacket_traits::size */ +template EIGEN_DEVICE_FUNC inline void pstore_partial(Scalar* to, const Packet& from, const Index n, const Index offset = 0) +{ + const Index packet_size = unpacket_traits::size; + eigen_assert(n + offset <= packet_size && "number of elements plus offset will write past end of packet"); + EIGEN_ALIGN_MAX Scalar elements[packet_size]; + pstore(elements, from); + for (Index i = 0; i < numext::mini(n,packet_size-offset); i++) { + to[i] = elements[i + offset]; + } +} + +/** \internal copy the packet \a from to \a *to, (un-aligned store) */ +template EIGEN_DEVICE_FUNC inline void pstoreu(Scalar* to, const Packet& from) +{ (*to) = from; } + +/** \internal copy n elements of the packet \a from to \a *to, (un-aligned store) */ +template EIGEN_DEVICE_FUNC inline void pstoreu_partial(Scalar* to, const Packet& from, const Index n, const Index offset = 0) +{ + const Index packet_size = unpacket_traits::size; + eigen_assert(n + offset <= packet_size && "number of elements plus offset will write past end of packet"); + EIGEN_ALIGN_MAX Scalar elements[packet_size]; + pstore(elements, from); + for (Index i = 0; i < numext::mini(n,packet_size-offset); i++) { + to[i] = elements[i + offset]; + } +} + +/** \internal copy the packet \a from to \a *to, (un-aligned store with a mask) + * There is no generic implementation. We only have implementations for specialized + * cases. Generic case should not be called. + */ +template +EIGEN_DEVICE_FUNC inline +std::enable_if_t::masked_store_available, void> +pstoreu(Scalar* to, const Packet& from, typename unpacket_traits::mask_t umask); + +template EIGEN_DEVICE_FUNC inline Packet pgather(const Scalar* from, Index /*stride*/) +{ return ploadu(from); } + +template EIGEN_DEVICE_FUNC inline Packet pgather_partial(const Scalar* from, Index stride, const Index n) +{ + const Index packet_size = unpacket_traits::size; + EIGEN_ALIGN_MAX Scalar elements[packet_size] = { Scalar(0) }; + for (Index i = 0; i < numext::mini(n,packet_size); i++) { + elements[i] = from[i*stride]; + } + return pload(elements); +} + +template EIGEN_DEVICE_FUNC inline void pscatter(Scalar* to, const Packet& from, Index /*stride*/) +{ pstore(to, from); } + +template EIGEN_DEVICE_FUNC inline void pscatter_partial(Scalar* to, const Packet& from, Index stride, const Index n) +{ + const Index packet_size = unpacket_traits::size; + EIGEN_ALIGN_MAX Scalar elements[packet_size]; + pstore(elements, from); + for (Index i = 0; i < numext::mini(n,packet_size); i++) { + to[i*stride] = elements[i]; + } +} + +/** \internal tries to do cache prefetching of \a addr */ +template EIGEN_DEVICE_FUNC inline void prefetch(const Scalar* addr) +{ +#if defined(EIGEN_HIP_DEVICE_COMPILE) + // do nothing +#elif defined(EIGEN_CUDA_ARCH) +#if defined(__LP64__) || EIGEN_OS_WIN64 + // 64-bit pointer operand constraint for inlined asm + asm(" prefetch.L1 [ %1 ];" : "=l"(addr) : "l"(addr)); +#else + // 32-bit pointer operand constraint for inlined asm + asm(" prefetch.L1 [ %1 ];" : "=r"(addr) : "r"(addr)); +#endif +#elif (!EIGEN_COMP_MSVC) && (EIGEN_COMP_GNUC || EIGEN_COMP_CLANG || EIGEN_COMP_ICC) + __builtin_prefetch(addr); +#endif +} + +/** \internal \returns the reversed elements of \a a*/ +template EIGEN_DEVICE_FUNC inline Packet preverse(const Packet& a) +{ return a; } + +/** \internal \returns \a a with real and imaginary part flipped (for complex type only) */ +template EIGEN_DEVICE_FUNC inline Packet pcplxflip(const Packet& a) +{ + return Packet(numext::imag(a),numext::real(a)); +} + +/************************** +* Special math functions +***************************/ + +/** \internal \returns the sine of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet psin(const Packet& a) { EIGEN_USING_STD(sin); return sin(a); } + +/** \internal \returns the cosine of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet pcos(const Packet& a) { EIGEN_USING_STD(cos); return cos(a); } + +/** \internal \returns the tan of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet ptan(const Packet& a) { EIGEN_USING_STD(tan); return tan(a); } + +/** \internal \returns the arc sine of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet pasin(const Packet& a) { EIGEN_USING_STD(asin); return asin(a); } + +/** \internal \returns the arc cosine of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet pacos(const Packet& a) { EIGEN_USING_STD(acos); return acos(a); } + + +/** \internal \returns the hyperbolic sine of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet psinh(const Packet& a) { EIGEN_USING_STD(sinh); return sinh(a); } + +/** \internal \returns the hyperbolic cosine of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet pcosh(const Packet& a) { EIGEN_USING_STD(cosh); return cosh(a); } + +/** \internal \returns the arc tangent of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet patan(const Packet& a) { EIGEN_USING_STD(atan); return atan(a); } + +/** \internal \returns the hyperbolic tan of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet ptanh(const Packet& a) { EIGEN_USING_STD(tanh); return tanh(a); } + +/** \internal \returns the arc tangent of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet patanh(const Packet& a) { EIGEN_USING_STD(atanh); return atanh(a); } + +/** \internal \returns the exp of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet pexp(const Packet& a) { EIGEN_USING_STD(exp); return exp(a); } + +/** \internal \returns the expm1 of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet pexpm1(const Packet& a) { return numext::expm1(a); } + +/** \internal \returns the log of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet plog(const Packet& a) { EIGEN_USING_STD(log); return log(a); } + +/** \internal \returns the log1p of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet plog1p(const Packet& a) { return numext::log1p(a); } + +/** \internal \returns the log10 of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet plog10(const Packet& a) { EIGEN_USING_STD(log10); return log10(a); } + +/** \internal \returns the log10 of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet plog2(const Packet& a) { + typedef typename internal::unpacket_traits::type Scalar; + return pmul(pset1(Scalar(EIGEN_LOG2E)), plog(a)); +} + +/** \internal \returns the square-root of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet psqrt(const Packet& a) { return numext::sqrt(a); } + +/** \internal \returns the rounded value of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet pround(const Packet& a) { using numext::round; return round(a); } + +/** \internal \returns the floor of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet pfloor(const Packet& a) { using numext::floor; return floor(a); } + +/** \internal \returns the rounded value of \a a (coeff-wise) with current + * rounding mode */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet print(const Packet& a) { using numext::rint; return rint(a); } + +/** \internal \returns the ceil of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet pceil(const Packet& a) { using numext::ceil; return ceil(a); } + +template +struct psign_impl { + static EIGEN_DEVICE_FUNC inline Packet run(const Packet& a) { + return numext::sign(a); + } +}; + +/** \internal \returns the sign of \a a (coeff-wise) */ +template EIGEN_DEVICE_FUNC inline Packet +psign(const Packet& a) { + return psign_impl::run(a); +} + +template<> EIGEN_DEVICE_FUNC inline bool +psign(const bool& a) { + return a; +} + +/** \internal \returns the first element of a packet */ +template +EIGEN_DEVICE_FUNC inline typename unpacket_traits::type +pfirst(const Packet& a) +{ return a; } + +/** \internal \returns the sum of the elements of upper and lower half of \a a if \a a is larger than 4. + * For a packet {a0, a1, a2, a3, a4, a5, a6, a7}, it returns a half packet {a0+a4, a1+a5, a2+a6, a3+a7} + * For packet-size smaller or equal to 4, this boils down to a noop. + */ +template +EIGEN_DEVICE_FUNC inline std::conditional_t<(unpacket_traits::size%8)==0,typename unpacket_traits::half,Packet> +predux_half_dowto4(const Packet& a) +{ return a; } + +// Slow generic implementation of Packet reduction. +template +EIGEN_DEVICE_FUNC inline typename unpacket_traits::type +predux_helper(const Packet& a, Op op) { + typedef typename unpacket_traits::type Scalar; + const size_t n = unpacket_traits::size; + EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) Scalar elements[n]; + pstoreu(elements, a); + for(size_t k = n / 2; k > 0; k /= 2) { + for(size_t i = 0; i < k; ++i) { + elements[i] = op(elements[i], elements[i + k]); + } + } + return elements[0]; +} + +/** \internal \returns the sum of the elements of \a a*/ +template +EIGEN_DEVICE_FUNC inline typename unpacket_traits::type +predux(const Packet& a) +{ + return a; +} + +/** \internal \returns the product of the elements of \a a */ +template +EIGEN_DEVICE_FUNC inline typename unpacket_traits::type predux_mul( + const Packet& a) { + typedef typename unpacket_traits::type Scalar; + return predux_helper(a, EIGEN_BINARY_OP_NAN_PROPAGATION(Scalar, (pmul))); +} + +/** \internal \returns the min of the elements of \a a */ +template +EIGEN_DEVICE_FUNC inline typename unpacket_traits::type predux_min( + const Packet &a) { + typedef typename unpacket_traits::type Scalar; + return predux_helper(a, EIGEN_BINARY_OP_NAN_PROPAGATION(Scalar, (pmin))); +} + +template +EIGEN_DEVICE_FUNC inline typename unpacket_traits::type predux_min( + const Packet& a) { + typedef typename unpacket_traits::type Scalar; + return predux_helper(a, EIGEN_BINARY_OP_NAN_PROPAGATION(Scalar, (pmin))); +} + +/** \internal \returns the min of the elements of \a a */ +template +EIGEN_DEVICE_FUNC inline typename unpacket_traits::type predux_max( + const Packet &a) { + typedef typename unpacket_traits::type Scalar; + return predux_helper(a, EIGEN_BINARY_OP_NAN_PROPAGATION(Scalar, (pmax))); +} + +template +EIGEN_DEVICE_FUNC inline typename unpacket_traits::type predux_max( + const Packet& a) { + typedef typename unpacket_traits::type Scalar; + return predux_helper(a, EIGEN_BINARY_OP_NAN_PROPAGATION(Scalar, (pmax))); +} + +#undef EIGEN_BINARY_OP_NAN_PROPAGATION + +/** \internal \returns true if all coeffs of \a a means "true" + * It is supposed to be called on values returned by pcmp_*. + */ +// not needed yet +// template EIGEN_DEVICE_FUNC inline bool predux_all(const Packet& a) +// { return bool(a); } + +/** \internal \returns true if any coeffs of \a a means "true" + * It is supposed to be called on values returned by pcmp_*. + */ +template EIGEN_DEVICE_FUNC inline bool predux_any(const Packet& a) +{ + // Dirty but generic implementation where "true" is assumed to be non 0 and all the sames. + // It is expected that "true" is either: + // - Scalar(1) + // - bits full of ones (NaN for floats), + // - or first bit equals to 1 (1 for ints, smallest denormal for floats). + // For all these cases, taking the sum is just fine, and this boils down to a no-op for scalars. + typedef typename unpacket_traits::type Scalar; + return numext::not_equal_strict(predux(a), Scalar(0)); +} + +/*************************************************************************** +* The following functions might not have to be overwritten for vectorized types +***************************************************************************/ + +// FMA instructions. +/** \internal \returns a * b + c (coeff-wise) */ +template +EIGEN_DEVICE_FUNC inline Packet pmadd(const Packet& a, const Packet& b, + const Packet& c) { + return padd(pmul(a, b), c); +} + +/** \internal \returns a * b - c (coeff-wise) */ +template +EIGEN_DEVICE_FUNC inline Packet pmsub(const Packet& a, const Packet& b, + const Packet& c) { + return psub(pmul(a, b), c); +} + +/** \internal \returns -(a * b) + c (coeff-wise) */ +template +EIGEN_DEVICE_FUNC inline Packet pnmadd(const Packet& a, const Packet& b, + const Packet& c) { + return padd(pnegate(pmul(a, b)), c); +} + +/** \internal \returns -(a * b) - c (coeff-wise) */ +template +EIGEN_DEVICE_FUNC inline Packet pnmsub(const Packet& a, const Packet& b, + const Packet& c) { + return psub(pnegate(pmul(a, b)), c); +} + +/** \internal copy a packet with constant coefficient \a a (e.g., [a,a,a,a]) to \a *to. \a to must be 16 bytes aligned */ +// NOTE: this function must really be templated on the packet type (think about different packet types for the same scalar type) +template +inline void pstore1(typename unpacket_traits::type* to, const typename unpacket_traits::type& a) +{ + pstore(to, pset1(a)); +} + +/** \internal \returns a packet version of \a *from. + * The pointer \a from must be aligned on a \a Alignment bytes boundary. */ +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet ploadt(const typename unpacket_traits::type* from) +{ + if(Alignment >= unpacket_traits::alignment) + return pload(from); + else + return ploadu(from); +} + +/** \internal \returns n elements of a packet version of \a *from. + * The pointer \a from must be aligned on a \a Alignment bytes boundary. */ +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet ploadt_partial(const typename unpacket_traits::type* from, const Index n, const Index offset = 0) +{ + if(Alignment >= unpacket_traits::alignment) + return pload_partial(from, n, offset); + else + return ploadu_partial(from, n, offset); +} + +/** \internal copy the packet \a from to \a *to. + * The pointer \a from must be aligned on a \a Alignment bytes boundary. */ +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void pstoret(Scalar* to, const Packet& from) +{ + if(Alignment >= unpacket_traits::alignment) + pstore(to, from); + else + pstoreu(to, from); +} + +/** \internal copy n elements of the packet \a from to \a *to. + * The pointer \a from must be aligned on a \a Alignment bytes boundary. */ +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void pstoret_partial(Scalar* to, const Packet& from, const Index n, const Index offset = 0) +{ + if(Alignment >= unpacket_traits::alignment) + pstore_partial(to, from, n, offset); + else + pstoreu_partial(to, from, n, offset); +} + +/** \internal \returns a packet version of \a *from. + * Unlike ploadt, ploadt_ro takes advantage of the read-only memory path on the + * hardware if available to speedup the loading of data that won't be modified + * by the current computation. + */ +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet ploadt_ro(const typename unpacket_traits::type* from) +{ + return ploadt(from); +} + +/*************************************************************************** +* Fast complex products (GCC generates a function call which is very slow) +***************************************************************************/ + +// Eigen+CUDA does not support complexes. +#if !defined(EIGEN_GPUCC) + +template<> inline std::complex pmul(const std::complex& a, const std::complex& b) +{ return std::complex(a.real()*b.real() - a.imag()*b.imag(), a.imag()*b.real() + a.real()*b.imag()); } + +template<> inline std::complex pmul(const std::complex& a, const std::complex& b) +{ return std::complex(a.real()*b.real() - a.imag()*b.imag(), a.imag()*b.real() + a.real()*b.imag()); } + +#endif + + +/*************************************************************************** + * PacketBlock, that is a collection of N packets where the number of words + * in the packet is a multiple of N. +***************************************************************************/ +template ::size> struct PacketBlock { + Packet packet[N]; +}; + +template EIGEN_DEVICE_FUNC inline void +ptranspose(PacketBlock& /*kernel*/) { + // Nothing to do in the scalar case, i.e. a 1x1 matrix. +} + +/*************************************************************************** + * Selector, i.e. vector of N boolean values used to select (i.e. blend) + * words from 2 packets. +***************************************************************************/ +template struct Selector { + bool select[N]; +}; + +template EIGEN_DEVICE_FUNC inline Packet +pblend(const Selector::size>& ifPacket, const Packet& thenPacket, const Packet& elsePacket) { + return ifPacket.select[0] ? thenPacket : elsePacket; +} + +/** \internal \returns 1 / a (coeff-wise) */ +template +EIGEN_DEVICE_FUNC inline Packet preciprocal(const Packet& a) { + using Scalar = typename unpacket_traits::type; + return pdiv(pset1(Scalar(1)), a); +} + +/** \internal \returns the reciprocal square-root of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet prsqrt(const Packet& a) { + return preciprocal(psqrt(a)); +} + +template ::value, + bool IsInteger = NumTraits::type>::IsInteger> +struct psignbit_impl; +template +struct psignbit_impl { + EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE static constexpr Packet run(const Packet& a) { return numext::signbit(a); } +}; +template +struct psignbit_impl { + // generic implementation if not specialized in PacketMath.h + // slower than arithmetic shift + typedef typename unpacket_traits::type Scalar; + EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE static Packet run(const Packet& a) { + const Packet cst_pos_one = pset1(Scalar(1)); + const Packet cst_neg_one = pset1(Scalar(-1)); + return pcmp_eq(por(pand(a, cst_neg_one), cst_pos_one), cst_neg_one); + } +}; +template +struct psignbit_impl { + // generic implementation for integer packets + EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE static constexpr Packet run(const Packet& a) { return pcmp_lt(a, pzero(a)); } +}; +/** \internal \returns the sign bit of \a a as a bitmask*/ +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE constexpr Packet +psignbit(const Packet& a) { return psignbit_impl::run(a); } + +/** \internal \returns the 2-argument arc tangent of \a y and \a x (coeff-wise) */ +template ::value, int> = 0> +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet patan2(const Packet& y, const Packet& x) { + return numext::atan2(y, x); +} + +/** \internal \returns the 2-argument arc tangent of \a y and \a x (coeff-wise) */ +template ::value, int> = 0> +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet patan2(const Packet& y, const Packet& x) { + typedef typename internal::unpacket_traits::type Scalar; + + // See https://en.cppreference.com/w/cpp/numeric/math/atan2 + // for how corner cases are supposed to be handled according to the + // IEEE floating-point standard (IEC 60559). + const Packet kSignMask = pset1(-Scalar(0)); + const Packet kZero = pzero(x); + const Packet kOne = pset1(Scalar(1)); + const Packet kPi = pset1(Scalar(EIGEN_PI)); + + const Packet x_has_signbit = psignbit(x); + const Packet y_signmask = pand(y, kSignMask); + const Packet x_signmask = pand(x, kSignMask); + const Packet result_signmask = pxor(y_signmask, x_signmask); + const Packet shift = por(pand(x_has_signbit, kPi), y_signmask); + + const Packet x_and_y_are_same = pcmp_eq(pabs(x), pabs(y)); + const Packet x_and_y_are_zero = pcmp_eq(por(x, y), kZero); + + Packet arg = pdiv(y, x); + arg = pselect(x_and_y_are_same, por(kOne, result_signmask), arg); + arg = pselect(x_and_y_are_zero, result_signmask, arg); + + Packet result = patan(arg); + result = padd(result, shift); + return result; +} + +/** \internal \returns the argument of \a a as a complex number */ +template ::value, int> = 0> +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet pcarg(const Packet& a) { + return Packet(numext::arg(a)); +} + +/** \internal \returns the argument of \a a as a complex number */ +template ::value, int> = 0> +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet pcarg(const Packet& a) { + EIGEN_STATIC_ASSERT(NumTraits::type>::IsComplex, THIS METHOD IS FOR COMPLEX TYPES ONLY) + using RealPacket = typename unpacket_traits::as_real; + // a // r i r i ... + RealPacket aflip = pcplxflip(a).v; // i r i r ... + RealPacket result = patan2(aflip, a.v); // atan2 crap atan2 crap ... + return (Packet)pand(result, peven_mask(result)); // atan2 0 atan2 0 ... +} + +} // end namespace internal + +} // end namespace Eigen + +#endif // EIGEN_GENERIC_PACKET_MATH_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/GlobalFunctions.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/GlobalFunctions.h new file mode 100644 index 0000000000000000000000000000000000000000..30f2a38af3182015092d5e128827202065a9ed13 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/GlobalFunctions.h @@ -0,0 +1,213 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2010-2016 Gael Guennebaud +// Copyright (C) 2010 Benoit Jacob +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_GLOBAL_FUNCTIONS_H +#define EIGEN_GLOBAL_FUNCTIONS_H + +#ifdef EIGEN_PARSED_BY_DOXYGEN + +#define EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(NAME,FUNCTOR,DOC_OP,DOC_DETAILS) \ + /** \returns an expression of the coefficient-wise DOC_OP of \a x + + DOC_DETAILS + + \sa Math functions, class CwiseUnaryOp + */ \ + template \ + inline const Eigen::CwiseUnaryOp, const Derived> \ + NAME(const Eigen::ArrayBase& x); + +#else + +#define EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(NAME,FUNCTOR,DOC_OP,DOC_DETAILS) \ + template \ + inline const Eigen::CwiseUnaryOp, const Derived> \ + (NAME)(const Eigen::ArrayBase& x) { \ + return Eigen::CwiseUnaryOp, const Derived>(x.derived()); \ + } + +#endif // EIGEN_PARSED_BY_DOXYGEN + +#define EIGEN_ARRAY_DECLARE_GLOBAL_EIGEN_UNARY(NAME,FUNCTOR) \ + \ + template \ + struct NAME##_retval > \ + { \ + typedef const Eigen::CwiseUnaryOp, const Derived> type; \ + }; \ + template \ + struct NAME##_impl > \ + { \ + static inline typename NAME##_retval >::type run(const Eigen::ArrayBase& x) \ + { \ + return typename NAME##_retval >::type(x.derived()); \ + } \ + }; + +#include "./InternalHeaderCheck.h" + +namespace Eigen +{ + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(real,scalar_real_op,real part,\sa ArrayBase::real) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(imag,scalar_imag_op,imaginary part,\sa ArrayBase::imag) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(conj,scalar_conjugate_op,complex conjugate,\sa ArrayBase::conjugate) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(inverse,scalar_inverse_op,inverse,\sa ArrayBase::inverse) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(sin,scalar_sin_op,sine,\sa ArrayBase::sin) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(cos,scalar_cos_op,cosine,\sa ArrayBase::cos) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(tan,scalar_tan_op,tangent,\sa ArrayBase::tan) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(atan,scalar_atan_op,arc-tangent,\sa ArrayBase::atan) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(asin,scalar_asin_op,arc-sine,\sa ArrayBase::asin) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(acos,scalar_acos_op,arc-consine,\sa ArrayBase::acos) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(sinh,scalar_sinh_op,hyperbolic sine,\sa ArrayBase::sinh) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(cosh,scalar_cosh_op,hyperbolic cosine,\sa ArrayBase::cosh) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(tanh,scalar_tanh_op,hyperbolic tangent,\sa ArrayBase::tanh) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(asinh,scalar_asinh_op,inverse hyperbolic sine,\sa ArrayBase::asinh) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(acosh,scalar_acosh_op,inverse hyperbolic cosine,\sa ArrayBase::acosh) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(atanh,scalar_atanh_op,inverse hyperbolic tangent,\sa ArrayBase::atanh) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(logistic,scalar_logistic_op,logistic function,\sa ArrayBase::logistic) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(lgamma,scalar_lgamma_op,natural logarithm of the gamma function,\sa ArrayBase::lgamma) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(digamma,scalar_digamma_op,derivative of lgamma,\sa ArrayBase::digamma) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(erf,scalar_erf_op,error function,\sa ArrayBase::erf) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(erfc,scalar_erfc_op,complement error function,\sa ArrayBase::erfc) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(ndtri,scalar_ndtri_op,inverse normal distribution function,\sa ArrayBase::ndtri) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(exp,scalar_exp_op,exponential,\sa ArrayBase::exp) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(expm1,scalar_expm1_op,exponential of a value minus 1,\sa ArrayBase::expm1) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(log,scalar_log_op,natural logarithm,\sa Eigen::log10 DOXCOMMA ArrayBase::log) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(log1p,scalar_log1p_op,natural logarithm of 1 plus the value,\sa ArrayBase::log1p) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(log10,scalar_log10_op,base 10 logarithm,\sa Eigen::log DOXCOMMA ArrayBase::log10) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(log2,scalar_log2_op,base 2 logarithm,\sa Eigen::log DOXCOMMA ArrayBase::log2) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(abs,scalar_abs_op,absolute value,\sa ArrayBase::abs DOXCOMMA MatrixBase::cwiseAbs) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(abs2,scalar_abs2_op,squared absolute value,\sa ArrayBase::abs2 DOXCOMMA MatrixBase::cwiseAbs2) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(arg,scalar_arg_op,complex argument,\sa ArrayBase::arg DOXCOMMA MatrixBase::cwiseArg) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(carg, scalar_carg_op, complex argument, \sa ArrayBase::carg DOXCOMMA MatrixBase::cwiseCArg) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(sqrt,scalar_sqrt_op,square root,\sa ArrayBase::sqrt DOXCOMMA MatrixBase::cwiseSqrt) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(rsqrt,scalar_rsqrt_op,reciprocal square root,\sa ArrayBase::rsqrt) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(square,scalar_square_op,square (power 2),\sa Eigen::abs2 DOXCOMMA Eigen::pow DOXCOMMA ArrayBase::square) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(cube,scalar_cube_op,cube (power 3),\sa Eigen::pow DOXCOMMA ArrayBase::cube) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(rint,scalar_rint_op,nearest integer,\sa Eigen::floor DOXCOMMA Eigen::ceil DOXCOMMA ArrayBase::round) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(round,scalar_round_op,nearest integer,\sa Eigen::floor DOXCOMMA Eigen::ceil DOXCOMMA ArrayBase::round) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(floor,scalar_floor_op,nearest integer not greater than the giben value,\sa Eigen::ceil DOXCOMMA ArrayBase::floor) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(ceil,scalar_ceil_op,nearest integer not less than the giben value,\sa Eigen::floor DOXCOMMA ArrayBase::ceil) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(isnan,scalar_isnan_op,not-a-number test,\sa Eigen::isinf DOXCOMMA Eigen::isfinite DOXCOMMA ArrayBase::isnan) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(isinf,scalar_isinf_op,infinite value test,\sa Eigen::isnan DOXCOMMA Eigen::isfinite DOXCOMMA ArrayBase::isinf) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(isfinite,scalar_isfinite_op,finite value test,\sa Eigen::isinf DOXCOMMA Eigen::isnan DOXCOMMA ArrayBase::isfinite) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(sign,scalar_sign_op,sign (or 0),\sa ArrayBase::sign) + + template + using GlobalUnaryPowReturnType = std::enable_if_t< + !internal::is_arithmetic::Real>::value && + internal::is_arithmetic::Real>::value, + CwiseUnaryOp, const Derived> >; + + /** \returns an expression of the coefficient-wise power of \a x to the given constant \a exponent. + * + * \tparam ScalarExponent is the scalar type of \a exponent. It must be compatible with the scalar type of the given + * expression (\c Derived::Scalar). + * + * \sa ArrayBase::pow() + * + * \relates ArrayBase + */ +#ifdef EIGEN_PARSED_BY_DOXYGEN + template + EIGEN_DEVICE_FUNC inline const GlobalUnaryPowReturnType pow( + const Eigen::ArrayBase& x, const ScalarExponent& exponent); +#else + template + EIGEN_DEVICE_FUNC inline const GlobalUnaryPowReturnType pow( + const Eigen::ArrayBase& x, const ScalarExponent& exponent) { + return GlobalUnaryPowReturnType( + x.derived(), internal::scalar_unary_pow_op(exponent)); + } +#endif + + /** \returns an expression of the coefficient-wise power of \a x to the given array of \a exponents. + * + * This function computes the coefficient-wise power. + * + * Example: \include Cwise_array_power_array.cpp + * Output: \verbinclude Cwise_array_power_array.out + * + * \sa ArrayBase::pow() + * + * \relates ArrayBase + */ + template + inline const Eigen::CwiseBinaryOp, const Derived, const ExponentDerived> + pow(const Eigen::ArrayBase& x, const Eigen::ArrayBase& exponents) + { + return Eigen::CwiseBinaryOp, const Derived, const ExponentDerived>( + x.derived(), + exponents.derived() + ); + } + + /** \returns an expression of the coefficient-wise power of the scalar \a x to the given array of \a exponents. + * + * This function computes the coefficient-wise power between a scalar and an array of exponents. + * + * \tparam Scalar is the scalar type of \a x. It must be compatible with the scalar type of the given array expression (\c Derived::Scalar). + * + * Example: \include Cwise_scalar_power_array.cpp + * Output: \verbinclude Cwise_scalar_power_array.out + * + * \sa ArrayBase::pow() + * + * \relates ArrayBase + */ +#ifdef EIGEN_PARSED_BY_DOXYGEN + template + inline const CwiseBinaryOp,Constant,Derived> + pow(const Scalar& x,const Eigen::ArrayBase& x); +#else + template + EIGEN_DEVICE_FUNC inline + const EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE(typename internal::promote_scalar_arg::type,Derived,pow) + pow(const Scalar& x, const Eigen::ArrayBase& exponents) { + typedef typename internal::promote_scalar_arg::type PromotedScalar; + return EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE(PromotedScalar,Derived,pow)( + typename internal::plain_constant_type::type(exponents.derived().rows(), exponents.derived().cols(), internal::scalar_constant_op(x)), exponents.derived()); + } +#endif + + /** \returns an expression of the coefficient-wise atan2(\a x, \a y). \a x and \a y must be of the same type. + * + * This function computes the coefficient-wise atan2(). + * + * \sa ArrayBase::atan2() + * + * \relates ArrayBase + */ + template + inline const std::enable_if_t< + std::is_same::value, + Eigen::CwiseBinaryOp, const LhsDerived, const RhsDerived> + > + atan2(const Eigen::ArrayBase& x, const Eigen::ArrayBase& exponents) { + return Eigen::CwiseBinaryOp, const LhsDerived, const RhsDerived>( + x.derived(), + exponents.derived() + ); + } + + namespace internal + { + EIGEN_ARRAY_DECLARE_GLOBAL_EIGEN_UNARY(real,scalar_real_op) + EIGEN_ARRAY_DECLARE_GLOBAL_EIGEN_UNARY(imag,scalar_imag_op) + EIGEN_ARRAY_DECLARE_GLOBAL_EIGEN_UNARY(abs2,scalar_abs2_op) + } +} + +// TODO: cleanly disable those functions that are not supported on Array (numext::real_ref, internal::random, internal::isApprox...) + +#endif // EIGEN_GLOBAL_FUNCTIONS_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/IO.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/IO.h new file mode 100644 index 0000000000000000000000000000000000000000..69937292b4aed5205e8d6fb6093b73c488401685 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/IO.h @@ -0,0 +1,263 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2006-2008 Benoit Jacob +// Copyright (C) 2008 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_IO_H +#define EIGEN_IO_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +enum { DontAlignCols = 1 }; +enum { StreamPrecision = -1, + FullPrecision = -2 }; + +namespace internal { +template +std::ostream & print_matrix(std::ostream & s, const Derived& _m, const IOFormat& fmt); +} + +/** \class IOFormat + * \ingroup Core_Module + * + * \brief Stores a set of parameters controlling the way matrices are printed + * + * List of available parameters: + * - \b precision number of digits for floating point values, or one of the special constants \c StreamPrecision and \c FullPrecision. + * The default is the special value \c StreamPrecision which means to use the + * stream's own precision setting, as set for instance using \c cout.precision(3). The other special value + * \c FullPrecision means that the number of digits will be computed to match the full precision of each floating-point + * type. + * - \b flags an OR-ed combination of flags, the default value is 0, the only currently available flag is \c DontAlignCols which + * allows to disable the alignment of columns, resulting in faster code. + * - \b coeffSeparator string printed between two coefficients of the same row + * - \b rowSeparator string printed between two rows + * - \b rowPrefix string printed at the beginning of each row + * - \b rowSuffix string printed at the end of each row + * - \b matPrefix string printed at the beginning of the matrix + * - \b matSuffix string printed at the end of the matrix + * - \b fill character printed to fill the empty space in aligned columns + * + * Example: \include IOFormat.cpp + * Output: \verbinclude IOFormat.out + * + * \sa DenseBase::format(), class WithFormat + */ +struct IOFormat +{ + /** Default constructor, see class IOFormat for the meaning of the parameters */ + IOFormat(int _precision = StreamPrecision, int _flags = 0, + const std::string& _coeffSeparator = " ", + const std::string& _rowSeparator = "\n", const std::string& _rowPrefix="", const std::string& _rowSuffix="", + const std::string& _matPrefix="", const std::string& _matSuffix="", const char _fill=' ') + : matPrefix(_matPrefix), matSuffix(_matSuffix), rowPrefix(_rowPrefix), rowSuffix(_rowSuffix), rowSeparator(_rowSeparator), + rowSpacer(""), coeffSeparator(_coeffSeparator), fill(_fill), precision(_precision), flags(_flags) + { + // TODO check if rowPrefix, rowSuffix or rowSeparator contains a newline + // don't add rowSpacer if columns are not to be aligned + if((flags & DontAlignCols)) + return; + int i = int(matSuffix.length())-1; + while (i>=0 && matSuffix[i]!='\n') + { + rowSpacer += ' '; + i--; + } + } + std::string matPrefix, matSuffix; + std::string rowPrefix, rowSuffix, rowSeparator, rowSpacer; + std::string coeffSeparator; + char fill; + int precision; + int flags; +}; + +/** \class WithFormat + * \ingroup Core_Module + * + * \brief Pseudo expression providing matrix output with given format + * + * \tparam ExpressionType the type of the object on which IO stream operations are performed + * + * This class represents an expression with stream operators controlled by a given IOFormat. + * It is the return type of DenseBase::format() + * and most of the time this is the only way it is used. + * + * See class IOFormat for some examples. + * + * \sa DenseBase::format(), class IOFormat + */ +template +class WithFormat +{ + public: + + WithFormat(const ExpressionType& matrix, const IOFormat& format) + : m_matrix(matrix), m_format(format) + {} + + friend std::ostream & operator << (std::ostream & s, const WithFormat& wf) + { + return internal::print_matrix(s, wf.m_matrix.eval(), wf.m_format); + } + + protected: + typename ExpressionType::Nested m_matrix; + IOFormat m_format; +}; + +namespace internal { + +// NOTE: This helper is kept for backward compatibility with previous code specializing +// this internal::significant_decimals_impl structure. In the future we should directly +// call max_digits10(). +template +struct significant_decimals_impl +{ + static inline int run() + { + return NumTraits::max_digits10(); + } +}; + +/** \internal + * print the matrix \a _m to the output stream \a s using the output format \a fmt */ +template +std::ostream & print_matrix(std::ostream & s, const Derived& _m, const IOFormat& fmt) +{ + using internal::is_same; + + if(_m.size() == 0) + { + s << fmt.matPrefix << fmt.matSuffix; + return s; + } + + typename Derived::Nested m = _m; + typedef typename Derived::Scalar Scalar; + typedef std::conditional_t< + is_same::value || + is_same::value || + is_same::value || + is_same::value, + int, + std::conditional_t< + is_same >::value || + is_same >::value || + is_same >::value || + is_same >::value, + std::complex, + const Scalar& + > + > PrintType; + + Index width = 0; + + std::streamsize explicit_precision; + if(fmt.precision == StreamPrecision) + { + explicit_precision = 0; + } + else if(fmt.precision == FullPrecision) + { + if (NumTraits::IsInteger) + { + explicit_precision = 0; + } + else + { + explicit_precision = significant_decimals_impl::run(); + } + } + else + { + explicit_precision = fmt.precision; + } + + std::streamsize old_precision = 0; + if(explicit_precision) old_precision = s.precision(explicit_precision); + + bool align_cols = !(fmt.flags & DontAlignCols); + if(align_cols) + { + // compute the largest width + for(Index j = 0; j < m.cols(); ++j) + for(Index i = 0; i < m.rows(); ++i) + { + std::stringstream sstr; + sstr.copyfmt(s); + sstr << static_cast(m.coeff(i,j)); + width = std::max(width, Index(sstr.str().length())); + } + } + std::streamsize old_width = s.width(); + char old_fill_character = s.fill(); + s << fmt.matPrefix; + for(Index i = 0; i < m.rows(); ++i) + { + if (i) + s << fmt.rowSpacer; + s << fmt.rowPrefix; + if(width) { + s.fill(fmt.fill); + s.width(width); + } + s << static_cast(m.coeff(i, 0)); + for(Index j = 1; j < m.cols(); ++j) + { + s << fmt.coeffSeparator; + if(width) { + s.fill(fmt.fill); + s.width(width); + } + s << static_cast(m.coeff(i, j)); + } + s << fmt.rowSuffix; + if( i < m.rows() - 1) + s << fmt.rowSeparator; + } + s << fmt.matSuffix; + if(explicit_precision) s.precision(old_precision); + if(width) { + s.fill(old_fill_character); + s.width(old_width); + } + return s; +} + +} // end namespace internal + +/** \relates DenseBase + * + * Outputs the matrix, to the given stream. + * + * If you wish to print the matrix with a format different than the default, use DenseBase::format(). + * + * It is also possible to change the default format by defining EIGEN_DEFAULT_IO_FORMAT before including Eigen headers. + * If not defined, this will automatically be defined to Eigen::IOFormat(), that is the Eigen::IOFormat with default parameters. + * + * \sa DenseBase::format() + */ +template +std::ostream & operator << +(std::ostream & s, + const DenseBase & m) +{ + return internal::print_matrix(s, m.eval(), EIGEN_DEFAULT_IO_FORMAT); +} + +template +std::ostream& operator<<(std::ostream& s, const DiagonalBase& m) { + return internal::print_matrix(s, m.derived(), EIGEN_DEFAULT_IO_FORMAT); +} + +} // end namespace Eigen + +#endif // EIGEN_IO_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/IndexedView.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/IndexedView.h new file mode 100644 index 0000000000000000000000000000000000000000..feab3a9a313997b6c2b8008b9dcc742aab05c7ab --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/IndexedView.h @@ -0,0 +1,248 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2017 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_INDEXED_VIEW_H +#define EIGEN_INDEXED_VIEW_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { + +template +struct traits > + : traits +{ + enum { + RowsAtCompileTime = int(array_size::value), + ColsAtCompileTime = int(array_size::value), + MaxRowsAtCompileTime = RowsAtCompileTime, + MaxColsAtCompileTime = ColsAtCompileTime, + + XprTypeIsRowMajor = (int(traits::Flags)&RowMajorBit) != 0, + IsRowMajor = (MaxRowsAtCompileTime==1&&MaxColsAtCompileTime!=1) ? 1 + : (MaxColsAtCompileTime==1&&MaxRowsAtCompileTime!=1) ? 0 + : XprTypeIsRowMajor, + + RowIncr = int(get_compile_time_incr::value), + ColIncr = int(get_compile_time_incr::value), + InnerIncr = IsRowMajor ? ColIncr : RowIncr, + OuterIncr = IsRowMajor ? RowIncr : ColIncr, + + HasSameStorageOrderAsXprType = (IsRowMajor == XprTypeIsRowMajor), + XprInnerStride = HasSameStorageOrderAsXprType ? int(inner_stride_at_compile_time::ret) : int(outer_stride_at_compile_time::ret), + XprOuterstride = HasSameStorageOrderAsXprType ? int(outer_stride_at_compile_time::ret) : int(inner_stride_at_compile_time::ret), + + InnerSize = XprTypeIsRowMajor ? ColsAtCompileTime : RowsAtCompileTime, + IsBlockAlike = InnerIncr==1 && OuterIncr==1, + IsInnerPannel = HasSameStorageOrderAsXprType && is_same,std::conditional_t>::value, + + InnerStrideAtCompileTime = InnerIncr<0 || InnerIncr==DynamicIndex || XprInnerStride==Dynamic || InnerIncr==UndefinedIncr ? Dynamic : XprInnerStride * InnerIncr, + OuterStrideAtCompileTime = OuterIncr<0 || OuterIncr==DynamicIndex || XprOuterstride==Dynamic || OuterIncr==UndefinedIncr ? Dynamic : XprOuterstride * OuterIncr, + + ReturnAsScalar = is_same::value && is_same::value, + ReturnAsBlock = (!ReturnAsScalar) && IsBlockAlike, + ReturnAsIndexedView = (!ReturnAsScalar) && (!ReturnAsBlock), + + // FIXME we deal with compile-time strides if and only if we have DirectAccessBit flag, + // but this is too strict regarding negative strides... + DirectAccessMask = (int(InnerIncr)!=UndefinedIncr && int(OuterIncr)!=UndefinedIncr && InnerIncr>=0 && OuterIncr>=0) ? DirectAccessBit : 0, + FlagsRowMajorBit = IsRowMajor ? RowMajorBit : 0, + FlagsLvalueBit = is_lvalue::value ? LvalueBit : 0, + FlagsLinearAccessBit = (RowsAtCompileTime == 1 || ColsAtCompileTime == 1) ? LinearAccessBit : 0, + Flags = (traits::Flags & (HereditaryBits | DirectAccessMask )) | FlagsLvalueBit | FlagsRowMajorBit | FlagsLinearAccessBit + }; + + typedef Block BlockType; +}; + +} + +template +class IndexedViewImpl; + + +/** \class IndexedView + * \ingroup Core_Module + * + * \brief Expression of a non-sequential sub-matrix defined by arbitrary sequences of row and column indices + * + * \tparam XprType the type of the expression in which we are taking the intersections of sub-rows and sub-columns + * \tparam RowIndices the type of the object defining the sequence of row indices + * \tparam ColIndices the type of the object defining the sequence of column indices + * + * This class represents an expression of a sub-matrix (or sub-vector) defined as the intersection + * of sub-sets of rows and columns, that are themself defined by generic sequences of row indices \f$ \{r_0,r_1,..r_{m-1}\} \f$ + * and column indices \f$ \{c_0,c_1,..c_{n-1} \}\f$. Let \f$ A \f$ be the nested matrix, then the resulting matrix \f$ B \f$ has \c m + * rows and \c n columns, and its entries are given by: \f$ B(i,j) = A(r_i,c_j) \f$. + * + * The \c RowIndices and \c ColIndices types must be compatible with the following API: + * \code + * operator[](Index) const; + * Index size() const; + * \endcode + * + * Typical supported types thus include: + * - std::vector + * - std::valarray + * - std::array + * - Eigen::ArrayXi + * - decltype(ArrayXi::LinSpaced(...)) + * - Any view/expressions of the previous types + * - Eigen::ArithmeticSequence + * - Eigen::internal::AllRange (helper for Eigen::placeholders::all) + * - Eigen::internal::SingleRange (helper for single index) + * - etc. + * + * In typical usages of %Eigen, this class should never be used directly. It is the return type of + * DenseBase::operator()(const RowIndices&, const ColIndices&). + * + * \sa class Block + */ +template +class IndexedView : public IndexedViewImpl::StorageKind> +{ +public: + typedef typename IndexedViewImpl::StorageKind>::Base Base; + EIGEN_GENERIC_PUBLIC_INTERFACE(IndexedView) + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(IndexedView) + + typedef typename internal::ref_selector::non_const_type MatrixTypeNested; + typedef internal::remove_all_t NestedExpression; + + template + IndexedView(XprType& xpr, const T0& rowIndices, const T1& colIndices) + : m_xpr(xpr), m_rowIndices(rowIndices), m_colIndices(colIndices) + {} + + /** \returns number of rows */ + Index rows() const { return internal::index_list_size(m_rowIndices); } + + /** \returns number of columns */ + Index cols() const { return internal::index_list_size(m_colIndices); } + + /** \returns the nested expression */ + const internal::remove_all_t& + nestedExpression() const { return m_xpr; } + + /** \returns the nested expression */ + std::remove_reference_t& + nestedExpression() { return m_xpr; } + + /** \returns a const reference to the object storing/generating the row indices */ + const RowIndices& rowIndices() const { return m_rowIndices; } + + /** \returns a const reference to the object storing/generating the column indices */ + const ColIndices& colIndices() const { return m_colIndices; } + +protected: + MatrixTypeNested m_xpr; + RowIndices m_rowIndices; + ColIndices m_colIndices; +}; + + +// Generic API dispatcher +template +class IndexedViewImpl + : public internal::generic_xpr_base >::type +{ +public: + typedef typename internal::generic_xpr_base >::type Base; +}; + +namespace internal { + + +template +struct unary_evaluator, IndexBased> + : evaluator_base > +{ + typedef IndexedView XprType; + + enum { + CoeffReadCost = evaluator::CoeffReadCost /* TODO + cost of row/col index */, + + FlagsLinearAccessBit = (traits::RowsAtCompileTime == 1 || traits::ColsAtCompileTime == 1) ? LinearAccessBit : 0, + + FlagsRowMajorBit = traits::FlagsRowMajorBit, + + Flags = (evaluator::Flags & (HereditaryBits & ~RowMajorBit /*| LinearAccessBit | DirectAccessBit*/)) | FlagsLinearAccessBit | FlagsRowMajorBit, + + Alignment = 0 + }; + + EIGEN_DEVICE_FUNC explicit unary_evaluator(const XprType& xpr) : m_argImpl(xpr.nestedExpression()), m_xpr(xpr) + { + EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); + } + + typedef typename XprType::Scalar Scalar; + typedef typename XprType::CoeffReturnType CoeffReturnType; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index row, Index col) const + { + eigen_assert(m_xpr.rowIndices()[row] >= 0 && m_xpr.rowIndices()[row] < m_xpr.nestedExpression().rows() + && m_xpr.colIndices()[col] >= 0 && m_xpr.colIndices()[col] < m_xpr.nestedExpression().cols()); + return m_argImpl.coeff(m_xpr.rowIndices()[row], m_xpr.colIndices()[col]); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& coeffRef(Index row, Index col) + { + eigen_assert(m_xpr.rowIndices()[row] >= 0 && m_xpr.rowIndices()[row] < m_xpr.nestedExpression().rows() + && m_xpr.colIndices()[col] >= 0 && m_xpr.colIndices()[col] < m_xpr.nestedExpression().cols()); + return m_argImpl.coeffRef(m_xpr.rowIndices()[row], m_xpr.colIndices()[col]); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& coeffRef(Index index) + { + EIGEN_STATIC_ASSERT_LVALUE(XprType) + Index row = XprType::RowsAtCompileTime == 1 ? 0 : index; + Index col = XprType::RowsAtCompileTime == 1 ? index : 0; + eigen_assert(m_xpr.rowIndices()[row] >= 0 && m_xpr.rowIndices()[row] < m_xpr.nestedExpression().rows() + && m_xpr.colIndices()[col] >= 0 && m_xpr.colIndices()[col] < m_xpr.nestedExpression().cols()); + return m_argImpl.coeffRef( m_xpr.rowIndices()[row], m_xpr.colIndices()[col]); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + const Scalar& coeffRef(Index index) const + { + Index row = XprType::RowsAtCompileTime == 1 ? 0 : index; + Index col = XprType::RowsAtCompileTime == 1 ? index : 0; + eigen_assert(m_xpr.rowIndices()[row] >= 0 && m_xpr.rowIndices()[row] < m_xpr.nestedExpression().rows() + && m_xpr.colIndices()[col] >= 0 && m_xpr.colIndices()[col] < m_xpr.nestedExpression().cols()); + return m_argImpl.coeffRef( m_xpr.rowIndices()[row], m_xpr.colIndices()[col]); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + const CoeffReturnType coeff(Index index) const + { + Index row = XprType::RowsAtCompileTime == 1 ? 0 : index; + Index col = XprType::RowsAtCompileTime == 1 ? index : 0; + eigen_assert(m_xpr.rowIndices()[row] >= 0 && m_xpr.rowIndices()[row] < m_xpr.nestedExpression().rows() + && m_xpr.colIndices()[col] >= 0 && m_xpr.colIndices()[col] < m_xpr.nestedExpression().cols()); + return m_argImpl.coeff( m_xpr.rowIndices()[row], m_xpr.colIndices()[col]); + } + +protected: + + evaluator m_argImpl; + const XprType& m_xpr; + +}; + +} // end namespace internal + +} // end namespace Eigen + +#endif // EIGEN_INDEXED_VIEW_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/InternalHeaderCheck.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/InternalHeaderCheck.h new file mode 100644 index 0000000000000000000000000000000000000000..1cea572dcf9875c3abf175513397c2a0be053c90 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/InternalHeaderCheck.h @@ -0,0 +1,3 @@ +#ifndef EIGEN_CORE_MODULE_H +#error "Please include Eigen/Core instead of including headers inside the src directory directly." +#endif diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Inverse.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Inverse.h new file mode 100644 index 0000000000000000000000000000000000000000..9c70733b18204e6bd1ae50778a25d48ac736ada3 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Inverse.h @@ -0,0 +1,119 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2014-2019 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_INVERSE_H +#define EIGEN_INVERSE_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +template class InverseImpl; + +namespace internal { + +template +struct traits > + : traits +{ + typedef typename XprType::PlainObject PlainObject; + typedef traits BaseTraits; + enum { + Flags = BaseTraits::Flags & RowMajorBit + }; +}; + +} // end namespace internal + +/** \class Inverse + * + * \brief Expression of the inverse of another expression + * + * \tparam XprType the type of the expression we are taking the inverse + * + * This class represents an abstract expression of A.inverse() + * and most of the time this is the only way it is used. + * + */ +template +class Inverse : public InverseImpl::StorageKind> +{ +public: + typedef typename XprType::StorageIndex StorageIndex; + typedef typename XprType::Scalar Scalar; + typedef typename internal::ref_selector::type XprTypeNested; + typedef internal::remove_all_t XprTypeNestedCleaned; + typedef typename internal::ref_selector::type Nested; + typedef internal::remove_all_t NestedExpression; + + explicit EIGEN_DEVICE_FUNC Inverse(const XprType &xpr) + : m_xpr(xpr) + {} + + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_xpr.cols(); } + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_xpr.rows(); } + + EIGEN_DEVICE_FUNC const XprTypeNestedCleaned& nestedExpression() const { return m_xpr; } + +protected: + XprTypeNested m_xpr; +}; + +// Generic API dispatcher +template +class InverseImpl + : public internal::generic_xpr_base >::type +{ +public: + typedef typename internal::generic_xpr_base >::type Base; + typedef typename XprType::Scalar Scalar; +private: + + Scalar coeff(Index row, Index col) const; + Scalar coeff(Index i) const; +}; + +namespace internal { + +/** \internal + * \brief Default evaluator for Inverse expression. + * + * This default evaluator for Inverse expression simply evaluate the inverse into a temporary + * by a call to internal::call_assignment_no_alias. + * Therefore, inverse implementers only have to specialize Assignment, ...> for + * there own nested expression. + * + * \sa class Inverse + */ +template +struct unary_evaluator > + : public evaluator::PlainObject> +{ + typedef Inverse InverseType; + typedef typename InverseType::PlainObject PlainObject; + typedef evaluator Base; + + enum { Flags = Base::Flags | EvalBeforeNestingBit }; + + unary_evaluator(const InverseType& inv_xpr) + : m_result(inv_xpr.rows(), inv_xpr.cols()) + { + internal::construct_at(this, m_result); + internal::call_assignment_no_alias(m_result, inv_xpr); + } + +protected: + PlainObject m_result; +}; + +} // end namespace internal + +} // end namespace Eigen + +#endif // EIGEN_INVERSE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Map.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Map.h new file mode 100644 index 0000000000000000000000000000000000000000..56d1ff86fea5197fa4ce43a72440b9a5061ef3f2 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Map.h @@ -0,0 +1,170 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2007-2010 Benoit Jacob +// Copyright (C) 2008 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_MAP_H +#define EIGEN_MAP_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { +template +struct traits > + : public traits +{ + typedef traits TraitsBase; + enum { + PlainObjectTypeInnerSize = ((traits::Flags&RowMajorBit)==RowMajorBit) + ? PlainObjectType::ColsAtCompileTime + : PlainObjectType::RowsAtCompileTime, + + InnerStrideAtCompileTime = StrideType::InnerStrideAtCompileTime == 0 + ? int(PlainObjectType::InnerStrideAtCompileTime) + : int(StrideType::InnerStrideAtCompileTime), + OuterStrideAtCompileTime = StrideType::OuterStrideAtCompileTime == 0 + ? (InnerStrideAtCompileTime==Dynamic || PlainObjectTypeInnerSize==Dynamic + ? Dynamic + : int(InnerStrideAtCompileTime) * int(PlainObjectTypeInnerSize)) + : int(StrideType::OuterStrideAtCompileTime), + Alignment = int(MapOptions)&int(AlignedMask), + Flags0 = TraitsBase::Flags & (~NestByRefBit), + Flags = is_lvalue::value ? int(Flags0) : (int(Flags0) & ~LvalueBit) + }; +private: + enum { Options }; // Expressions don't have Options +}; +} + +/** \class Map + * \ingroup Core_Module + * + * \brief A matrix or vector expression mapping an existing array of data. + * + * \tparam PlainObjectType the equivalent matrix type of the mapped data + * \tparam MapOptions specifies the pointer alignment in bytes. It can be: \c #Aligned128, \c #Aligned64, \c #Aligned32, \c #Aligned16, \c #Aligned8 or \c #Unaligned. + * The default is \c #Unaligned. + * \tparam StrideType optionally specifies strides. By default, Map assumes the memory layout + * of an ordinary, contiguous array. This can be overridden by specifying strides. + * The type passed here must be a specialization of the Stride template, see examples below. + * + * This class represents a matrix or vector expression mapping an existing array of data. + * It can be used to let Eigen interface without any overhead with non-Eigen data structures, + * such as plain C arrays or structures from other libraries. By default, it assumes that the + * data is laid out contiguously in memory. You can however override this by explicitly specifying + * inner and outer strides. + * + * Here's an example of simply mapping a contiguous array as a \ref TopicStorageOrders "column-major" matrix: + * \include Map_simple.cpp + * Output: \verbinclude Map_simple.out + * + * If you need to map non-contiguous arrays, you can do so by specifying strides: + * + * Here's an example of mapping an array as a vector, specifying an inner stride, that is, the pointer + * increment between two consecutive coefficients. Here, we're specifying the inner stride as a compile-time + * fixed value. + * \include Map_inner_stride.cpp + * Output: \verbinclude Map_inner_stride.out + * + * Here's an example of mapping an array while specifying an outer stride. Here, since we're mapping + * as a column-major matrix, 'outer stride' means the pointer increment between two consecutive columns. + * Here, we're specifying the outer stride as a runtime parameter. Note that here \c OuterStride<> is + * a short version of \c OuterStride because the default template parameter of OuterStride + * is \c Dynamic + * \include Map_outer_stride.cpp + * Output: \verbinclude Map_outer_stride.out + * + * For more details and for an example of specifying both an inner and an outer stride, see class Stride. + * + * \b Tip: to change the array of data mapped by a Map object, you can use the C++ + * placement new syntax: + * + * Example: \include Map_placement_new.cpp + * Output: \verbinclude Map_placement_new.out + * + * This class is the return type of PlainObjectBase::Map() but can also be used directly. + * + * \sa PlainObjectBase::Map(), \ref TopicStorageOrders + */ +template class Map + : public MapBase > +{ + public: + + typedef MapBase Base; + EIGEN_DENSE_PUBLIC_INTERFACE(Map) + + typedef typename Base::PointerType PointerType; + typedef PointerType PointerArgType; + EIGEN_DEVICE_FUNC + inline PointerType cast_to_pointer_type(PointerArgType ptr) { return ptr; } + + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index innerStride() const + { + return StrideType::InnerStrideAtCompileTime != 0 ? m_stride.inner() : 1; + } + + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index outerStride() const + { + return StrideType::OuterStrideAtCompileTime != 0 ? m_stride.outer() + : internal::traits::OuterStrideAtCompileTime != Dynamic ? Index(internal::traits::OuterStrideAtCompileTime) + : IsVectorAtCompileTime ? (this->size() * innerStride()) + : int(Flags)&RowMajorBit ? (this->cols() * innerStride()) + : (this->rows() * innerStride()); + } + + /** Constructor in the fixed-size case. + * + * \param dataPtr pointer to the array to map + * \param stride optional Stride object, passing the strides. + */ + EIGEN_DEVICE_FUNC + explicit inline Map(PointerArgType dataPtr, const StrideType& stride = StrideType()) + : Base(cast_to_pointer_type(dataPtr)), m_stride(stride) + { + } + + /** Constructor in the dynamic-size vector case. + * + * \param dataPtr pointer to the array to map + * \param size the size of the vector expression + * \param stride optional Stride object, passing the strides. + */ + EIGEN_DEVICE_FUNC + inline Map(PointerArgType dataPtr, Index size, const StrideType& stride = StrideType()) + : Base(cast_to_pointer_type(dataPtr), size), m_stride(stride) + { + } + + /** Constructor in the dynamic-size matrix case. + * + * \param dataPtr pointer to the array to map + * \param rows the number of rows of the matrix expression + * \param cols the number of columns of the matrix expression + * \param stride optional Stride object, passing the strides. + */ + EIGEN_DEVICE_FUNC + inline Map(PointerArgType dataPtr, Index rows, Index cols, const StrideType& stride = StrideType()) + : Base(cast_to_pointer_type(dataPtr), rows, cols), m_stride(stride) + { + } + + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Map) + + protected: + StrideType m_stride; +}; + + +} // end namespace Eigen + +#endif // EIGEN_MAP_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/MapBase.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/MapBase.h new file mode 100644 index 0000000000000000000000000000000000000000..4dda24d211f167d89be4223ea12cb3cccc0eacc4 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/MapBase.h @@ -0,0 +1,312 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2007-2010 Benoit Jacob +// Copyright (C) 2008 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_MAPBASE_H +#define EIGEN_MAPBASE_H + +#define EIGEN_STATIC_ASSERT_INDEX_BASED_ACCESS(Derived) \ + EIGEN_STATIC_ASSERT((int(internal::evaluator::Flags) & LinearAccessBit) || Derived::IsVectorAtCompileTime, \ + YOU_ARE_TRYING_TO_USE_AN_INDEX_BASED_ACCESSOR_ON_AN_EXPRESSION_THAT_DOES_NOT_SUPPORT_THAT) + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +/** \ingroup Core_Module + * + * \brief Base class for dense Map and Block expression with direct access + * + * This base class provides the const low-level accessors (e.g. coeff, coeffRef) of dense + * Map and Block objects with direct access. + * Typical users do not have to directly deal with this class. + * + * This class can be extended by through the macro plugin \c EIGEN_MAPBASE_PLUGIN. + * See \link TopicCustomizing_Plugins customizing Eigen \endlink for details. + * + * The \c Derived class has to provide the following two methods describing the memory layout: + * \code Index innerStride() const; \endcode + * \code Index outerStride() const; \endcode + * + * \sa class Map, class Block + */ +template class MapBase + : public internal::dense_xpr_base::type +{ + public: + + typedef typename internal::dense_xpr_base::type Base; + enum { + RowsAtCompileTime = internal::traits::RowsAtCompileTime, + ColsAtCompileTime = internal::traits::ColsAtCompileTime, + InnerStrideAtCompileTime = internal::traits::InnerStrideAtCompileTime, + SizeAtCompileTime = Base::SizeAtCompileTime + }; + + typedef typename internal::traits::StorageKind StorageKind; + typedef typename internal::traits::Scalar Scalar; + typedef typename internal::packet_traits::type PacketScalar; + typedef typename NumTraits::Real RealScalar; + typedef std::conditional_t< + bool(internal::is_lvalue::value), + Scalar *, + const Scalar *> + PointerType; + + using Base::derived; +// using Base::RowsAtCompileTime; +// using Base::ColsAtCompileTime; +// using Base::SizeAtCompileTime; + using Base::MaxRowsAtCompileTime; + using Base::MaxColsAtCompileTime; + using Base::MaxSizeAtCompileTime; + using Base::IsVectorAtCompileTime; + using Base::Flags; + using Base::IsRowMajor; + + using Base::rows; + using Base::cols; + using Base::size; + using Base::coeff; + using Base::coeffRef; + using Base::lazyAssign; + using Base::eval; + + using Base::innerStride; + using Base::outerStride; + using Base::rowStride; + using Base::colStride; + + // bug 217 - compile error on ICC 11.1 + using Base::operator=; + + typedef typename Base::CoeffReturnType CoeffReturnType; + + /** \copydoc DenseBase::rows() */ + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index rows() const EIGEN_NOEXCEPT { return m_rows.value(); } + /** \copydoc DenseBase::cols() */ + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index cols() const EIGEN_NOEXCEPT { return m_cols.value(); } + + /** Returns a pointer to the first coefficient of the matrix or vector. + * + * \note When addressing this data, make sure to honor the strides returned by innerStride() and outerStride(). + * + * \sa innerStride(), outerStride() + */ + EIGEN_DEVICE_FUNC inline const Scalar* data() const { return m_data; } + + /** \copydoc PlainObjectBase::coeff(Index,Index) const */ + EIGEN_DEVICE_FUNC + inline const Scalar& coeff(Index rowId, Index colId) const + { + return m_data[colId * colStride() + rowId * rowStride()]; + } + + /** \copydoc PlainObjectBase::coeff(Index) const */ + EIGEN_DEVICE_FUNC + inline const Scalar& coeff(Index index) const + { + EIGEN_STATIC_ASSERT_INDEX_BASED_ACCESS(Derived) + return m_data[index * innerStride()]; + } + + /** \copydoc PlainObjectBase::coeffRef(Index,Index) const */ + EIGEN_DEVICE_FUNC + inline const Scalar& coeffRef(Index rowId, Index colId) const + { + return this->m_data[colId * colStride() + rowId * rowStride()]; + } + + /** \copydoc PlainObjectBase::coeffRef(Index) const */ + EIGEN_DEVICE_FUNC + inline const Scalar& coeffRef(Index index) const + { + EIGEN_STATIC_ASSERT_INDEX_BASED_ACCESS(Derived) + return this->m_data[index * innerStride()]; + } + + /** \internal */ + template + inline PacketScalar packet(Index rowId, Index colId) const + { + return internal::ploadt + (m_data + (colId * colStride() + rowId * rowStride())); + } + + /** \internal */ + template + inline PacketScalar packet(Index index) const + { + EIGEN_STATIC_ASSERT_INDEX_BASED_ACCESS(Derived) + return internal::ploadt(m_data + index * innerStride()); + } + + /** \internal Constructor for fixed size matrices or vectors */ + EIGEN_DEVICE_FUNC + explicit inline MapBase(PointerType dataPtr) : m_data(dataPtr), m_rows(RowsAtCompileTime), m_cols(ColsAtCompileTime) + { + EIGEN_STATIC_ASSERT_FIXED_SIZE(Derived) + checkSanity(); + } + + /** \internal Constructor for dynamically sized vectors */ + EIGEN_DEVICE_FUNC + inline MapBase(PointerType dataPtr, Index vecSize) + : m_data(dataPtr), + m_rows(RowsAtCompileTime == Dynamic ? vecSize : Index(RowsAtCompileTime)), + m_cols(ColsAtCompileTime == Dynamic ? vecSize : Index(ColsAtCompileTime)) + { + EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) + eigen_assert(vecSize >= 0); + eigen_assert(dataPtr == 0 || SizeAtCompileTime == Dynamic || SizeAtCompileTime == vecSize); + checkSanity(); + } + + /** \internal Constructor for dynamically sized matrices */ + EIGEN_DEVICE_FUNC + inline MapBase(PointerType dataPtr, Index rows, Index cols) + : m_data(dataPtr), m_rows(rows), m_cols(cols) + { + eigen_assert( (dataPtr == 0) + || ( rows >= 0 && (RowsAtCompileTime == Dynamic || RowsAtCompileTime == rows) + && cols >= 0 && (ColsAtCompileTime == Dynamic || ColsAtCompileTime == cols))); + checkSanity(); + } + + #ifdef EIGEN_MAPBASE_PLUGIN + #include EIGEN_MAPBASE_PLUGIN + #endif + + protected: + EIGEN_DEFAULT_COPY_CONSTRUCTOR(MapBase) + EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(MapBase) + + template + EIGEN_DEVICE_FUNC + void checkSanity(std::enable_if_t<(internal::traits::Alignment>0),void*> = 0) const + { +#if EIGEN_MAX_ALIGN_BYTES>0 + // innerStride() is not set yet when this function is called, so we optimistically assume the lowest plausible value: + const Index minInnerStride = InnerStrideAtCompileTime == Dynamic ? 1 : Index(InnerStrideAtCompileTime); + EIGEN_ONLY_USED_FOR_DEBUG(minInnerStride); + eigen_assert(( ((std::uintptr_t(m_data) % internal::traits::Alignment) == 0) + || (cols() * rows() * minInnerStride * sizeof(Scalar)) < internal::traits::Alignment ) && "data is not aligned"); +#endif + } + + template + EIGEN_DEVICE_FUNC + void checkSanity(std::enable_if_t::Alignment==0,void*> = 0) const + {} + + PointerType m_data; + const internal::variable_if_dynamic m_rows; + const internal::variable_if_dynamic m_cols; +}; + +/** \ingroup Core_Module + * + * \brief Base class for non-const dense Map and Block expression with direct access + * + * This base class provides the non-const low-level accessors (e.g. coeff and coeffRef) of + * dense Map and Block objects with direct access. + * It inherits MapBase which defines the const variant for reading specific entries. + * + * \sa class Map, class Block + */ +template class MapBase + : public MapBase +{ + typedef MapBase ReadOnlyMapBase; + public: + + typedef MapBase Base; + + typedef typename Base::Scalar Scalar; + typedef typename Base::PacketScalar PacketScalar; + typedef typename Base::StorageIndex StorageIndex; + typedef typename Base::PointerType PointerType; + + using Base::derived; + using Base::rows; + using Base::cols; + using Base::size; + using Base::coeff; + using Base::coeffRef; + + using Base::innerStride; + using Base::outerStride; + using Base::rowStride; + using Base::colStride; + + typedef std::conditional_t< + internal::is_lvalue::value, + Scalar, + const Scalar + > ScalarWithConstIfNotLvalue; + + EIGEN_DEVICE_FUNC + inline const Scalar* data() const { return this->m_data; } + EIGEN_DEVICE_FUNC + inline ScalarWithConstIfNotLvalue* data() { return this->m_data; } // no const-cast here so non-const-correct code will give a compile error + + EIGEN_DEVICE_FUNC + inline ScalarWithConstIfNotLvalue& coeffRef(Index row, Index col) + { + return this->m_data[col * colStride() + row * rowStride()]; + } + + EIGEN_DEVICE_FUNC + inline ScalarWithConstIfNotLvalue& coeffRef(Index index) + { + EIGEN_STATIC_ASSERT_INDEX_BASED_ACCESS(Derived) + return this->m_data[index * innerStride()]; + } + + template + inline void writePacket(Index row, Index col, const PacketScalar& val) + { + internal::pstoret + (this->m_data + (col * colStride() + row * rowStride()), val); + } + + template + inline void writePacket(Index index, const PacketScalar& val) + { + EIGEN_STATIC_ASSERT_INDEX_BASED_ACCESS(Derived) + internal::pstoret + (this->m_data + index * innerStride(), val); + } + + EIGEN_DEVICE_FUNC explicit inline MapBase(PointerType dataPtr) : Base(dataPtr) {} + EIGEN_DEVICE_FUNC inline MapBase(PointerType dataPtr, Index vecSize) : Base(dataPtr, vecSize) {} + EIGEN_DEVICE_FUNC inline MapBase(PointerType dataPtr, Index rows, Index cols) : Base(dataPtr, rows, cols) {} + + EIGEN_DEVICE_FUNC + Derived& operator=(const MapBase& other) + { + ReadOnlyMapBase::Base::operator=(other); + return derived(); + } + + // In theory we could simply refer to Base:Base::operator=, but MSVC does not like Base::Base, + // see bugs 821 and 920. + using ReadOnlyMapBase::Base::operator=; + protected: + EIGEN_DEFAULT_COPY_CONSTRUCTOR(MapBase) + EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(MapBase) +}; + +#undef EIGEN_STATIC_ASSERT_INDEX_BASED_ACCESS + +} // end namespace Eigen + +#endif // EIGEN_MAPBASE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/MathFunctions.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/MathFunctions.h new file mode 100644 index 0000000000000000000000000000000000000000..55077071b0933e461524ae93eee3f5be5d1a1e06 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/MathFunctions.h @@ -0,0 +1,1993 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2006-2010 Benoit Jacob +// Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_MATHFUNCTIONS_H +#define EIGEN_MATHFUNCTIONS_H + +// TODO this should better be moved to NumTraits +// Source: WolframAlpha +#define EIGEN_PI 3.141592653589793238462643383279502884197169399375105820974944592307816406L +#define EIGEN_LOG2E 1.442695040888963407359924681001892137426645954152985934135449406931109219L +#define EIGEN_LN2 0.693147180559945309417232121458176568075500134360255254120680009493393621L + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { + +/** \internal \class global_math_functions_filtering_base + * + * What it does: + * Defines a typedef 'type' as follows: + * - if type T has a member typedef Eigen_BaseClassForSpecializationOfGlobalMathFuncImpl, then + * global_math_functions_filtering_base::type is a typedef for it. + * - otherwise, global_math_functions_filtering_base::type is a typedef for T. + * + * How it's used: + * To allow to defined the global math functions (like sin...) in certain cases, like the Array expressions. + * When you do sin(array1+array2), the object array1+array2 has a complicated expression type, all what you want to know + * is that it inherits ArrayBase. So we implement a partial specialization of sin_impl for ArrayBase. + * So we must make sure to use sin_impl > and not sin_impl, otherwise our partial specialization + * won't be used. How does sin know that? That's exactly what global_math_functions_filtering_base tells it. + * + * How it's implemented: + * SFINAE in the style of enable_if. Highly susceptible of breaking compilers. With GCC, it sure does work, but if you replace + * the typename dummy by an integer template parameter, it doesn't work anymore! + */ + +template +struct global_math_functions_filtering_base +{ + typedef T type; +}; + +template struct always_void { typedef void type; }; + +template +struct global_math_functions_filtering_base + ::type + > +{ + typedef typename T::Eigen_BaseClassForSpecializationOfGlobalMathFuncImpl type; +}; + +#define EIGEN_MATHFUNC_IMPL(func, scalar) Eigen::internal::func##_impl::type> +#define EIGEN_MATHFUNC_RETVAL(func, scalar) typename Eigen::internal::func##_retval::type>::type + +/**************************************************************************** +* Implementation of real * +****************************************************************************/ + +template::IsComplex> +struct real_default_impl +{ + typedef typename NumTraits::Real RealScalar; + EIGEN_DEVICE_FUNC + static inline RealScalar run(const Scalar& x) + { + return x; + } +}; + +template +struct real_default_impl +{ + typedef typename NumTraits::Real RealScalar; + EIGEN_DEVICE_FUNC + static inline RealScalar run(const Scalar& x) + { + using std::real; + return real(x); + } +}; + +template struct real_impl : real_default_impl {}; + +#if defined(EIGEN_GPU_COMPILE_PHASE) +template +struct real_impl > +{ + typedef T RealScalar; + EIGEN_DEVICE_FUNC + static inline T run(const std::complex& x) + { + return x.real(); + } +}; +#endif + +template +struct real_retval +{ + typedef typename NumTraits::Real type; +}; + +/**************************************************************************** +* Implementation of imag * +****************************************************************************/ + +template::IsComplex> +struct imag_default_impl +{ + typedef typename NumTraits::Real RealScalar; + EIGEN_DEVICE_FUNC + static inline RealScalar run(const Scalar&) + { + return RealScalar(0); + } +}; + +template +struct imag_default_impl +{ + typedef typename NumTraits::Real RealScalar; + EIGEN_DEVICE_FUNC + static inline RealScalar run(const Scalar& x) + { + using std::imag; + return imag(x); + } +}; + +template struct imag_impl : imag_default_impl {}; + +#if defined(EIGEN_GPU_COMPILE_PHASE) +template +struct imag_impl > +{ + typedef T RealScalar; + EIGEN_DEVICE_FUNC + static inline T run(const std::complex& x) + { + return x.imag(); + } +}; +#endif + +template +struct imag_retval +{ + typedef typename NumTraits::Real type; +}; + +/**************************************************************************** +* Implementation of real_ref * +****************************************************************************/ + +template +struct real_ref_impl +{ + typedef typename NumTraits::Real RealScalar; + EIGEN_DEVICE_FUNC + static inline RealScalar& run(Scalar& x) + { + return reinterpret_cast(&x)[0]; + } + EIGEN_DEVICE_FUNC + static inline const RealScalar& run(const Scalar& x) + { + return reinterpret_cast(&x)[0]; + } +}; + +template +struct real_ref_retval +{ + typedef typename NumTraits::Real & type; +}; + +/**************************************************************************** +* Implementation of imag_ref * +****************************************************************************/ + +template +struct imag_ref_default_impl +{ + typedef typename NumTraits::Real RealScalar; + EIGEN_DEVICE_FUNC + static inline RealScalar& run(Scalar& x) + { + return reinterpret_cast(&x)[1]; + } + EIGEN_DEVICE_FUNC + static inline const RealScalar& run(const Scalar& x) + { + return reinterpret_cast(&x)[1]; + } +}; + +template +struct imag_ref_default_impl +{ + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + static inline Scalar run(Scalar&) + { + return Scalar(0); + } + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + static inline const Scalar run(const Scalar&) + { + return Scalar(0); + } +}; + +template +struct imag_ref_impl : imag_ref_default_impl::IsComplex> {}; + +template +struct imag_ref_retval +{ + typedef typename NumTraits::Real & type; +}; + +/**************************************************************************** +* Implementation of conj * +****************************************************************************/ + +template::IsComplex> +struct conj_default_impl +{ + EIGEN_DEVICE_FUNC + static inline Scalar run(const Scalar& x) + { + return x; + } +}; + +template +struct conj_default_impl +{ + EIGEN_DEVICE_FUNC + static inline Scalar run(const Scalar& x) + { + using std::conj; + return conj(x); + } +}; + +template::IsComplex> +struct conj_impl : conj_default_impl {}; + +template +struct conj_retval +{ + typedef Scalar type; +}; + +/**************************************************************************** +* Implementation of abs2 * +****************************************************************************/ + +template +struct abs2_impl_default +{ + typedef typename NumTraits::Real RealScalar; + EIGEN_DEVICE_FUNC + static inline RealScalar run(const Scalar& x) + { + return x*x; + } +}; + +template +struct abs2_impl_default // IsComplex +{ + typedef typename NumTraits::Real RealScalar; + EIGEN_DEVICE_FUNC + static inline RealScalar run(const Scalar& x) + { + return x.real()*x.real() + x.imag()*x.imag(); + } +}; + +template +struct abs2_impl +{ + typedef typename NumTraits::Real RealScalar; + EIGEN_DEVICE_FUNC + static inline RealScalar run(const Scalar& x) + { + return abs2_impl_default::IsComplex>::run(x); + } +}; + +template +struct abs2_retval +{ + typedef typename NumTraits::Real type; +}; + +/**************************************************************************** +* Implementation of sqrt/rsqrt * +****************************************************************************/ + +template +struct sqrt_impl +{ + EIGEN_DEVICE_FUNC + static EIGEN_ALWAYS_INLINE Scalar run(const Scalar& x) + { + EIGEN_USING_STD(sqrt); + return sqrt(x); + } +}; + +// Complex sqrt defined in MathFunctionsImpl.h. +template EIGEN_DEVICE_FUNC std::complex complex_sqrt(const std::complex& a_x); + +// Custom implementation is faster than `std::sqrt`, works on +// GPU, and correctly handles special cases (unlike MSVC). +template +struct sqrt_impl > +{ + EIGEN_DEVICE_FUNC + static EIGEN_ALWAYS_INLINE std::complex run(const std::complex& x) + { + return complex_sqrt(x); + } +}; + +template +struct sqrt_retval +{ + typedef Scalar type; +}; + +// Default implementation relies on numext::sqrt, at bottom of file. +template +struct rsqrt_impl; + +// Complex rsqrt defined in MathFunctionsImpl.h. +template EIGEN_DEVICE_FUNC std::complex complex_rsqrt(const std::complex& a_x); + +template +struct rsqrt_impl > +{ + EIGEN_DEVICE_FUNC + static EIGEN_ALWAYS_INLINE std::complex run(const std::complex& x) + { + return complex_rsqrt(x); + } +}; + +template +struct rsqrt_retval +{ + typedef Scalar type; +}; + +/**************************************************************************** +* Implementation of norm1 * +****************************************************************************/ + +template +struct norm1_default_impl; + +template +struct norm1_default_impl +{ + typedef typename NumTraits::Real RealScalar; + EIGEN_DEVICE_FUNC + static inline RealScalar run(const Scalar& x) + { + EIGEN_USING_STD(abs); + return abs(x.real()) + abs(x.imag()); + } +}; + +template +struct norm1_default_impl +{ + EIGEN_DEVICE_FUNC + static inline Scalar run(const Scalar& x) + { + EIGEN_USING_STD(abs); + return abs(x); + } +}; + +template +struct norm1_impl : norm1_default_impl::IsComplex> {}; + +template +struct norm1_retval +{ + typedef typename NumTraits::Real type; +}; + +/**************************************************************************** +* Implementation of hypot * +****************************************************************************/ + +template struct hypot_impl; + +template +struct hypot_retval +{ + typedef typename NumTraits::Real type; +}; + +/**************************************************************************** +* Implementation of cast * +****************************************************************************/ + +template +struct cast_impl +{ + EIGEN_DEVICE_FUNC + static inline NewType run(const OldType& x) + { + return static_cast(x); + } +}; + +template +struct cast_impl { + EIGEN_DEVICE_FUNC + static inline bool run(const OldType& x) { return x != OldType(0); } +}; + + +// Casting from S -> Complex leads to an implicit conversion from S to T, +// generating warnings on clang. Here we explicitly cast the real component. +template +struct cast_impl::IsComplex && NumTraits::IsComplex + >> +{ + EIGEN_DEVICE_FUNC + static inline NewType run(const OldType& x) + { + typedef typename NumTraits::Real NewReal; + return static_cast(static_cast(x)); + } +}; + +// here, for once, we're plainly returning NewType: we don't want cast to do weird things. + +template +EIGEN_DEVICE_FUNC +inline NewType cast(const OldType& x) +{ + return cast_impl::run(x); +} + +/**************************************************************************** +* Implementation of arg * +****************************************************************************/ + +// Visual Studio 2017 has a bug where arg(float) returns 0 for negative inputs. +// This seems to be fixed in VS 2019. +#if (!EIGEN_COMP_MSVC || EIGEN_COMP_MSVC >= 1920) +// std::arg is only defined for types of std::complex, or integer types or float/double/long double +template::IsComplex || is_integral::value + || is_same::value || is_same::value + || is_same::value > +struct arg_default_impl; + +template +struct arg_default_impl { + typedef typename NumTraits::Real RealScalar; + EIGEN_DEVICE_FUNC + static inline RealScalar run(const Scalar& x) + { + // There is no official ::arg on device in CUDA/HIP, so we always need to use std::arg. + using std::arg; + return static_cast(arg(x)); + } +}; + +// Must be non-complex floating-point type (e.g. half/bfloat16). +template +struct arg_default_impl { + typedef typename NumTraits::Real RealScalar; + EIGEN_DEVICE_FUNC + static inline RealScalar run(const Scalar& x) + { + return (x < Scalar(0)) ? RealScalar(EIGEN_PI) : RealScalar(0); + } +}; +#else +template::IsComplex> +struct arg_default_impl +{ + typedef typename NumTraits::Real RealScalar; + EIGEN_DEVICE_FUNC + static inline RealScalar run(const Scalar& x) + { + return (x < RealScalar(0)) ? RealScalar(EIGEN_PI) : RealScalar(0); + } +}; + +template +struct arg_default_impl +{ + typedef typename NumTraits::Real RealScalar; + EIGEN_DEVICE_FUNC + static inline RealScalar run(const Scalar& x) + { + EIGEN_USING_STD(arg); + return arg(x); + } +}; +#endif +template struct arg_impl : arg_default_impl {}; + +template +struct arg_retval +{ + typedef typename NumTraits::Real type; +}; + +/**************************************************************************** +* Implementation of expm1 * +****************************************************************************/ + +// This implementation is based on GSL Math's expm1. +namespace std_fallback { + // fallback expm1 implementation in case there is no expm1(Scalar) function in namespace of Scalar, + // or that there is no suitable std::expm1 function available. Implementation + // attributed to Kahan. See: http://www.plunk.org/~hatch/rightway.php. + template + EIGEN_DEVICE_FUNC inline Scalar expm1(const Scalar& x) { + EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar) + typedef typename NumTraits::Real RealScalar; + + EIGEN_USING_STD(exp); + Scalar u = exp(x); + if (numext::equal_strict(u, Scalar(1))) { + return x; + } + Scalar um1 = u - RealScalar(1); + if (numext::equal_strict(um1, Scalar(-1))) { + return RealScalar(-1); + } + + EIGEN_USING_STD(log); + Scalar logu = log(u); + return numext::equal_strict(u, logu) ? u : (u - RealScalar(1)) * x / logu; + } +} + +template +struct expm1_impl { + EIGEN_DEVICE_FUNC static inline Scalar run(const Scalar& x) + { + EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar) + EIGEN_USING_STD(expm1); + return expm1(x); + } +}; + +template +struct expm1_retval +{ + typedef Scalar type; +}; + +/**************************************************************************** +* Implementation of log * +****************************************************************************/ + +// Complex log defined in MathFunctionsImpl.h. +template EIGEN_DEVICE_FUNC std::complex complex_log(const std::complex& z); + +template +struct log_impl { + EIGEN_DEVICE_FUNC static inline Scalar run(const Scalar& x) + { + EIGEN_USING_STD(log); + return static_cast(log(x)); + } +}; + +template +struct log_impl > { + EIGEN_DEVICE_FUNC static inline std::complex run(const std::complex& z) + { + return complex_log(z); + } +}; + +/**************************************************************************** +* Implementation of log1p * +****************************************************************************/ + +namespace std_fallback { + // fallback log1p implementation in case there is no log1p(Scalar) function in namespace of Scalar, + // or that there is no suitable std::log1p function available + template + EIGEN_DEVICE_FUNC inline Scalar log1p(const Scalar& x) { + EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar) + typedef typename NumTraits::Real RealScalar; + EIGEN_USING_STD(log); + Scalar x1p = RealScalar(1) + x; + Scalar log_1p = log_impl::run(x1p); + const bool is_small = numext::equal_strict(x1p, Scalar(1)); + const bool is_inf = numext::equal_strict(x1p, log_1p); + return (is_small || is_inf) ? x : x * (log_1p / (x1p - RealScalar(1))); + } +} + +template +struct log1p_impl { + EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar) + + EIGEN_DEVICE_FUNC static inline Scalar run(const Scalar& x) + { + EIGEN_USING_STD(log1p); + return log1p(x); + } +}; + +// Specialization for complex types that are not supported by std::log1p. +template +struct log1p_impl > { + EIGEN_STATIC_ASSERT_NON_INTEGER(RealScalar) + + EIGEN_DEVICE_FUNC static inline std::complex run( + const std::complex& x) { + return std_fallback::log1p(x); + } +}; + +template +struct log1p_retval +{ + typedef Scalar type; +}; + +/**************************************************************************** +* Implementation of pow * +****************************************************************************/ + +template::IsInteger&&NumTraits::IsInteger> +struct pow_impl +{ + //typedef Scalar retval; + typedef typename ScalarBinaryOpTraits >::ReturnType result_type; + static EIGEN_DEVICE_FUNC inline result_type run(const ScalarX& x, const ScalarY& y) + { + EIGEN_USING_STD(pow); + return pow(x, y); + } +}; + +template +struct pow_impl +{ + typedef ScalarX result_type; + static EIGEN_DEVICE_FUNC inline ScalarX run(ScalarX x, ScalarY y) + { + ScalarX res(1); + eigen_assert(!NumTraits::IsSigned || y >= 0); + if(y & 1) res *= x; + y >>= 1; + while(y) + { + x *= x; + if(y&1) res *= x; + y >>= 1; + } + return res; + } +}; + +/**************************************************************************** +* Implementation of random * +****************************************************************************/ + +template +struct random_default_impl {}; + +template +struct random_impl : random_default_impl::IsComplex, NumTraits::IsInteger> {}; + +template +struct random_retval +{ + typedef Scalar type; +}; + +template inline EIGEN_MATHFUNC_RETVAL(random, Scalar) random(const Scalar& x, const Scalar& y); +template inline EIGEN_MATHFUNC_RETVAL(random, Scalar) random(); + +template +struct random_default_impl +{ + static inline Scalar run(const Scalar& x, const Scalar& y) + { + return x + (y-x) * Scalar(std::rand()) / Scalar(RAND_MAX); + } + static inline Scalar run() + { + return run(Scalar(NumTraits::IsSigned ? -1 : 0), Scalar(1)); + } +}; + +enum { + meta_floor_log2_terminate, + meta_floor_log2_move_up, + meta_floor_log2_move_down, + meta_floor_log2_bogus +}; + +template struct meta_floor_log2_selector +{ + enum { middle = (lower + upper) / 2, + value = (upper <= lower + 1) ? int(meta_floor_log2_terminate) + : (n < (1 << middle)) ? int(meta_floor_log2_move_down) + : (n==0) ? int(meta_floor_log2_bogus) + : int(meta_floor_log2_move_up) + }; +}; + +template::value> +struct meta_floor_log2 {}; + +template +struct meta_floor_log2 +{ + enum { value = meta_floor_log2::middle>::value }; +}; + +template +struct meta_floor_log2 +{ + enum { value = meta_floor_log2::middle, upper>::value }; +}; + +template +struct meta_floor_log2 +{ + enum { value = (n >= ((unsigned int)(1) << (lower+1))) ? lower+1 : lower }; +}; + +template +struct meta_floor_log2 +{ + // no value, error at compile time +}; + +template +struct random_default_impl +{ + static inline Scalar run(const Scalar& x, const Scalar& y) + { + if (y <= x) + return x; + // ScalarU is the unsigned counterpart of Scalar, possibly Scalar itself. + typedef typename make_unsigned::type ScalarU; + // ScalarX is the widest of ScalarU and unsigned int. + // We'll deal only with ScalarX and unsigned int below thus avoiding signed + // types and arithmetic and signed overflows (which are undefined behavior). + typedef std::conditional_t<(ScalarU(-1) > unsigned(-1)), ScalarU, unsigned> ScalarX; + // The following difference doesn't overflow, provided our integer types are two's + // complement and have the same number of padding bits in signed and unsigned variants. + // This is the case in most modern implementations of C++. + ScalarX range = ScalarX(y) - ScalarX(x); + ScalarX offset = 0; + ScalarX divisor = 1; + ScalarX multiplier = 1; + const unsigned rand_max = RAND_MAX; + if (range <= rand_max) divisor = (rand_max + 1) / (range + 1); + else multiplier = 1 + range / (rand_max + 1); + // Rejection sampling. + do { + offset = (unsigned(std::rand()) * multiplier) / divisor; + } while (offset > range); + return Scalar(ScalarX(x) + offset); + } + + static inline Scalar run() + { +#ifdef EIGEN_MAKING_DOCS + return run(Scalar(NumTraits::IsSigned ? -10 : 0), Scalar(10)); +#else + enum { rand_bits = meta_floor_log2<(unsigned int)(RAND_MAX)+1>::value, + scalar_bits = sizeof(Scalar) * CHAR_BIT, + shift = plain_enum_max(0, int(rand_bits) - int(scalar_bits)), + offset = NumTraits::IsSigned ? (1 << (plain_enum_min(rand_bits, scalar_bits)-1)) : 0 + }; + return Scalar((std::rand() >> shift) - offset); +#endif + } +}; + +template +struct random_default_impl +{ + static inline Scalar run(const Scalar& x, const Scalar& y) + { + return Scalar(random(x.real(), y.real()), + random(x.imag(), y.imag())); + } + static inline Scalar run() + { + typedef typename NumTraits::Real RealScalar; + return Scalar(random(), random()); + } +}; + +template +inline EIGEN_MATHFUNC_RETVAL(random, Scalar) random(const Scalar& x, const Scalar& y) +{ + return EIGEN_MATHFUNC_IMPL(random, Scalar)::run(x, y); +} + +template +inline EIGEN_MATHFUNC_RETVAL(random, Scalar) random() +{ + return EIGEN_MATHFUNC_IMPL(random, Scalar)::run(); +} + +// Implementation of is* functions + +template +EIGEN_DEVICE_FUNC std::enable_if_t::has_infinity || + std::numeric_limits::has_quiet_NaN || + std::numeric_limits::has_signaling_NaN), + bool> +isfinite_impl(const T&) { + return true; +} + +template +EIGEN_DEVICE_FUNC std::enable_if_t<(std::numeric_limits::has_infinity || std::numeric_limits::has_quiet_NaN || + std::numeric_limits::has_signaling_NaN) && + (!NumTraits::IsComplex), + bool> +isfinite_impl(const T& x) { + EIGEN_USING_STD(isfinite); + return isfinite EIGEN_NOT_A_MACRO (x); +} + +template +EIGEN_DEVICE_FUNC std::enable_if_t::has_infinity, bool> +isinf_impl(const T&) { + return false; +} + +template +EIGEN_DEVICE_FUNC std::enable_if_t< + (std::numeric_limits::has_infinity && !NumTraits::IsComplex), bool> +isinf_impl(const T& x) { + EIGEN_USING_STD(isinf); + return isinf EIGEN_NOT_A_MACRO (x); +} + +template +EIGEN_DEVICE_FUNC std::enable_if_t::has_quiet_NaN || + std::numeric_limits::has_signaling_NaN), + bool> +isnan_impl(const T&) { + return false; +} + +template +EIGEN_DEVICE_FUNC + std::enable_if_t<(std::numeric_limits::has_quiet_NaN || + std::numeric_limits::has_signaling_NaN) && + (!NumTraits::IsComplex), + bool> + isnan_impl(const T& x) { + EIGEN_USING_STD(isnan); + return isnan EIGEN_NOT_A_MACRO (x); +} + +// The following overload are defined at the end of this file +template +EIGEN_DEVICE_FUNC bool isfinite_impl(const std::complex& x); +template +EIGEN_DEVICE_FUNC bool isnan_impl(const std::complex& x); +template +EIGEN_DEVICE_FUNC bool isinf_impl(const std::complex& x); +template +T generic_fast_tanh_float(const T& a_x); + +/**************************************************************************** + * Implementation of sign * + ****************************************************************************/ +template ::IsComplex != 0), + bool IsInteger = (NumTraits::IsInteger != 0)> +struct sign_impl { + EIGEN_DEVICE_FUNC + static inline Scalar run(const Scalar& a) { + return Scalar((a > Scalar(0)) - (a < Scalar(0))); + } +}; + +template +struct sign_impl { + EIGEN_DEVICE_FUNC + static inline Scalar run(const Scalar& a) { + return (isnan_impl)(a) ? a + : Scalar((a > Scalar(0)) - (a < Scalar(0))); + } +}; + +template +struct sign_impl { + EIGEN_DEVICE_FUNC + static inline Scalar run(const Scalar& a) { + using real_type = typename NumTraits::Real; + EIGEN_USING_STD(abs); + real_type aa = abs(a); + if (aa == real_type(0)) return Scalar(0); + aa = real_type(1) / aa; + return Scalar(a.real() * aa, a.imag() * aa); + } +}; + +// The sign function for bool is the identity. +template <> +struct sign_impl { + EIGEN_DEVICE_FUNC + static inline bool run(const bool& a) { return a; } +}; + +template +struct sign_retval { + typedef Scalar type; +}; + + +template ::type>::IsInteger> +struct nearest_integer_impl { + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar run_floor(const Scalar& x) { EIGEN_USING_STD(floor) return floor(x); } + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar run_ceil(const Scalar& x) { EIGEN_USING_STD(ceil) return ceil(x); } + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar run_rint(const Scalar& x) { EIGEN_USING_STD(rint) return rint(x); } + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar run_round(const Scalar& x) { EIGEN_USING_STD(round) return round(x); } +}; +template +struct nearest_integer_impl { + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar run_floor(const Scalar& x) { return x; } + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar run_ceil(const Scalar& x) { return x; } + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar run_rint(const Scalar& x) { return x; } + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar run_round(const Scalar& x) { return x; } +}; + +} // end namespace internal + +/**************************************************************************** +* Generic math functions * +****************************************************************************/ + +namespace numext { + +#if (!defined(EIGEN_GPUCC) || defined(EIGEN_CONSTEXPR_ARE_DEVICE_FUNC)) +template +EIGEN_DEVICE_FUNC +EIGEN_ALWAYS_INLINE T mini(const T& x, const T& y) +{ + EIGEN_USING_STD(min) + return min EIGEN_NOT_A_MACRO (x,y); +} + +template +EIGEN_DEVICE_FUNC +EIGEN_ALWAYS_INLINE T maxi(const T& x, const T& y) +{ + EIGEN_USING_STD(max) + return max EIGEN_NOT_A_MACRO (x,y); +} +#else +template +EIGEN_DEVICE_FUNC +EIGEN_ALWAYS_INLINE T mini(const T& x, const T& y) +{ + return y < x ? y : x; +} +template<> +EIGEN_DEVICE_FUNC +EIGEN_ALWAYS_INLINE float mini(const float& x, const float& y) +{ + return fminf(x, y); +} +template<> +EIGEN_DEVICE_FUNC +EIGEN_ALWAYS_INLINE double mini(const double& x, const double& y) +{ + return fmin(x, y); +} + +#ifndef EIGEN_GPU_COMPILE_PHASE +template<> +EIGEN_DEVICE_FUNC +EIGEN_ALWAYS_INLINE long double mini(const long double& x, const long double& y) +{ +#if defined(EIGEN_HIPCC) + // no "fminl" on HIP yet + return (x < y) ? x : y; +#else + return fminl(x, y); +#endif +} +#endif + +template +EIGEN_DEVICE_FUNC +EIGEN_ALWAYS_INLINE T maxi(const T& x, const T& y) +{ + return x < y ? y : x; +} +template<> +EIGEN_DEVICE_FUNC +EIGEN_ALWAYS_INLINE float maxi(const float& x, const float& y) +{ + return fmaxf(x, y); +} +template<> +EIGEN_DEVICE_FUNC +EIGEN_ALWAYS_INLINE double maxi(const double& x, const double& y) +{ + return fmax(x, y); +} +#ifndef EIGEN_GPU_COMPILE_PHASE +template<> +EIGEN_DEVICE_FUNC +EIGEN_ALWAYS_INLINE long double maxi(const long double& x, const long double& y) +{ +#if defined(EIGEN_HIPCC) + // no "fmaxl" on HIP yet + return (x > y) ? x : y; +#else + return fmaxl(x, y); +#endif +} +#endif +#endif + +#if defined(SYCL_DEVICE_ONLY) + + +#define SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY(NAME, FUNC) \ + SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_char) \ + SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_short) \ + SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_int) \ + SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_long) +#define SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_UNARY(NAME, FUNC) \ + SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_char) \ + SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_short) \ + SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_int) \ + SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_long) +#define SYCL_SPECIALIZE_UNSIGNED_INTEGER_TYPES_BINARY(NAME, FUNC) \ + SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_uchar) \ + SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_ushort) \ + SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_uint) \ + SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_ulong) +#define SYCL_SPECIALIZE_UNSIGNED_INTEGER_TYPES_UNARY(NAME, FUNC) \ + SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_uchar) \ + SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_ushort) \ + SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_uint) \ + SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_ulong) +#define SYCL_SPECIALIZE_INTEGER_TYPES_BINARY(NAME, FUNC) \ + SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY(NAME, FUNC) \ + SYCL_SPECIALIZE_UNSIGNED_INTEGER_TYPES_BINARY(NAME, FUNC) +#define SYCL_SPECIALIZE_INTEGER_TYPES_UNARY(NAME, FUNC) \ + SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_UNARY(NAME, FUNC) \ + SYCL_SPECIALIZE_UNSIGNED_INTEGER_TYPES_UNARY(NAME, FUNC) +#define SYCL_SPECIALIZE_FLOATING_TYPES_BINARY(NAME, FUNC) \ + SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_float) \ + SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC,cl::sycl::cl_double) +#define SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(NAME, FUNC) \ + SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_float) \ + SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC,cl::sycl::cl_double) +#define SYCL_SPECIALIZE_FLOATING_TYPES_UNARY_FUNC_RET_TYPE(NAME, FUNC, RET_TYPE) \ + SYCL_SPECIALIZE_GEN_UNARY_FUNC(NAME, FUNC, RET_TYPE, cl::sycl::cl_float) \ + SYCL_SPECIALIZE_GEN_UNARY_FUNC(NAME, FUNC, RET_TYPE, cl::sycl::cl_double) + +#define SYCL_SPECIALIZE_GEN_UNARY_FUNC(NAME, FUNC, RET_TYPE, ARG_TYPE) \ +template<> \ + EIGEN_DEVICE_FUNC \ + EIGEN_ALWAYS_INLINE RET_TYPE NAME(const ARG_TYPE& x) { \ + return cl::sycl::FUNC(x); \ + } + +#define SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, TYPE) \ + SYCL_SPECIALIZE_GEN_UNARY_FUNC(NAME, FUNC, TYPE, TYPE) + +#define SYCL_SPECIALIZE_GEN1_BINARY_FUNC(NAME, FUNC, RET_TYPE, ARG_TYPE1, ARG_TYPE2) \ + template<> \ + EIGEN_DEVICE_FUNC \ + EIGEN_ALWAYS_INLINE RET_TYPE NAME(const ARG_TYPE1& x, const ARG_TYPE2& y) { \ + return cl::sycl::FUNC(x, y); \ + } + +#define SYCL_SPECIALIZE_GEN2_BINARY_FUNC(NAME, FUNC, RET_TYPE, ARG_TYPE) \ + SYCL_SPECIALIZE_GEN1_BINARY_FUNC(NAME, FUNC, RET_TYPE, ARG_TYPE, ARG_TYPE) + +#define SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, TYPE) \ + SYCL_SPECIALIZE_GEN2_BINARY_FUNC(NAME, FUNC, TYPE, TYPE) + +SYCL_SPECIALIZE_INTEGER_TYPES_BINARY(mini, min) +SYCL_SPECIALIZE_FLOATING_TYPES_BINARY(mini, fmin) +SYCL_SPECIALIZE_INTEGER_TYPES_BINARY(maxi, max) +SYCL_SPECIALIZE_FLOATING_TYPES_BINARY(maxi, fmax) + +#endif + + +template +EIGEN_DEVICE_FUNC +inline EIGEN_MATHFUNC_RETVAL(real, Scalar) real(const Scalar& x) +{ + return EIGEN_MATHFUNC_IMPL(real, Scalar)::run(x); +} + +template +EIGEN_DEVICE_FUNC +inline internal::add_const_on_value_type_t< EIGEN_MATHFUNC_RETVAL(real_ref, Scalar) > real_ref(const Scalar& x) +{ + return internal::real_ref_impl::run(x); +} + +template +EIGEN_DEVICE_FUNC +inline EIGEN_MATHFUNC_RETVAL(real_ref, Scalar) real_ref(Scalar& x) +{ + return EIGEN_MATHFUNC_IMPL(real_ref, Scalar)::run(x); +} + +template +EIGEN_DEVICE_FUNC +inline EIGEN_MATHFUNC_RETVAL(imag, Scalar) imag(const Scalar& x) +{ + return EIGEN_MATHFUNC_IMPL(imag, Scalar)::run(x); +} + +template +EIGEN_DEVICE_FUNC +inline EIGEN_MATHFUNC_RETVAL(arg, Scalar) arg(const Scalar& x) +{ + return EIGEN_MATHFUNC_IMPL(arg, Scalar)::run(x); +} + +template +EIGEN_DEVICE_FUNC +inline internal::add_const_on_value_type_t< EIGEN_MATHFUNC_RETVAL(imag_ref, Scalar) > imag_ref(const Scalar& x) +{ + return internal::imag_ref_impl::run(x); +} + +template +EIGEN_DEVICE_FUNC +inline EIGEN_MATHFUNC_RETVAL(imag_ref, Scalar) imag_ref(Scalar& x) +{ + return EIGEN_MATHFUNC_IMPL(imag_ref, Scalar)::run(x); +} + +template +EIGEN_DEVICE_FUNC +inline EIGEN_MATHFUNC_RETVAL(conj, Scalar) conj(const Scalar& x) +{ + return EIGEN_MATHFUNC_IMPL(conj, Scalar)::run(x); +} + +template +EIGEN_DEVICE_FUNC +inline EIGEN_MATHFUNC_RETVAL(sign, Scalar) sign(const Scalar& x) +{ + return EIGEN_MATHFUNC_IMPL(sign, Scalar)::run(x); +} + +template +EIGEN_DEVICE_FUNC +inline EIGEN_MATHFUNC_RETVAL(abs2, Scalar) abs2(const Scalar& x) +{ + return EIGEN_MATHFUNC_IMPL(abs2, Scalar)::run(x); +} + +EIGEN_DEVICE_FUNC +inline bool abs2(bool x) { return x; } + +template +EIGEN_DEVICE_FUNC +EIGEN_ALWAYS_INLINE T absdiff(const T& x, const T& y) +{ + return x > y ? x - y : y - x; +} +template<> +EIGEN_DEVICE_FUNC +EIGEN_ALWAYS_INLINE float absdiff(const float& x, const float& y) +{ + return fabsf(x - y); +} +template<> +EIGEN_DEVICE_FUNC +EIGEN_ALWAYS_INLINE double absdiff(const double& x, const double& y) +{ + return fabs(x - y); +} + +// HIP and CUDA do not support long double. +#ifndef EIGEN_GPU_COMPILE_PHASE +template<> +EIGEN_DEVICE_FUNC +EIGEN_ALWAYS_INLINE long double absdiff(const long double& x, const long double& y) { + return fabsl(x - y); +} +#endif + +template +EIGEN_DEVICE_FUNC +inline EIGEN_MATHFUNC_RETVAL(norm1, Scalar) norm1(const Scalar& x) +{ + return EIGEN_MATHFUNC_IMPL(norm1, Scalar)::run(x); +} + +template +EIGEN_DEVICE_FUNC +inline EIGEN_MATHFUNC_RETVAL(hypot, Scalar) hypot(const Scalar& x, const Scalar& y) +{ + return EIGEN_MATHFUNC_IMPL(hypot, Scalar)::run(x, y); +} + +#if defined(SYCL_DEVICE_ONLY) + SYCL_SPECIALIZE_FLOATING_TYPES_BINARY(hypot, hypot) +#endif + +template +EIGEN_DEVICE_FUNC +inline EIGEN_MATHFUNC_RETVAL(log1p, Scalar) log1p(const Scalar& x) +{ + return EIGEN_MATHFUNC_IMPL(log1p, Scalar)::run(x); +} + +#if defined(SYCL_DEVICE_ONLY) +SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(log1p, log1p) +#endif + +#if defined(EIGEN_GPUCC) +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float log1p(const float &x) { return ::log1pf(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double log1p(const double &x) { return ::log1p(x); } +#endif + +template +EIGEN_DEVICE_FUNC +inline typename internal::pow_impl::result_type pow(const ScalarX& x, const ScalarY& y) +{ + return internal::pow_impl::run(x, y); +} + +#if defined(SYCL_DEVICE_ONLY) +SYCL_SPECIALIZE_FLOATING_TYPES_BINARY(pow, pow) +#endif + +template EIGEN_DEVICE_FUNC bool (isnan) (const T &x) { return internal::isnan_impl(x); } +template EIGEN_DEVICE_FUNC bool (isinf) (const T &x) { return internal::isinf_impl(x); } +template EIGEN_DEVICE_FUNC bool (isfinite)(const T &x) { return internal::isfinite_impl(x); } + +#if defined(SYCL_DEVICE_ONLY) +SYCL_SPECIALIZE_FLOATING_TYPES_UNARY_FUNC_RET_TYPE(isnan, isnan, bool) +SYCL_SPECIALIZE_FLOATING_TYPES_UNARY_FUNC_RET_TYPE(isinf, isinf, bool) +SYCL_SPECIALIZE_FLOATING_TYPES_UNARY_FUNC_RET_TYPE(isfinite, isfinite, bool) +#endif + +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE +Scalar rint(const Scalar& x) +{ + return internal::nearest_integer_impl::run_rint(x); +} + +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE +Scalar round(const Scalar& x) +{ + return internal::nearest_integer_impl::run_round(x); +} + +#if defined(SYCL_DEVICE_ONLY) +SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(round, round) +#endif + +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE +Scalar (floor)(const Scalar& x) +{ + return internal::nearest_integer_impl::run_floor(x); +} + +#if defined(SYCL_DEVICE_ONLY) +SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(floor, floor) +#endif + +#if defined(EIGEN_GPUCC) +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float floor(const float &x) { return ::floorf(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double floor(const double &x) { return ::floor(x); } +#endif + +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE +Scalar (ceil)(const Scalar& x) +{ + return internal::nearest_integer_impl::run_ceil(x); +} + +#if defined(SYCL_DEVICE_ONLY) +SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(ceil, ceil) +#endif + +#if defined(EIGEN_GPUCC) +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float ceil(const float &x) { return ::ceilf(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double ceil(const double &x) { return ::ceil(x); } +#endif + + +/** Log base 2 for 32 bits positive integers. + * Conveniently returns 0 for x==0. */ +inline int log2(int x) +{ + eigen_assert(x>=0); + unsigned int v(x); + static const int table[32] = { 0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30, 8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31 }; + v |= v >> 1; + v |= v >> 2; + v |= v >> 4; + v |= v >> 8; + v |= v >> 16; + return table[(v * 0x07C4ACDDU) >> 27]; +} + +/** \returns the square root of \a x. + * + * It is essentially equivalent to + * \code using std::sqrt; return sqrt(x); \endcode + * but slightly faster for float/double and some compilers (e.g., gcc), thanks to + * specializations when SSE is enabled. + * + * It's usage is justified in performance critical functions, like norm/normalize. + */ +template +EIGEN_DEVICE_FUNC +EIGEN_ALWAYS_INLINE EIGEN_MATHFUNC_RETVAL(sqrt, Scalar) sqrt(const Scalar& x) +{ + return EIGEN_MATHFUNC_IMPL(sqrt, Scalar)::run(x); +} + +// Boolean specialization, avoids implicit float to bool conversion (-Wimplicit-conversion-floating-point-to-bool). +template<> +EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_DEVICE_FUNC +bool sqrt(const bool &x) { return x; } + +#if defined(SYCL_DEVICE_ONLY) +SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(sqrt, sqrt) +#endif + +/** \returns the reciprocal square root of \a x. **/ +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T rsqrt(const T& x) +{ + return internal::rsqrt_impl::run(x); +} + +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T log(const T &x) { + return internal::log_impl::run(x); +} + +#if defined(SYCL_DEVICE_ONLY) +SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(log, log) +#endif + + +#if defined(EIGEN_GPUCC) +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float log(const float &x) { return ::logf(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double log(const double &x) { return ::log(x); } +#endif + +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +std::enable_if_t::IsSigned || NumTraits::IsComplex,typename NumTraits::Real> +abs(const T &x) { + EIGEN_USING_STD(abs); + return abs(x); +} + +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +std::enable_if_t::IsSigned || NumTraits::IsComplex),typename NumTraits::Real> +abs(const T &x) { + return x; +} + +#if defined(SYCL_DEVICE_ONLY) +SYCL_SPECIALIZE_INTEGER_TYPES_UNARY(abs, abs) +SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(abs, fabs) +#endif + +#if defined(EIGEN_GPUCC) +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float abs(const float &x) { return ::fabsf(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double abs(const double &x) { return ::fabs(x); } + +template <> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float abs(const std::complex& x) { + return ::hypotf(x.real(), x.imag()); +} + +template <> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double abs(const std::complex& x) { + return ::hypot(x.real(), x.imag()); +} +#endif + +template ::IsInteger, bool IsSigned = NumTraits::IsSigned> +struct signbit_impl; +template +struct signbit_impl { + static constexpr size_t Size = sizeof(Scalar); + static constexpr size_t Shift = (CHAR_BIT * Size) - 1; + using intSize_t = typename get_integer_by_size::signed_type; + EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE static Scalar run(const Scalar& x) { + intSize_t a = bit_cast(x); + a = a >> Shift; + Scalar result = bit_cast(a); + return result; + } +}; +template +struct signbit_impl { + static constexpr size_t Size = sizeof(Scalar); + static constexpr size_t Shift = (CHAR_BIT * Size) - 1; + EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE static constexpr Scalar run(const Scalar& x) { return x >> Shift; } +}; +template +struct signbit_impl { + EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE static constexpr Scalar run(const Scalar& ) { + return Scalar(0); + } +}; +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE static constexpr Scalar signbit(const Scalar& x) { + return signbit_impl::run(x); +} + +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T exp(const T &x) { + EIGEN_USING_STD(exp); + return exp(x); +} + +#if defined(SYCL_DEVICE_ONLY) +SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(exp, exp) +#endif + +#if defined(EIGEN_GPUCC) +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float exp(const float &x) { return ::expf(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double exp(const double &x) { return ::exp(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +std::complex exp(const std::complex& x) { + float com = ::expf(x.real()); + float res_real = com * ::cosf(x.imag()); + float res_imag = com * ::sinf(x.imag()); + return std::complex(res_real, res_imag); +} + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +std::complex exp(const std::complex& x) { + double com = ::exp(x.real()); + double res_real = com * ::cos(x.imag()); + double res_imag = com * ::sin(x.imag()); + return std::complex(res_real, res_imag); +} +#endif + +template +EIGEN_DEVICE_FUNC +inline EIGEN_MATHFUNC_RETVAL(expm1, Scalar) expm1(const Scalar& x) +{ + return EIGEN_MATHFUNC_IMPL(expm1, Scalar)::run(x); +} + +#if defined(SYCL_DEVICE_ONLY) +SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(expm1, expm1) +#endif + +#if defined(EIGEN_GPUCC) +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float expm1(const float &x) { return ::expm1f(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double expm1(const double &x) { return ::expm1(x); } +#endif + +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T cos(const T &x) { + EIGEN_USING_STD(cos); + return cos(x); +} + +#if defined(SYCL_DEVICE_ONLY) +SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(cos,cos) +#endif + +#if defined(EIGEN_GPUCC) +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float cos(const float &x) { return ::cosf(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double cos(const double &x) { return ::cos(x); } +#endif + +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T sin(const T &x) { + EIGEN_USING_STD(sin); + return sin(x); +} + +#if defined(SYCL_DEVICE_ONLY) +SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(sin, sin) +#endif + +#if defined(EIGEN_GPUCC) +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float sin(const float &x) { return ::sinf(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double sin(const double &x) { return ::sin(x); } +#endif + +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T tan(const T &x) { + EIGEN_USING_STD(tan); + return tan(x); +} + +#if defined(SYCL_DEVICE_ONLY) +SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(tan, tan) +#endif + +#if defined(EIGEN_GPUCC) +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float tan(const float &x) { return ::tanf(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double tan(const double &x) { return ::tan(x); } +#endif + +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T acos(const T &x) { + EIGEN_USING_STD(acos); + return acos(x); +} + +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T acosh(const T &x) { + EIGEN_USING_STD(acosh); + return static_cast(acosh(x)); +} + +#if defined(SYCL_DEVICE_ONLY) +SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(acos, acos) +SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(acosh, acosh) +#endif + +#if defined(EIGEN_GPUCC) +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float acos(const float &x) { return ::acosf(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double acos(const double &x) { return ::acos(x); } +#endif + +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T asin(const T &x) { + EIGEN_USING_STD(asin); + return asin(x); +} + +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T asinh(const T &x) { + EIGEN_USING_STD(asinh); + return static_cast(asinh(x)); +} + +#if defined(SYCL_DEVICE_ONLY) +SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(asin, asin) +SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(asinh, asinh) +#endif + +#if defined(EIGEN_GPUCC) +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float asin(const float &x) { return ::asinf(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double asin(const double &x) { return ::asin(x); } +#endif + +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T atan(const T &x) { + EIGEN_USING_STD(atan); + return static_cast(atan(x)); +} + +template ::IsComplex, int> = 0> +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T atan2(const T& y, const T& x) { + EIGEN_USING_STD(atan2); + return static_cast(atan2(y, x)); +} + +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T atanh(const T &x) { + EIGEN_USING_STD(atanh); + return static_cast(atanh(x)); +} + +#if defined(SYCL_DEVICE_ONLY) +SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(atan, atan) +SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(atanh, atanh) +#endif + +#if defined(EIGEN_GPUCC) +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float atan(const float &x) { return ::atanf(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double atan(const double &x) { return ::atan(x); } +#endif + + +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T cosh(const T &x) { + EIGEN_USING_STD(cosh); + return static_cast(cosh(x)); +} + +#if defined(SYCL_DEVICE_ONLY) +SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(cosh, cosh) +#endif + +#if defined(EIGEN_GPUCC) +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float cosh(const float &x) { return ::coshf(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double cosh(const double &x) { return ::cosh(x); } +#endif + +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T sinh(const T &x) { + EIGEN_USING_STD(sinh); + return static_cast(sinh(x)); +} + +#if defined(SYCL_DEVICE_ONLY) +SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(sinh, sinh) +#endif + +#if defined(EIGEN_GPUCC) +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float sinh(const float &x) { return ::sinhf(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double sinh(const double &x) { return ::sinh(x); } +#endif + +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T tanh(const T &x) { + EIGEN_USING_STD(tanh); + return tanh(x); +} + +#if (!defined(EIGEN_GPUCC)) && EIGEN_FAST_MATH && !defined(SYCL_DEVICE_ONLY) +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float tanh(float x) { return internal::generic_fast_tanh_float(x); } +#endif + +#if defined(SYCL_DEVICE_ONLY) +SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(tanh, tanh) +#endif + +#if defined(EIGEN_GPUCC) +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float tanh(const float &x) { return ::tanhf(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double tanh(const double &x) { return ::tanh(x); } +#endif + +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T fmod(const T& a, const T& b) { + EIGEN_USING_STD(fmod); + return fmod(a, b); +} + +#if defined(SYCL_DEVICE_ONLY) +SYCL_SPECIALIZE_FLOATING_TYPES_BINARY(fmod, fmod) +#endif + +#if defined(EIGEN_GPUCC) +template <> +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float fmod(const float& a, const float& b) { + return ::fmodf(a, b); +} + +template <> +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double fmod(const double& a, const double& b) { + return ::fmod(a, b); +} +#endif + +#if defined(SYCL_DEVICE_ONLY) +#undef SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY +#undef SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_UNARY +#undef SYCL_SPECIALIZE_UNSIGNED_INTEGER_TYPES_BINARY +#undef SYCL_SPECIALIZE_UNSIGNED_INTEGER_TYPES_UNARY +#undef SYCL_SPECIALIZE_INTEGER_TYPES_BINARY +#undef SYCL_SPECIALIZE_UNSIGNED_INTEGER_TYPES_UNARY +#undef SYCL_SPECIALIZE_FLOATING_TYPES_BINARY +#undef SYCL_SPECIALIZE_FLOATING_TYPES_UNARY +#undef SYCL_SPECIALIZE_FLOATING_TYPES_UNARY_FUNC_RET_TYPE +#undef SYCL_SPECIALIZE_GEN_UNARY_FUNC +#undef SYCL_SPECIALIZE_UNARY_FUNC +#undef SYCL_SPECIALIZE_GEN1_BINARY_FUNC +#undef SYCL_SPECIALIZE_GEN2_BINARY_FUNC +#undef SYCL_SPECIALIZE_BINARY_FUNC +#endif + +} // end namespace numext + +namespace internal { + +template +EIGEN_DEVICE_FUNC bool isfinite_impl(const std::complex& x) +{ + return (numext::isfinite)(numext::real(x)) && (numext::isfinite)(numext::imag(x)); +} + +template +EIGEN_DEVICE_FUNC bool isnan_impl(const std::complex& x) +{ + return (numext::isnan)(numext::real(x)) || (numext::isnan)(numext::imag(x)); +} + +template +EIGEN_DEVICE_FUNC bool isinf_impl(const std::complex& x) +{ + return ((numext::isinf)(numext::real(x)) || (numext::isinf)(numext::imag(x))) && (!(numext::isnan)(x)); +} + +/**************************************************************************** +* Implementation of fuzzy comparisons * +****************************************************************************/ + +template +struct scalar_fuzzy_default_impl {}; + +template +struct scalar_fuzzy_default_impl +{ + typedef typename NumTraits::Real RealScalar; + template EIGEN_DEVICE_FUNC + static inline bool isMuchSmallerThan(const Scalar& x, const OtherScalar& y, const RealScalar& prec) + { + return numext::abs(x) <= numext::abs(y) * prec; + } + EIGEN_DEVICE_FUNC + static inline bool isApprox(const Scalar& x, const Scalar& y, const RealScalar& prec) + { + return numext::abs(x - y) <= numext::mini(numext::abs(x), numext::abs(y)) * prec; + } + EIGEN_DEVICE_FUNC + static inline bool isApproxOrLessThan(const Scalar& x, const Scalar& y, const RealScalar& prec) + { + return x <= y || isApprox(x, y, prec); + } +}; + +template +struct scalar_fuzzy_default_impl +{ + typedef typename NumTraits::Real RealScalar; + template EIGEN_DEVICE_FUNC + static inline bool isMuchSmallerThan(const Scalar& x, const Scalar&, const RealScalar&) + { + return x == Scalar(0); + } + EIGEN_DEVICE_FUNC + static inline bool isApprox(const Scalar& x, const Scalar& y, const RealScalar&) + { + return x == y; + } + EIGEN_DEVICE_FUNC + static inline bool isApproxOrLessThan(const Scalar& x, const Scalar& y, const RealScalar&) + { + return x <= y; + } +}; + +template +struct scalar_fuzzy_default_impl +{ + typedef typename NumTraits::Real RealScalar; + template EIGEN_DEVICE_FUNC + static inline bool isMuchSmallerThan(const Scalar& x, const OtherScalar& y, const RealScalar& prec) + { + return numext::abs2(x) <= numext::abs2(y) * prec * prec; + } + EIGEN_DEVICE_FUNC + static inline bool isApprox(const Scalar& x, const Scalar& y, const RealScalar& prec) + { + return numext::abs2(x - y) <= numext::mini(numext::abs2(x), numext::abs2(y)) * prec * prec; + } +}; + +template +struct scalar_fuzzy_impl : scalar_fuzzy_default_impl::IsComplex, NumTraits::IsInteger> {}; + +template EIGEN_DEVICE_FUNC +inline bool isMuchSmallerThan(const Scalar& x, const OtherScalar& y, + const typename NumTraits::Real &precision = NumTraits::dummy_precision()) +{ + return scalar_fuzzy_impl::template isMuchSmallerThan(x, y, precision); +} + +template EIGEN_DEVICE_FUNC +inline bool isApprox(const Scalar& x, const Scalar& y, + const typename NumTraits::Real &precision = NumTraits::dummy_precision()) +{ + return scalar_fuzzy_impl::isApprox(x, y, precision); +} + +template EIGEN_DEVICE_FUNC +inline bool isApproxOrLessThan(const Scalar& x, const Scalar& y, + const typename NumTraits::Real &precision = NumTraits::dummy_precision()) +{ + return scalar_fuzzy_impl::isApproxOrLessThan(x, y, precision); +} + +/****************************************** +*** The special case of the bool type *** +******************************************/ + +template<> struct random_impl +{ + static inline bool run() + { + return random(0,1)==0 ? false : true; + } + + static inline bool run(const bool& a, const bool& b) + { + return random(a, b)==0 ? false : true; + } +}; + +template<> struct scalar_fuzzy_impl +{ + typedef bool RealScalar; + + template EIGEN_DEVICE_FUNC + static inline bool isMuchSmallerThan(const bool& x, const bool&, const bool&) + { + return !x; + } + + EIGEN_DEVICE_FUNC + static inline bool isApprox(bool x, bool y, bool) + { + return x == y; + } + + EIGEN_DEVICE_FUNC + static inline bool isApproxOrLessThan(const bool& x, const bool& y, const bool&) + { + return (!x) || y; + } + +}; + +} // end namespace internal + +// Default implementations that rely on other numext implementations +namespace internal { + +// Specialization for complex types that are not supported by std::expm1. +template +struct expm1_impl > { + EIGEN_STATIC_ASSERT_NON_INTEGER(RealScalar) + + EIGEN_DEVICE_FUNC static inline std::complex run( + const std::complex& x) { + RealScalar xr = x.real(); + RealScalar xi = x.imag(); + // expm1(z) = exp(z) - 1 + // = exp(x + i * y) - 1 + // = exp(x) * (cos(y) + i * sin(y)) - 1 + // = exp(x) * cos(y) - 1 + i * exp(x) * sin(y) + // Imag(expm1(z)) = exp(x) * sin(y) + // Real(expm1(z)) = exp(x) * cos(y) - 1 + // = exp(x) * cos(y) - 1. + // = expm1(x) + exp(x) * (cos(y) - 1) + // = expm1(x) + exp(x) * (2 * sin(y / 2) ** 2) + RealScalar erm1 = numext::expm1(xr); + RealScalar er = erm1 + RealScalar(1.); + RealScalar sin2 = numext::sin(xi / RealScalar(2.)); + sin2 = sin2 * sin2; + RealScalar s = numext::sin(xi); + RealScalar real_part = erm1 - RealScalar(2.) * er * sin2; + return std::complex(real_part, er * s); + } +}; + +template +struct rsqrt_impl { + EIGEN_DEVICE_FUNC + static EIGEN_ALWAYS_INLINE T run(const T& x) { + return T(1)/numext::sqrt(x); + } +}; + +#if defined(EIGEN_GPU_COMPILE_PHASE) +template +struct conj_impl, true> +{ + EIGEN_DEVICE_FUNC + static inline std::complex run(const std::complex& x) + { + return std::complex(numext::real(x), -numext::imag(x)); + } +}; +#endif + +} // end namespace internal + +} // end namespace Eigen + +#endif // EIGEN_MATHFUNCTIONS_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/MathFunctionsImpl.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/MathFunctionsImpl.h new file mode 100644 index 0000000000000000000000000000000000000000..86c06b2b13970244fadd4db93e642de16ed029b0 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/MathFunctionsImpl.h @@ -0,0 +1,337 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2014 Pedro Gonnet (pedro.gonnet@gmail.com) +// Copyright (C) 2016 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_MATHFUNCTIONSIMPL_H +#define EIGEN_MATHFUNCTIONSIMPL_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { + +/** \internal Fast reciprocal using Newton-Raphson's method. + + Preconditions: + 1. The starting guess provided in approx_a_recip must have at least half + the leading mantissa bits in the correct result, such that a single + Newton-Raphson step is sufficient to get within 1-2 ulps of the currect + result. + 2. If a is zero, approx_a_recip must be infinite with the same sign as a. + 3. If a is infinite, approx_a_recip must be zero with the same sign as a. + + If the preconditions are satisfied, which they are for for the _*_rcp_ps + instructions on x86, the result has a maximum relative error of 2 ulps, + and correctly handles reciprocals of zero, infinity, and NaN. +*/ +template +struct generic_reciprocal_newton_step { + static_assert(Steps > 0, "Steps must be at least 1."); + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE Packet + run(const Packet& a, const Packet& approx_a_recip) { + using Scalar = typename unpacket_traits::type; + const Packet two = pset1(Scalar(2)); + // Refine the approximation using one Newton-Raphson step: + // x_{i} = x_{i-1} * (2 - a * x_{i-1}) + const Packet x = + generic_reciprocal_newton_step::run(a, approx_a_recip); + const Packet tmp = pnmadd(a, x, two); + // If tmp is NaN, it means that a is either +/-0 or +/-Inf. + // In this case return the approximation directly. + const Packet is_not_nan = pcmp_eq(tmp, tmp); + return pselect(is_not_nan, pmul(x, tmp), x); + } +}; + +template +struct generic_reciprocal_newton_step { + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE Packet + run(const Packet& /*unused*/, const Packet& approx_rsqrt) { + return approx_rsqrt; + } +}; + + +/** \internal Fast reciprocal sqrt using Newton-Raphson's method. + + Preconditions: + 1. The starting guess provided in approx_a_recip must have at least half + the leading mantissa bits in the correct result, such that a single + Newton-Raphson step is sufficient to get within 1-2 ulps of the currect + result. + 2. If a is zero, approx_a_recip must be infinite with the same sign as a. + 3. If a is infinite, approx_a_recip must be zero with the same sign as a. + + If the preconditions are satisfied, which they are for for the _*_rcp_ps + instructions on x86, the result has a maximum relative error of 2 ulps, + and correctly handles zero, infinity, and NaN. Positive denormals are + treated as zero. +*/ +template +struct generic_rsqrt_newton_step { + static_assert(Steps > 0, "Steps must be at least 1."); + using Scalar = typename unpacket_traits::type; + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE Packet + run(const Packet& a, const Packet& approx_rsqrt) { + constexpr Scalar kMinusHalf = Scalar(-1)/Scalar(2); + const Packet cst_minus_half = pset1(kMinusHalf); + const Packet cst_minus_one = pset1(Scalar(-1)); + + Packet inv_sqrt = approx_rsqrt; + for (int step = 0; step < Steps; ++step) { + // Refine the approximation using one Newton-Raphson step: + // h_n = (x * inv_sqrt) * inv_sqrt - 1 (so that h_n is nearly 0). + // inv_sqrt = inv_sqrt - 0.5 * inv_sqrt * h_n + Packet r2 = pmul(a, inv_sqrt); + Packet half_r = pmul(inv_sqrt, cst_minus_half); + Packet h_n = pmadd(r2, inv_sqrt, cst_minus_one); + inv_sqrt = pmadd(half_r, h_n, inv_sqrt); + } + + // If x is NaN, then either: + // 1) the input is NaN + // 2) zero and infinity were multiplied + // In either of these cases, return approx_rsqrt + return pselect(pisnan(inv_sqrt), approx_rsqrt, inv_sqrt); + } +}; + +template +struct generic_rsqrt_newton_step { + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE Packet + run(const Packet& /*unused*/, const Packet& approx_rsqrt) { + return approx_rsqrt; + } +}; + +/** \internal Fast sqrt using Newton-Raphson's method. + + Preconditions: + 1. The starting guess for the reciprocal sqrt provided in approx_rsqrt must + have at least half the leading mantissa bits in the correct result, such + that a single Newton-Raphson step is sufficient to get within 1-2 ulps of + the currect result. + 2. If a is zero, approx_rsqrt must be infinite. + 3. If a is infinite, approx_rsqrt must be zero. + + If the preconditions are satisfied, which they are for for the _*_rsqrt_ps + instructions on x86, the result has a maximum relative error of 2 ulps, + and correctly handles zero and infinity, and NaN. Positive denormal inputs + are treated as zero. +*/ +template +struct generic_sqrt_newton_step { + static_assert(Steps > 0, "Steps must be at least 1."); + + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE Packet + run(const Packet& a, const Packet& approx_rsqrt) { + using Scalar = typename unpacket_traits::type; + const Packet one_point_five = pset1(Scalar(1.5)); + const Packet minus_half = pset1(Scalar(-0.5)); + // If a is inf or zero, return a directly. + const Packet inf_mask = pcmp_eq(a, pset1(NumTraits::infinity())); + const Packet return_a = por(pcmp_eq(a, pzero(a)), inf_mask); + // Do a single step of Newton's iteration for reciprocal square root: + // x_{n+1} = x_n * (1.5 + (-0.5 * x_n) * (a * x_n))). + // The Newton's step is computed this way to avoid over/under-flows. + Packet rsqrt = pmul(approx_rsqrt, pmadd(pmul(minus_half, approx_rsqrt), pmul(a, approx_rsqrt), one_point_five)); + for (int step = 1; step < Steps; ++step) { + rsqrt = pmul(rsqrt, pmadd(pmul(minus_half, rsqrt), pmul(a, rsqrt), one_point_five)); + } + + // Return sqrt(x) = x * rsqrt(x) for non-zero finite positive arguments. + // Return a itself for 0 or +inf, NaN for negative arguments. + return pselect(return_a, a, pmul(a, rsqrt)); + } +}; + +/** \internal \returns the hyperbolic tan of \a a (coeff-wise) + Doesn't do anything fancy, just a 13/6-degree rational interpolant which + is accurate up to a couple of ulps in the (approximate) range [-8, 8], + outside of which tanh(x) = +/-1 in single precision. The input is clamped + to the range [-c, c]. The value c is chosen as the smallest value where + the approximation evaluates to exactly 1. In the reange [-0.0004, 0.0004] + the approximation tanh(x) ~= x is used for better accuracy as x tends to zero. + + This implementation works on both scalars and packets. +*/ +template +T generic_fast_tanh_float(const T& a_x) +{ + // Clamp the inputs to the range [-c, c] +#ifdef EIGEN_VECTORIZE_FMA + const T plus_clamp = pset1(7.99881172180175781f); + const T minus_clamp = pset1(-7.99881172180175781f); +#else + const T plus_clamp = pset1(7.90531110763549805f); + const T minus_clamp = pset1(-7.90531110763549805f); +#endif + const T tiny = pset1(0.0004f); + const T x = pmax(pmin(a_x, plus_clamp), minus_clamp); + const T tiny_mask = pcmp_lt(pabs(a_x), tiny); + // The monomial coefficients of the numerator polynomial (odd). + const T alpha_1 = pset1(4.89352455891786e-03f); + const T alpha_3 = pset1(6.37261928875436e-04f); + const T alpha_5 = pset1(1.48572235717979e-05f); + const T alpha_7 = pset1(5.12229709037114e-08f); + const T alpha_9 = pset1(-8.60467152213735e-11f); + const T alpha_11 = pset1(2.00018790482477e-13f); + const T alpha_13 = pset1(-2.76076847742355e-16f); + + // The monomial coefficients of the denominator polynomial (even). + const T beta_0 = pset1(4.89352518554385e-03f); + const T beta_2 = pset1(2.26843463243900e-03f); + const T beta_4 = pset1(1.18534705686654e-04f); + const T beta_6 = pset1(1.19825839466702e-06f); + + // Since the polynomials are odd/even, we need x^2. + const T x2 = pmul(x, x); + + // Evaluate the numerator polynomial p. + T p = pmadd(x2, alpha_13, alpha_11); + p = pmadd(x2, p, alpha_9); + p = pmadd(x2, p, alpha_7); + p = pmadd(x2, p, alpha_5); + p = pmadd(x2, p, alpha_3); + p = pmadd(x2, p, alpha_1); + p = pmul(x, p); + + // Evaluate the denominator polynomial q. + T q = pmadd(x2, beta_6, beta_4); + q = pmadd(x2, q, beta_2); + q = pmadd(x2, q, beta_0); + + // Divide the numerator by the denominator. + return pselect(tiny_mask, x, pdiv(p, q)); +} + +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE +RealScalar positive_real_hypot(const RealScalar& x, const RealScalar& y) +{ + // IEEE IEC 6059 special cases. + if ((numext::isinf)(x) || (numext::isinf)(y)) + return NumTraits::infinity(); + if ((numext::isnan)(x) || (numext::isnan)(y)) + return NumTraits::quiet_NaN(); + + EIGEN_USING_STD(sqrt); + RealScalar p, qp; + p = numext::maxi(x,y); + if(numext::is_exactly_zero(p)) return RealScalar(0); + qp = numext::mini(y,x) / p; + return p * sqrt(RealScalar(1) + qp*qp); +} + +template +struct hypot_impl +{ + typedef typename NumTraits::Real RealScalar; + static EIGEN_DEVICE_FUNC + inline RealScalar run(const Scalar& x, const Scalar& y) + { + EIGEN_USING_STD(abs); + return positive_real_hypot(abs(x), abs(y)); + } +}; + +// Generic complex sqrt implementation that correctly handles corner cases +// according to https://en.cppreference.com/w/cpp/numeric/complex/sqrt +template +EIGEN_DEVICE_FUNC std::complex complex_sqrt(const std::complex& z) { + // Computes the principal sqrt of the input. + // + // For a complex square root of the number x + i*y. We want to find real + // numbers u and v such that + // (u + i*v)^2 = x + i*y <=> + // u^2 - v^2 + i*2*u*v = x + i*v. + // By equating the real and imaginary parts we get: + // u^2 - v^2 = x + // 2*u*v = y. + // + // For x >= 0, this has the numerically stable solution + // u = sqrt(0.5 * (x + sqrt(x^2 + y^2))) + // v = y / (2 * u) + // and for x < 0, + // v = sign(y) * sqrt(0.5 * (-x + sqrt(x^2 + y^2))) + // u = y / (2 * v) + // + // Letting w = sqrt(0.5 * (|x| + |z|)), + // if x == 0: u = w, v = sign(y) * w + // if x > 0: u = w, v = y / (2 * w) + // if x < 0: u = |y| / (2 * w), v = sign(y) * w + + const T x = numext::real(z); + const T y = numext::imag(z); + const T zero = T(0); + const T w = numext::sqrt(T(0.5) * (numext::abs(x) + numext::hypot(x, y))); + + return + (numext::isinf)(y) ? std::complex(NumTraits::infinity(), y) + : numext::is_exactly_zero(x) ? std::complex(w, y < zero ? -w : w) + : x > zero ? std::complex(w, y / (2 * w)) + : std::complex(numext::abs(y) / (2 * w), y < zero ? -w : w ); +} + +// Generic complex rsqrt implementation. +template +EIGEN_DEVICE_FUNC std::complex complex_rsqrt(const std::complex& z) { + // Computes the principal reciprocal sqrt of the input. + // + // For a complex reciprocal square root of the number z = x + i*y. We want to + // find real numbers u and v such that + // (u + i*v)^2 = 1 / (x + i*y) <=> + // u^2 - v^2 + i*2*u*v = x/|z|^2 - i*v/|z|^2. + // By equating the real and imaginary parts we get: + // u^2 - v^2 = x/|z|^2 + // 2*u*v = y/|z|^2. + // + // For x >= 0, this has the numerically stable solution + // u = sqrt(0.5 * (x + |z|)) / |z| + // v = -y / (2 * u * |z|) + // and for x < 0, + // v = -sign(y) * sqrt(0.5 * (-x + |z|)) / |z| + // u = -y / (2 * v * |z|) + // + // Letting w = sqrt(0.5 * (|x| + |z|)), + // if x == 0: u = w / |z|, v = -sign(y) * w / |z| + // if x > 0: u = w / |z|, v = -y / (2 * w * |z|) + // if x < 0: u = |y| / (2 * w * |z|), v = -sign(y) * w / |z| + + const T x = numext::real(z); + const T y = numext::imag(z); + const T zero = T(0); + + const T abs_z = numext::hypot(x, y); + const T w = numext::sqrt(T(0.5) * (numext::abs(x) + abs_z)); + const T woz = w / abs_z; + // Corner cases consistent with 1/sqrt(z) on gcc/clang. + return + numext::is_exactly_zero(abs_z) ? std::complex(NumTraits::infinity(), NumTraits::quiet_NaN()) + : ((numext::isinf)(x) || (numext::isinf)(y)) ? std::complex(zero, zero) + : numext::is_exactly_zero(x) ? std::complex(woz, y < zero ? woz : -woz) + : x > zero ? std::complex(woz, -y / (2 * w * abs_z)) + : std::complex(numext::abs(y) / (2 * w * abs_z), y < zero ? woz : -woz ); +} + +template +EIGEN_DEVICE_FUNC std::complex complex_log(const std::complex& z) { + // Computes complex log. + T a = numext::abs(z); + EIGEN_USING_STD(atan2); + T b = atan2(z.imag(), z.real()); + return std::complex(numext::log(a), b); +} + +} // end namespace internal + +} // end namespace Eigen + +#endif // EIGEN_MATHFUNCTIONSIMPL_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Matrix.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Matrix.h new file mode 100644 index 0000000000000000000000000000000000000000..c7747f16d23f24320fdc3532ba76d14c1d157278 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Matrix.h @@ -0,0 +1,557 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2006-2010 Benoit Jacob +// Copyright (C) 2008-2009 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_MATRIX_H +#define EIGEN_MATRIX_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { +template +struct traits > +{ +private: + constexpr static int size = internal::size_at_compile_time(Rows_,Cols_); + typedef typename find_best_packet::type PacketScalar; + enum { + row_major_bit = Options_&RowMajor ? RowMajorBit : 0, + is_dynamic_size_storage = MaxRows_==Dynamic || MaxCols_==Dynamic, + max_size = is_dynamic_size_storage ? Dynamic : MaxRows_*MaxCols_, + default_alignment = compute_default_alignment::value, + actual_alignment = ((Options_&DontAlign)==0) ? default_alignment : 0, + required_alignment = unpacket_traits::alignment, + packet_access_bit = (packet_traits::Vectorizable && (EIGEN_UNALIGNED_VECTORIZE || (actual_alignment>=required_alignment))) ? PacketAccessBit : 0 + }; + +public: + typedef Scalar_ Scalar; + typedef Dense StorageKind; + typedef Eigen::Index StorageIndex; + typedef MatrixXpr XprKind; + enum { + RowsAtCompileTime = Rows_, + ColsAtCompileTime = Cols_, + MaxRowsAtCompileTime = MaxRows_, + MaxColsAtCompileTime = MaxCols_, + Flags = compute_matrix_flags(Options_), + Options = Options_, + InnerStrideAtCompileTime = 1, + OuterStrideAtCompileTime = (Options&RowMajor) ? ColsAtCompileTime : RowsAtCompileTime, + + // FIXME, the following flag in only used to define NeedsToAlign in PlainObjectBase + EvaluatorFlags = LinearAccessBit | DirectAccessBit | packet_access_bit | row_major_bit, + Alignment = actual_alignment + }; +}; +} + +/** \class Matrix + * \ingroup Core_Module + * + * \brief The matrix class, also used for vectors and row-vectors + * + * The %Matrix class is the work-horse for all \em dense (\ref dense "note") matrices and vectors within Eigen. + * Vectors are matrices with one column, and row-vectors are matrices with one row. + * + * The %Matrix class encompasses \em both fixed-size and dynamic-size objects (\ref fixedsize "note"). + * + * The first three template parameters are required: + * \tparam Scalar_ Numeric type, e.g. float, double, int or std::complex. + * User defined scalar types are supported as well (see \ref user_defined_scalars "here"). + * \tparam Rows_ Number of rows, or \b Dynamic + * \tparam Cols_ Number of columns, or \b Dynamic + * + * The remaining template parameters are optional -- in most cases you don't have to worry about them. + * \tparam Options_ A combination of either \b #RowMajor or \b #ColMajor, and of either + * \b #AutoAlign or \b #DontAlign. + * The former controls \ref TopicStorageOrders "storage order", and defaults to column-major. The latter controls alignment, which is required + * for vectorization. It defaults to aligning matrices except for fixed sizes that aren't a multiple of the packet size. + * \tparam MaxRows_ Maximum number of rows. Defaults to \a Rows_ (\ref maxrows "note"). + * \tparam MaxCols_ Maximum number of columns. Defaults to \a Cols_ (\ref maxrows "note"). + * + * Eigen provides a number of typedefs covering the usual cases. Here are some examples: + * + * \li \c Matrix2d is a 2x2 square matrix of doubles (\c Matrix) + * \li \c Vector4f is a vector of 4 floats (\c Matrix) + * \li \c RowVector3i is a row-vector of 3 ints (\c Matrix) + * + * \li \c MatrixXf is a dynamic-size matrix of floats (\c Matrix) + * \li \c VectorXf is a dynamic-size vector of floats (\c Matrix) + * + * \li \c Matrix2Xf is a partially fixed-size (dynamic-size) matrix of floats (\c Matrix) + * \li \c MatrixX3d is a partially dynamic-size (fixed-size) matrix of double (\c Matrix) + * + * See \link matrixtypedefs this page \endlink for a complete list of predefined \em %Matrix and \em Vector typedefs. + * + * You can access elements of vectors and matrices using normal subscripting: + * + * \code + * Eigen::VectorXd v(10); + * v[0] = 0.1; + * v[1] = 0.2; + * v(0) = 0.3; + * v(1) = 0.4; + * + * Eigen::MatrixXi m(10, 10); + * m(0, 1) = 1; + * m(0, 2) = 2; + * m(0, 3) = 3; + * \endcode + * + * This class can be extended with the help of the plugin mechanism described on the page + * \ref TopicCustomizing_Plugins by defining the preprocessor symbol \c EIGEN_MATRIX_PLUGIN. + * + * Some notes: + * + *
+ *
\anchor dense Dense versus sparse:
+ *
This %Matrix class handles dense, not sparse matrices and vectors. For sparse matrices and vectors, see the Sparse module. + * + * Dense matrices and vectors are plain usual arrays of coefficients. All the coefficients are stored, in an ordinary contiguous array. + * This is unlike Sparse matrices and vectors where the coefficients are stored as a list of nonzero coefficients.
+ * + *
\anchor fixedsize Fixed-size versus dynamic-size:
+ *
Fixed-size means that the numbers of rows and columns are known are compile-time. In this case, Eigen allocates the array + * of coefficients as a fixed-size array, as a class member. This makes sense for very small matrices, typically up to 4x4, sometimes up + * to 16x16. Larger matrices should be declared as dynamic-size even if one happens to know their size at compile-time. + * + * Dynamic-size means that the numbers of rows or columns are not necessarily known at compile-time. In this case they are runtime + * variables, and the array of coefficients is allocated dynamically on the heap. + * + * Note that \em dense matrices, be they Fixed-size or Dynamic-size, do not expand dynamically in the sense of a std::map. + * If you want this behavior, see the Sparse module.
+ * + *
\anchor maxrows MaxRows_ and MaxCols_:
+ *
In most cases, one just leaves these parameters to the default values. + * These parameters mean the maximum size of rows and columns that the matrix may have. They are useful in cases + * when the exact numbers of rows and columns are not known are compile-time, but it is known at compile-time that they cannot + * exceed a certain value. This happens when taking dynamic-size blocks inside fixed-size matrices: in this case MaxRows_ and MaxCols_ + * are the dimensions of the original matrix, while Rows_ and Cols_ are Dynamic.
+ *
+ * + * ABI and storage layout + * + * The table below summarizes the ABI of some possible Matrix instances which is fixed thorough the lifetime of Eigen 3. + * + * + * + * + * + * + *
Matrix typeEquivalent C structure
\code Matrix \endcode\code + * struct { + * T *data; // with (size_t(data)%EIGEN_MAX_ALIGN_BYTES)==0 + * Eigen::Index rows, cols; + * }; + * \endcode
\code + * Matrix + * Matrix \endcode\code + * struct { + * T *data; // with (size_t(data)%EIGEN_MAX_ALIGN_BYTES)==0 + * Eigen::Index size; + * }; + * \endcode
\code Matrix \endcode\code + * struct { + * T data[Rows*Cols]; // with (size_t(data)%A(Rows*Cols*sizeof(T)))==0 + * }; + * \endcode
\code Matrix \endcode\code + * struct { + * T data[MaxRows*MaxCols]; // with (size_t(data)%A(MaxRows*MaxCols*sizeof(T)))==0 + * Eigen::Index rows, cols; + * }; + * \endcode
+ * Note that in this table Rows, Cols, MaxRows and MaxCols are all positive integers. A(S) is defined to the largest possible power-of-two + * smaller to EIGEN_MAX_STATIC_ALIGN_BYTES. + * + * \see MatrixBase for the majority of the API methods for matrices, \ref TopicClassHierarchy, + * \ref TopicStorageOrders + */ + +template +class Matrix + : public PlainObjectBase > +{ + public: + + /** \brief Base class typedef. + * \sa PlainObjectBase + */ + typedef PlainObjectBase Base; + + enum { Options = Options_ }; + + EIGEN_DENSE_PUBLIC_INTERFACE(Matrix) + + typedef typename Base::PlainObject PlainObject; + + using Base::base; + using Base::coeffRef; + + /** + * \brief Assigns matrices to each other. + * + * \note This is a special case of the templated operator=. Its purpose is + * to prevent a default operator= from hiding the templated operator=. + * + * \callgraph + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Matrix& operator=(const Matrix& other) + { + return Base::_set(other); + } + + /** \internal + * \brief Copies the value of the expression \a other into \c *this with automatic resizing. + * + * *this might be resized to match the dimensions of \a other. If *this was a null matrix (not already initialized), + * it will be initialized. + * + * Note that copying a row-vector into a vector (and conversely) is allowed. + * The resizing, if any, is then done in the appropriate way so that row-vectors + * remain row-vectors and vectors remain vectors. + */ + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Matrix& operator=(const DenseBase& other) + { + return Base::_set(other); + } + + /* Here, doxygen failed to copy the brief information when using \copydoc */ + + /** + * \brief Copies the generic expression \a other into *this. + * \copydetails DenseBase::operator=(const EigenBase &other) + */ + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Matrix& operator=(const EigenBase &other) + { + return Base::operator=(other); + } + + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Matrix& operator=(const ReturnByValue& func) + { + return Base::operator=(func); + } + + /** \brief Default constructor. + * + * For fixed-size matrices, does nothing. + * + * For dynamic-size matrices, creates an empty matrix of size 0. Does not allocate any array. Such a matrix + * is called a null matrix. This constructor is the unique way to create null matrices: resizing + * a matrix to 0 is not supported. + * + * \sa resize(Index,Index) + */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Matrix() : Base() + { + EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED + } + + // FIXME is it still needed + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit Matrix(internal::constructor_without_unaligned_array_assert) + : Base(internal::constructor_without_unaligned_array_assert()) + { EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Matrix(Matrix&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_constructible::value) + : Base(std::move(other)) {} + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Matrix& operator=(Matrix&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_assignable::value) + { + Base::operator=(std::move(other)); + return *this; + } + + /** \copydoc PlainObjectBase(const Scalar&, const Scalar&, const Scalar&, const Scalar&, const ArgTypes&... args) + * + * Example: \include Matrix_variadic_ctor_cxx11.cpp + * Output: \verbinclude Matrix_variadic_ctor_cxx11.out + * + * \sa Matrix(const std::initializer_list>&) + */ + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Matrix(const Scalar& a0, const Scalar& a1, const Scalar& a2, const Scalar& a3, const ArgTypes&... args) + : Base(a0, a1, a2, a3, args...) {} + + /** \brief Constructs a Matrix and initializes it from the coefficients given as initializer-lists grouped by row. \cpp11 + * + * In the general case, the constructor takes a list of rows, each row being represented as a list of coefficients: + * + * Example: \include Matrix_initializer_list_23_cxx11.cpp + * Output: \verbinclude Matrix_initializer_list_23_cxx11.out + * + * Each of the inner initializer lists must contain the exact same number of elements, otherwise an assertion is triggered. + * + * In the case of a compile-time column vector, implicit transposition from a single row is allowed. + * Therefore VectorXd{{1,2,3,4,5}} is legal and the more verbose syntax + * RowVectorXd{{1},{2},{3},{4},{5}} can be avoided: + * + * Example: \include Matrix_initializer_list_vector_cxx11.cpp + * Output: \verbinclude Matrix_initializer_list_vector_cxx11.out + * + * In the case of fixed-sized matrices, the initializer list sizes must exactly match the matrix sizes, + * and implicit transposition is allowed for compile-time vectors only. + * + * \sa Matrix(const Scalar& a0, const Scalar& a1, const Scalar& a2, const Scalar& a3, const ArgTypes&... args) + */ + EIGEN_DEVICE_FUNC explicit constexpr EIGEN_STRONG_INLINE Matrix( + const std::initializer_list>& list) + : Base(list) {} + +#ifndef EIGEN_PARSED_BY_DOXYGEN + + // This constructor is for both 1x1 matrices and dynamic vectors + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit Matrix(const T& x) + { + Base::template _init1(x); + } + + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Matrix(const T0& x, const T1& y) + { + Base::template _init2(x, y); + } + + +#else + /** \brief Constructs a fixed-sized matrix initialized with coefficients starting at \a data */ + EIGEN_DEVICE_FUNC + explicit Matrix(const Scalar *data); + + /** \brief Constructs a vector or row-vector with given dimension. \only_for_vectors + * + * This is useful for dynamic-size vectors. For fixed-size vectors, + * it is redundant to pass these parameters, so one should use the default constructor + * Matrix() instead. + * + * \warning This constructor is disabled for fixed-size \c 1x1 matrices. For instance, + * calling Matrix(1) will call the initialization constructor: Matrix(const Scalar&). + * For fixed-size \c 1x1 matrices it is therefore recommended to use the default + * constructor Matrix() instead, especially when using one of the non standard + * \c EIGEN_INITIALIZE_MATRICES_BY_{ZERO,\c NAN} macros (see \ref TopicPreprocessorDirectives). + */ + EIGEN_STRONG_INLINE explicit Matrix(Index dim); + /** \brief Constructs an initialized 1x1 matrix with the given coefficient + * \sa Matrix(const Scalar&, const Scalar&, const Scalar&, const Scalar&, const ArgTypes&...) */ + Matrix(const Scalar& x); + /** \brief Constructs an uninitialized matrix with \a rows rows and \a cols columns. + * + * This is useful for dynamic-size matrices. For fixed-size matrices, + * it is redundant to pass these parameters, so one should use the default constructor + * Matrix() instead. + * + * \warning This constructor is disabled for fixed-size \c 1x2 and \c 2x1 vectors. For instance, + * calling Matrix2f(2,1) will call the initialization constructor: Matrix(const Scalar& x, const Scalar& y). + * For fixed-size \c 1x2 or \c 2x1 vectors it is therefore recommended to use the default + * constructor Matrix() instead, especially when using one of the non standard + * \c EIGEN_INITIALIZE_MATRICES_BY_{ZERO,\c NAN} macros (see \ref TopicPreprocessorDirectives). + */ + EIGEN_DEVICE_FUNC + Matrix(Index rows, Index cols); + + /** \brief Constructs an initialized 2D vector with given coefficients + * \sa Matrix(const Scalar&, const Scalar&, const Scalar&, const Scalar&, const ArgTypes&...) */ + Matrix(const Scalar& x, const Scalar& y); + #endif // end EIGEN_PARSED_BY_DOXYGEN + + /** \brief Constructs an initialized 3D vector with given coefficients + * \sa Matrix(const Scalar&, const Scalar&, const Scalar&, const Scalar&, const ArgTypes&...) + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Matrix(const Scalar& x, const Scalar& y, const Scalar& z) + { + EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Matrix, 3) + m_storage.data()[0] = x; + m_storage.data()[1] = y; + m_storage.data()[2] = z; + } + /** \brief Constructs an initialized 4D vector with given coefficients + * \sa Matrix(const Scalar&, const Scalar&, const Scalar&, const Scalar&, const ArgTypes&...) + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Matrix(const Scalar& x, const Scalar& y, const Scalar& z, const Scalar& w) + { + EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Matrix, 4) + m_storage.data()[0] = x; + m_storage.data()[1] = y; + m_storage.data()[2] = z; + m_storage.data()[3] = w; + } + + + /** \brief Copy constructor */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Matrix(const Matrix& other) : Base(other) + { } + + /** \brief Copy constructor for generic expressions. + * \sa MatrixBase::operator=(const EigenBase&) + */ + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Matrix(const EigenBase &other) + : Base(other.derived()) + { } + + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index innerStride() const EIGEN_NOEXCEPT { return 1; } + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index outerStride() const EIGEN_NOEXCEPT { return this->innerSize(); } + + /////////// Geometry module /////////// + + template + EIGEN_DEVICE_FUNC + explicit Matrix(const RotationBase& r); + template + EIGEN_DEVICE_FUNC + Matrix& operator=(const RotationBase& r); + + // allow to extend Matrix outside Eigen + #ifdef EIGEN_MATRIX_PLUGIN + #include EIGEN_MATRIX_PLUGIN + #endif + + protected: + template + friend struct internal::conservative_resize_like_impl; + + using Base::m_storage; +}; + +/** \defgroup matrixtypedefs Global matrix typedefs + * + * \ingroup Core_Module + * + * %Eigen defines several typedef shortcuts for most common matrix and vector types. + * + * The general patterns are the following: + * + * \c MatrixSizeType where \c Size can be \c 2,\c 3,\c 4 for fixed size square matrices or \c X for dynamic size, + * and where \c Type can be \c i for integer, \c f for float, \c d for double, \c cf for complex float, \c cd + * for complex double. + * + * For example, \c Matrix3d is a fixed-size 3x3 matrix type of doubles, and \c MatrixXf is a dynamic-size matrix of floats. + * + * There are also \c VectorSizeType and \c RowVectorSizeType which are self-explanatory. For example, \c Vector4cf is + * a fixed-size vector of 4 complex floats. + * + * With \cpp11, template alias are also defined for common sizes. + * They follow the same pattern as above except that the scalar type suffix is replaced by a + * template parameter, i.e.: + * - `MatrixSize` where `Size` can be \c 2,\c 3,\c 4 for fixed size square matrices or \c X for dynamic size. + * - `MatrixXSize` and `MatrixSizeX` where `Size` can be \c 2,\c 3,\c 4 for hybrid dynamic/fixed matrices. + * - `VectorSize` and `RowVectorSize` for column and row vectors. + * + * With \cpp11, you can also use fully generic column and row vector types: `Vector` and `RowVector`. + * + * \sa class Matrix + */ + +#define EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Size, SizeSuffix) \ +/** \ingroup matrixtypedefs */ \ +/** \brief `Size`×`Size` matrix of type `Type`. */ \ +typedef Matrix Matrix##SizeSuffix##TypeSuffix; \ +/** \ingroup matrixtypedefs */ \ +/** \brief `Size`×`1` vector of type `Type`. */ \ +typedef Matrix Vector##SizeSuffix##TypeSuffix; \ +/** \ingroup matrixtypedefs */ \ +/** \brief `1`×`Size` vector of type `Type`. */ \ +typedef Matrix RowVector##SizeSuffix##TypeSuffix; + +#define EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, Size) \ +/** \ingroup matrixtypedefs */ \ +/** \brief `Size`×`Dynamic` matrix of type `Type`. */ \ +typedef Matrix Matrix##Size##X##TypeSuffix; \ +/** \ingroup matrixtypedefs */ \ +/** \brief `Dynamic`×`Size` matrix of type `Type`. */ \ +typedef Matrix Matrix##X##Size##TypeSuffix; + +#define EIGEN_MAKE_TYPEDEFS_ALL_SIZES(Type, TypeSuffix) \ +EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 2, 2) \ +EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 3, 3) \ +EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 4, 4) \ +EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Dynamic, X) \ +EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, 2) \ +EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, 3) \ +EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, 4) + +EIGEN_MAKE_TYPEDEFS_ALL_SIZES(int, i) +EIGEN_MAKE_TYPEDEFS_ALL_SIZES(float, f) +EIGEN_MAKE_TYPEDEFS_ALL_SIZES(double, d) +EIGEN_MAKE_TYPEDEFS_ALL_SIZES(std::complex, cf) +EIGEN_MAKE_TYPEDEFS_ALL_SIZES(std::complex, cd) + +#undef EIGEN_MAKE_TYPEDEFS_ALL_SIZES +#undef EIGEN_MAKE_TYPEDEFS +#undef EIGEN_MAKE_FIXED_TYPEDEFS + +#define EIGEN_MAKE_TYPEDEFS(Size, SizeSuffix) \ +/** \ingroup matrixtypedefs */ \ +/** \brief \cpp11 `Size`×`Size` matrix of type `Type`.*/ \ +template \ +using Matrix##SizeSuffix = Matrix; \ +/** \ingroup matrixtypedefs */ \ +/** \brief \cpp11 `Size`×`1` vector of type `Type`.*/ \ +template \ +using Vector##SizeSuffix = Matrix; \ +/** \ingroup matrixtypedefs */ \ +/** \brief \cpp11 `1`×`Size` vector of type `Type`.*/ \ +template \ +using RowVector##SizeSuffix = Matrix; + +#define EIGEN_MAKE_FIXED_TYPEDEFS(Size) \ +/** \ingroup matrixtypedefs */ \ +/** \brief \cpp11 `Size`×`Dynamic` matrix of type `Type` */ \ +template \ +using Matrix##Size##X = Matrix; \ +/** \ingroup matrixtypedefs */ \ +/** \brief \cpp11 `Dynamic`×`Size` matrix of type `Type`. */ \ +template \ +using Matrix##X##Size = Matrix; + +EIGEN_MAKE_TYPEDEFS(2, 2) +EIGEN_MAKE_TYPEDEFS(3, 3) +EIGEN_MAKE_TYPEDEFS(4, 4) +EIGEN_MAKE_TYPEDEFS(Dynamic, X) +EIGEN_MAKE_FIXED_TYPEDEFS(2) +EIGEN_MAKE_FIXED_TYPEDEFS(3) +EIGEN_MAKE_FIXED_TYPEDEFS(4) + +/** \ingroup matrixtypedefs + * \brief \cpp11 `Size`×`1` vector of type `Type`. */ +template +using Vector = Matrix; + +/** \ingroup matrixtypedefs + * \brief \cpp11 `1`×`Size` vector of type `Type`. */ +template +using RowVector = Matrix; + +#undef EIGEN_MAKE_TYPEDEFS +#undef EIGEN_MAKE_FIXED_TYPEDEFS + +} // end namespace Eigen + +#endif // EIGEN_MATRIX_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/MatrixBase.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/MatrixBase.h new file mode 100644 index 0000000000000000000000000000000000000000..6eb064b6132d621eee0a0b2836c238a32d2715eb --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/MatrixBase.h @@ -0,0 +1,551 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2006-2009 Benoit Jacob +// Copyright (C) 2008 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_MATRIXBASE_H +#define EIGEN_MATRIXBASE_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +/** \class MatrixBase + * \ingroup Core_Module + * + * \brief Base class for all dense matrices, vectors, and expressions + * + * This class is the base that is inherited by all matrix, vector, and related expression + * types. Most of the Eigen API is contained in this class, and its base classes. Other important + * classes for the Eigen API are Matrix, and VectorwiseOp. + * + * Note that some methods are defined in other modules such as the \ref LU_Module LU module + * for all functions related to matrix inversions. + * + * \tparam Derived is the derived type, e.g. a matrix type, or an expression, etc. + * + * When writing a function taking Eigen objects as argument, if you want your function + * to take as argument any matrix, vector, or expression, just let it take a + * MatrixBase argument. As an example, here is a function printFirstRow which, given + * a matrix, vector, or expression \a x, prints the first row of \a x. + * + * \code + template + void printFirstRow(const Eigen::MatrixBase& x) + { + cout << x.row(0) << endl; + } + * \endcode + * + * This class can be extended with the help of the plugin mechanism described on the page + * \ref TopicCustomizing_Plugins by defining the preprocessor symbol \c EIGEN_MATRIXBASE_PLUGIN. + * + * \sa \blank \ref TopicClassHierarchy + */ +template class MatrixBase + : public DenseBase +{ + public: +#ifndef EIGEN_PARSED_BY_DOXYGEN + typedef MatrixBase StorageBaseType; + typedef typename internal::traits::StorageKind StorageKind; + typedef typename internal::traits::StorageIndex StorageIndex; + typedef typename internal::traits::Scalar Scalar; + typedef typename internal::packet_traits::type PacketScalar; + typedef typename NumTraits::Real RealScalar; + + typedef DenseBase Base; + using Base::RowsAtCompileTime; + using Base::ColsAtCompileTime; + using Base::SizeAtCompileTime; + using Base::MaxRowsAtCompileTime; + using Base::MaxColsAtCompileTime; + using Base::MaxSizeAtCompileTime; + using Base::IsVectorAtCompileTime; + using Base::Flags; + + using Base::derived; + using Base::const_cast_derived; + using Base::rows; + using Base::cols; + using Base::size; + using Base::coeff; + using Base::coeffRef; + using Base::lazyAssign; + using Base::eval; + using Base::operator-; + using Base::operator+=; + using Base::operator-=; + using Base::operator*=; + using Base::operator/=; + + typedef typename Base::CoeffReturnType CoeffReturnType; + typedef typename Base::ConstTransposeReturnType ConstTransposeReturnType; + typedef typename Base::RowXpr RowXpr; + typedef typename Base::ColXpr ColXpr; +#endif // not EIGEN_PARSED_BY_DOXYGEN + + + +#ifndef EIGEN_PARSED_BY_DOXYGEN + /** type of the equivalent square matrix */ + typedef Matrix SquareMatrixType; +#endif // not EIGEN_PARSED_BY_DOXYGEN + + /** \returns the size of the main diagonal, which is min(rows(),cols()). + * \sa rows(), cols(), SizeAtCompileTime. */ + EIGEN_DEVICE_FUNC + inline Index diagonalSize() const { return (numext::mini)(rows(),cols()); } + + typedef typename Base::PlainObject PlainObject; + +#ifndef EIGEN_PARSED_BY_DOXYGEN + /** \internal Represents a matrix with all coefficients equal to one another*/ + typedef CwiseNullaryOp,PlainObject> ConstantReturnType; + /** \internal the return type of MatrixBase::adjoint() */ + typedef std::conditional_t::IsComplex, + CwiseUnaryOp, ConstTransposeReturnType>, + ConstTransposeReturnType + > AdjointReturnType; + /** \internal Return type of eigenvalues() */ + typedef Matrix, internal::traits::ColsAtCompileTime, 1, ColMajor> EigenvaluesReturnType; + /** \internal the return type of identity */ + typedef CwiseNullaryOp,PlainObject> IdentityReturnType; + /** \internal the return type of unit vectors */ + typedef Block, SquareMatrixType>, + internal::traits::RowsAtCompileTime, + internal::traits::ColsAtCompileTime> BasisReturnType; +#endif // not EIGEN_PARSED_BY_DOXYGEN + +#define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::MatrixBase +#define EIGEN_DOC_UNARY_ADDONS(X,Y) +# include "../plugins/CommonCwiseBinaryOps.h" +# include "../plugins/MatrixCwiseUnaryOps.h" +# include "../plugins/MatrixCwiseBinaryOps.h" +# ifdef EIGEN_MATRIXBASE_PLUGIN +# include EIGEN_MATRIXBASE_PLUGIN +# endif +#undef EIGEN_CURRENT_STORAGE_BASE_CLASS +#undef EIGEN_DOC_UNARY_ADDONS + + /** Special case of the template operator=, in order to prevent the compiler + * from generating a default operator= (issue hit with g++ 4.1) + */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Derived& operator=(const MatrixBase& other); + + // We cannot inherit here via Base::operator= since it is causing + // trouble with MSVC. + + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Derived& operator=(const DenseBase& other); + + template + EIGEN_DEVICE_FUNC + Derived& operator=(const EigenBase& other); + + template + EIGEN_DEVICE_FUNC + Derived& operator=(const ReturnByValue& other); + + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Derived& operator+=(const MatrixBase& other); + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Derived& operator-=(const MatrixBase& other); + + template + EIGEN_DEVICE_FUNC + const Product + operator*(const MatrixBase &other) const; + + template + EIGEN_DEVICE_FUNC + const Product + lazyProduct(const MatrixBase &other) const; + + template + Derived& operator*=(const EigenBase& other); + + template + void applyOnTheLeft(const EigenBase& other); + + template + void applyOnTheRight(const EigenBase& other); + + template + EIGEN_DEVICE_FUNC + const Product + operator*(const DiagonalBase &diagonal) const; + + template + EIGEN_DEVICE_FUNC + const Product + operator*(const SkewSymmetricBase &skew) const; + + template + EIGEN_DEVICE_FUNC + typename ScalarBinaryOpTraits::Scalar,typename internal::traits::Scalar>::ReturnType + dot(const MatrixBase& other) const; + + EIGEN_DEVICE_FUNC RealScalar squaredNorm() const; + EIGEN_DEVICE_FUNC RealScalar norm() const; + RealScalar stableNorm() const; + RealScalar blueNorm() const; + RealScalar hypotNorm() const; + EIGEN_DEVICE_FUNC const PlainObject normalized() const; + EIGEN_DEVICE_FUNC const PlainObject stableNormalized() const; + EIGEN_DEVICE_FUNC void normalize(); + EIGEN_DEVICE_FUNC void stableNormalize(); + + EIGEN_DEVICE_FUNC const AdjointReturnType adjoint() const; + EIGEN_DEVICE_FUNC void adjointInPlace(); + + typedef Diagonal DiagonalReturnType; + EIGEN_DEVICE_FUNC + DiagonalReturnType diagonal(); + + typedef Diagonal ConstDiagonalReturnType; + EIGEN_DEVICE_FUNC + const ConstDiagonalReturnType diagonal() const; + + template + EIGEN_DEVICE_FUNC + Diagonal diagonal(); + + template + EIGEN_DEVICE_FUNC + const Diagonal diagonal() const; + + EIGEN_DEVICE_FUNC + Diagonal diagonal(Index index); + EIGEN_DEVICE_FUNC + const Diagonal diagonal(Index index) const; + + template struct TriangularViewReturnType { typedef TriangularView Type; }; + template struct ConstTriangularViewReturnType { typedef const TriangularView Type; }; + + template + EIGEN_DEVICE_FUNC + typename TriangularViewReturnType::Type triangularView(); + template + EIGEN_DEVICE_FUNC + typename ConstTriangularViewReturnType::Type triangularView() const; + + template struct SelfAdjointViewReturnType { typedef SelfAdjointView Type; }; + template struct ConstSelfAdjointViewReturnType { typedef const SelfAdjointView Type; }; + + template + EIGEN_DEVICE_FUNC + typename SelfAdjointViewReturnType::Type selfadjointView(); + template + EIGEN_DEVICE_FUNC + typename ConstSelfAdjointViewReturnType::Type selfadjointView() const; + + const SparseView sparseView(const Scalar& m_reference = Scalar(0), + const typename NumTraits::Real& m_epsilon = NumTraits::dummy_precision()) const; + EIGEN_DEVICE_FUNC static const IdentityReturnType Identity(); + EIGEN_DEVICE_FUNC static const IdentityReturnType Identity(Index rows, Index cols); + EIGEN_DEVICE_FUNC static const BasisReturnType Unit(Index size, Index i); + EIGEN_DEVICE_FUNC static const BasisReturnType Unit(Index i); + EIGEN_DEVICE_FUNC static const BasisReturnType UnitX(); + EIGEN_DEVICE_FUNC static const BasisReturnType UnitY(); + EIGEN_DEVICE_FUNC static const BasisReturnType UnitZ(); + EIGEN_DEVICE_FUNC static const BasisReturnType UnitW(); + + EIGEN_DEVICE_FUNC + const DiagonalWrapper asDiagonal() const; + const PermutationWrapper asPermutation() const; + EIGEN_DEVICE_FUNC + const SkewSymmetricWrapper asSkewSymmetric() const; + + EIGEN_DEVICE_FUNC + Derived& setIdentity(); + EIGEN_DEVICE_FUNC + Derived& setIdentity(Index rows, Index cols); + EIGEN_DEVICE_FUNC Derived& setUnit(Index i); + EIGEN_DEVICE_FUNC Derived& setUnit(Index newSize, Index i); + + bool isIdentity(const RealScalar& prec = NumTraits::dummy_precision()) const; + bool isDiagonal(const RealScalar& prec = NumTraits::dummy_precision()) const; + + bool isUpperTriangular(const RealScalar& prec = NumTraits::dummy_precision()) const; + bool isLowerTriangular(const RealScalar& prec = NumTraits::dummy_precision()) const; + + bool isSkewSymmetric(const RealScalar& prec = NumTraits::dummy_precision()) const; + + template + bool isOrthogonal(const MatrixBase& other, + const RealScalar& prec = NumTraits::dummy_precision()) const; + bool isUnitary(const RealScalar& prec = NumTraits::dummy_precision()) const; + + /** \returns true if each coefficients of \c *this and \a other are all exactly equal. + * \warning When using floating point scalar values you probably should rather use a + * fuzzy comparison such as isApprox() + * \sa isApprox(), operator!= */ + template + EIGEN_DEVICE_FUNC inline bool operator==(const MatrixBase& other) const + { return cwiseEqual(other).all(); } + + /** \returns true if at least one pair of coefficients of \c *this and \a other are not exactly equal to each other. + * \warning When using floating point scalar values you probably should rather use a + * fuzzy comparison such as isApprox() + * \sa isApprox(), operator== */ + template + EIGEN_DEVICE_FUNC inline bool operator!=(const MatrixBase& other) const + { return cwiseNotEqual(other).any(); } + + NoAlias EIGEN_DEVICE_FUNC noalias(); + + // TODO forceAlignedAccess is temporarily disabled + // Need to find a nicer workaround. + inline const Derived& forceAlignedAccess() const { return derived(); } + inline Derived& forceAlignedAccess() { return derived(); } + template inline const Derived& forceAlignedAccessIf() const { return derived(); } + template inline Derived& forceAlignedAccessIf() { return derived(); } + + EIGEN_DEVICE_FUNC Scalar trace() const; + + template EIGEN_DEVICE_FUNC RealScalar lpNorm() const; + + EIGEN_DEVICE_FUNC MatrixBase& matrix() { return *this; } + EIGEN_DEVICE_FUNC const MatrixBase& matrix() const { return *this; } + + /** \returns an \link Eigen::ArrayBase Array \endlink expression of this matrix + * \sa ArrayBase::matrix() */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ArrayWrapper array() { return ArrayWrapper(derived()); } + /** \returns a const \link Eigen::ArrayBase Array \endlink expression of this matrix + * \sa ArrayBase::matrix() */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ArrayWrapper array() const { return ArrayWrapper(derived()); } + +/////////// LU module /////////// + + template inline const FullPivLU fullPivLu() const; + template inline const PartialPivLU partialPivLu() const; + + template inline const PartialPivLU lu() const; + + EIGEN_DEVICE_FUNC + inline const Inverse inverse() const; + + template + inline void computeInverseAndDetWithCheck( + ResultType& inverse, + typename ResultType::Scalar& determinant, + bool& invertible, + const RealScalar& absDeterminantThreshold = NumTraits::dummy_precision() + ) const; + + template + inline void computeInverseWithCheck( + ResultType& inverse, + bool& invertible, + const RealScalar& absDeterminantThreshold = NumTraits::dummy_precision() + ) const; + + EIGEN_DEVICE_FUNC + Scalar determinant() const; + +/////////// Cholesky module /////////// + + inline const LLT llt() const; + inline const LDLT ldlt() const; + +/////////// QR module /////////// + + inline const HouseholderQR householderQr() const; + template inline const ColPivHouseholderQR colPivHouseholderQr() const; + template inline const FullPivHouseholderQR fullPivHouseholderQr() const; + template inline const CompleteOrthogonalDecomposition completeOrthogonalDecomposition() const; + +/////////// Eigenvalues module /////////// + + inline EigenvaluesReturnType eigenvalues() const; + inline RealScalar operatorNorm() const; + +/////////// SVD module /////////// + + template + inline JacobiSVD jacobiSvd() const; + template + EIGEN_DEPRECATED + inline JacobiSVD jacobiSvd(unsigned int computationOptions) const; + + template + inline BDCSVD bdcSvd() const; + template + EIGEN_DEPRECATED + inline BDCSVD bdcSvd(unsigned int computationOptions) const; + +/////////// Geometry module /////////// + + template + EIGEN_DEVICE_FUNC + inline typename internal::cross_impl::return_type + cross(const MatrixBase& other) const; + + template + EIGEN_DEVICE_FUNC + inline PlainObject cross3(const MatrixBase& other) const; + + EIGEN_DEVICE_FUNC + inline PlainObject unitOrthogonal(void) const; + + EIGEN_DEPRECATED EIGEN_DEVICE_FUNC + inline Matrix eulerAngles(Index a0, Index a1, Index a2) const; + + EIGEN_DEVICE_FUNC + inline Matrix canonicalEulerAngles(Index a0, Index a1, Index a2) const; + + // put this as separate enum value to work around possible GCC 4.3 bug (?) + enum { HomogeneousReturnTypeDirection = ColsAtCompileTime==1&&RowsAtCompileTime==1 ? ((internal::traits::Flags&RowMajorBit)==RowMajorBit ? Horizontal : Vertical) + : ColsAtCompileTime==1 ? Vertical : Horizontal }; + typedef Homogeneous HomogeneousReturnType; + EIGEN_DEVICE_FUNC + inline HomogeneousReturnType homogeneous() const; + + enum { + SizeMinusOne = SizeAtCompileTime==Dynamic ? Dynamic : SizeAtCompileTime-1 + }; + typedef Block::ColsAtCompileTime==1 ? SizeMinusOne : 1, + internal::traits::ColsAtCompileTime==1 ? 1 : SizeMinusOne> ConstStartMinusOne; + typedef EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(ConstStartMinusOne,Scalar,quotient) HNormalizedReturnType; + EIGEN_DEVICE_FUNC + inline const HNormalizedReturnType hnormalized() const; + +////////// Householder module /////////// + + EIGEN_DEVICE_FUNC + void makeHouseholderInPlace(Scalar& tau, RealScalar& beta); + template + EIGEN_DEVICE_FUNC + void makeHouseholder(EssentialPart& essential, + Scalar& tau, RealScalar& beta) const; + template + EIGEN_DEVICE_FUNC + void applyHouseholderOnTheLeft(const EssentialPart& essential, + const Scalar& tau, + Scalar* workspace); + template + EIGEN_DEVICE_FUNC + void applyHouseholderOnTheRight(const EssentialPart& essential, + const Scalar& tau, + Scalar* workspace); + +///////// Jacobi module ///////// + + template + EIGEN_DEVICE_FUNC + void applyOnTheLeft(Index p, Index q, const JacobiRotation& j); + template + EIGEN_DEVICE_FUNC + void applyOnTheRight(Index p, Index q, const JacobiRotation& j); + +///////// SparseCore module ///////// + + template + EIGEN_STRONG_INLINE const typename SparseMatrixBase::template CwiseProductDenseReturnType::Type + cwiseProduct(const SparseMatrixBase &other) const + { + return other.cwiseProduct(derived()); + } + +///////// MatrixFunctions module ///////// + + typedef typename internal::stem_function::type StemFunction; +#define EIGEN_MATRIX_FUNCTION(ReturnType, Name, Description) \ + /** \returns an expression of the matrix Description of \c *this. \brief This function requires the unsupported MatrixFunctions module. To compute the coefficient-wise Description use ArrayBase::##Name . */ \ + const ReturnType Name() const; +#define EIGEN_MATRIX_FUNCTION_1(ReturnType, Name, Description, Argument) \ + /** \returns an expression of the matrix Description of \c *this. \brief This function requires the unsupported MatrixFunctions module. To compute the coefficient-wise Description use ArrayBase::##Name . */ \ + const ReturnType Name(Argument) const; + + EIGEN_MATRIX_FUNCTION(MatrixExponentialReturnValue, exp, exponential) + /** \brief Helper function for the unsupported MatrixFunctions module.*/ + const MatrixFunctionReturnValue matrixFunction(StemFunction f) const; + EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, cosh, hyperbolic cosine) + EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, sinh, hyperbolic sine) + EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, atanh, inverse hyperbolic cosine) + EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, acosh, inverse hyperbolic cosine) + EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, asinh, inverse hyperbolic sine) + EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, cos, cosine) + EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, sin, sine) + EIGEN_MATRIX_FUNCTION(MatrixSquareRootReturnValue, sqrt, square root) + EIGEN_MATRIX_FUNCTION(MatrixLogarithmReturnValue, log, logarithm) + EIGEN_MATRIX_FUNCTION_1(MatrixPowerReturnValue, pow, power to \c p, const RealScalar& p) + EIGEN_MATRIX_FUNCTION_1(MatrixComplexPowerReturnValue, pow, power to \c p, const std::complex& p) + + protected: + EIGEN_DEFAULT_COPY_CONSTRUCTOR(MatrixBase) + EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(MatrixBase) + + private: + EIGEN_DEVICE_FUNC explicit MatrixBase(int); + EIGEN_DEVICE_FUNC MatrixBase(int,int); + template EIGEN_DEVICE_FUNC explicit MatrixBase(const MatrixBase&); + protected: + // mixing arrays and matrices is not legal + template Derived& operator+=(const ArrayBase& ) + {EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES); return *this;} + // mixing arrays and matrices is not legal + template Derived& operator-=(const ArrayBase& ) + {EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES); return *this;} +}; + + +/*************************************************************************** +* Implementation of matrix base methods +***************************************************************************/ + +/** replaces \c *this by \c *this * \a other. + * + * \returns a reference to \c *this + * + * Example: \include MatrixBase_applyOnTheRight.cpp + * Output: \verbinclude MatrixBase_applyOnTheRight.out + */ +template +template +inline Derived& +MatrixBase::operator*=(const EigenBase &other) +{ + other.derived().applyThisOnTheRight(derived()); + return derived(); +} + +/** replaces \c *this by \c *this * \a other. It is equivalent to MatrixBase::operator*=(). + * + * Example: \include MatrixBase_applyOnTheRight.cpp + * Output: \verbinclude MatrixBase_applyOnTheRight.out + */ +template +template +inline void MatrixBase::applyOnTheRight(const EigenBase &other) +{ + other.derived().applyThisOnTheRight(derived()); +} + +/** replaces \c *this by \a other * \c *this. + * + * Example: \include MatrixBase_applyOnTheLeft.cpp + * Output: \verbinclude MatrixBase_applyOnTheLeft.out + */ +template +template +inline void MatrixBase::applyOnTheLeft(const EigenBase &other) +{ + other.derived().applyThisOnTheLeft(derived()); +} + +} // end namespace Eigen + +#endif // EIGEN_MATRIXBASE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/NestByValue.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/NestByValue.h new file mode 100644 index 0000000000000000000000000000000000000000..311cb5a3df8e6136b6798fd1250dee0c8c47cb4c --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/NestByValue.h @@ -0,0 +1,101 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008 Gael Guennebaud +// Copyright (C) 2006-2008 Benoit Jacob +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_NESTBYVALUE_H +#define EIGEN_NESTBYVALUE_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { +template +struct traits > : public traits +{ + enum { + Flags = traits::Flags & ~NestByRefBit + }; +}; +} + +/** \class NestByValue + * \ingroup Core_Module + * + * \brief Expression which must be nested by value + * + * \tparam ExpressionType the type of the object of which we are requiring nesting-by-value + * + * This class is the return type of MatrixBase::nestByValue() + * and most of the time this is the only way it is used. + * + * \sa MatrixBase::nestByValue() + */ +template class NestByValue + : public internal::dense_xpr_base< NestByValue >::type +{ + public: + + typedef typename internal::dense_xpr_base::type Base; + static constexpr bool HasDirectAccess = internal::has_direct_access::ret; + + EIGEN_DENSE_PUBLIC_INTERFACE(NestByValue) + + EIGEN_DEVICE_FUNC explicit inline NestByValue(const ExpressionType& matrix) : m_expression(matrix) {} + + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { return m_expression.rows(); } + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return m_expression.cols(); } + + EIGEN_DEVICE_FUNC operator const ExpressionType&() const { return m_expression; } + + EIGEN_DEVICE_FUNC const ExpressionType& nestedExpression() const { return m_expression; } + + EIGEN_DEVICE_FUNC typename std::enable_if::type data() const { + return m_expression.data(); + } + + EIGEN_DEVICE_FUNC typename std::enable_if::type innerStride() const { + return m_expression.innerStride(); + } + + EIGEN_DEVICE_FUNC typename std::enable_if::type outerStride() const { + return m_expression.outerStride(); + } + + protected: + const ExpressionType m_expression; +}; + +/** \returns an expression of the temporary version of *this. + */ +template +EIGEN_DEVICE_FUNC inline const NestByValue +DenseBase::nestByValue() const +{ + return NestByValue(derived()); +} + +namespace internal { + +// Evaluator of Solve -> eval into a temporary +template +struct evaluator > + : public evaluator +{ + typedef evaluator Base; + + EIGEN_DEVICE_FUNC explicit evaluator(const NestByValue& xpr) + : Base(xpr.nestedExpression()) + {} +}; +} + +} // end namespace Eigen + +#endif // EIGEN_NESTBYVALUE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/NoAlias.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/NoAlias.h new file mode 100644 index 0000000000000000000000000000000000000000..09c0aac556f80ce0b9ff53e04a2b0a101bf4c3d5 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/NoAlias.h @@ -0,0 +1,111 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2009 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_NOALIAS_H +#define EIGEN_NOALIAS_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +/** \class NoAlias + * \ingroup Core_Module + * + * \brief Pseudo expression providing an operator = assuming no aliasing + * + * \tparam ExpressionType the type of the object on which to do the lazy assignment + * + * This class represents an expression with special assignment operators + * assuming no aliasing between the target expression and the source expression. + * More precisely it alloas to bypass the EvalBeforeAssignBit flag of the source expression. + * It is the return type of MatrixBase::noalias() + * and most of the time this is the only way it is used. + * + * \sa MatrixBase::noalias() + */ +template class StorageBase> +class NoAlias +{ + public: + typedef typename ExpressionType::Scalar Scalar; + + EIGEN_DEVICE_FUNC + explicit NoAlias(ExpressionType& expression) : m_expression(expression) {} + + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE ExpressionType& operator=(const StorageBase& other) + { + call_assignment_no_alias(m_expression, other.derived(), internal::assign_op()); + return m_expression; + } + + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE ExpressionType& operator+=(const StorageBase& other) + { + call_assignment_no_alias(m_expression, other.derived(), internal::add_assign_op()); + return m_expression; + } + + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE ExpressionType& operator-=(const StorageBase& other) + { + call_assignment_no_alias(m_expression, other.derived(), internal::sub_assign_op()); + return m_expression; + } + + EIGEN_DEVICE_FUNC + ExpressionType& expression() const + { + return m_expression; + } + + protected: + ExpressionType& m_expression; +}; + +/** \returns a pseudo expression of \c *this with an operator= assuming + * no aliasing between \c *this and the source expression. + * + * More precisely, noalias() allows to bypass the EvalBeforeAssignBit flag. + * Currently, even though several expressions may alias, only product + * expressions have this flag. Therefore, noalias() is only useful when + * the source expression contains a matrix product. + * + * Here are some examples where noalias is useful: + * \code + * D.noalias() = A * B; + * D.noalias() += A.transpose() * B; + * D.noalias() -= 2 * A * B.adjoint(); + * \endcode + * + * On the other hand the following example will lead to a \b wrong result: + * \code + * A.noalias() = A * B; + * \endcode + * because the result matrix A is also an operand of the matrix product. Therefore, + * there is no alternative than evaluating A * B in a temporary, that is the default + * behavior when you write: + * \code + * A = A * B; + * \endcode + * + * \sa class NoAlias + */ +template +NoAlias EIGEN_DEVICE_FUNC MatrixBase::noalias() +{ + return NoAlias(derived()); +} + +} // end namespace Eigen + +#endif // EIGEN_NOALIAS_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/NumTraits.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/NumTraits.h new file mode 100644 index 0000000000000000000000000000000000000000..f5275d8042ae89a1960d1b077dbc8138f67efeba --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/NumTraits.h @@ -0,0 +1,390 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2006-2010 Benoit Jacob +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_NUMTRAITS_H +#define EIGEN_NUMTRAITS_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { + +// default implementation of digits(), based on numeric_limits if specialized, +// 0 for integer types, and log2(epsilon()) otherwise. +template< typename T, + bool use_numeric_limits = std::numeric_limits::is_specialized, + bool is_integer = NumTraits::IsInteger> +struct default_digits_impl +{ + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + static int run() { return std::numeric_limits::digits; } +}; + +template +struct default_digits_impl // Floating point +{ + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + static int run() { + using std::log2; + using std::ceil; + typedef typename NumTraits::Real Real; + return int(ceil(-log2(NumTraits::epsilon()))); + } +}; + +template +struct default_digits_impl // Integer +{ + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + static int run() { return 0; } +}; + +// default implementation of digits10(), based on numeric_limits if specialized, +// 0 for integer types, and floor((digits()-1)*log10(2)) otherwise. +template< typename T, + bool use_numeric_limits = std::numeric_limits::is_specialized, + bool is_integer = NumTraits::IsInteger> +struct default_digits10_impl +{ + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + static int run() { return std::numeric_limits::digits10; } +}; + +template +struct default_digits10_impl // Floating point +{ + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + static int run() { + using std::log10; + using std::floor; + typedef typename NumTraits::Real Real; + return int(floor((internal::default_digits_impl::run()-1)*log10(2))); + } +}; + +template +struct default_digits10_impl // Integer +{ + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + static int run() { return 0; } +}; + +// default implementation of max_digits10(), based on numeric_limits if specialized, +// 0 for integer types, and log10(2) * digits() + 1 otherwise. +template< typename T, + bool use_numeric_limits = std::numeric_limits::is_specialized, + bool is_integer = NumTraits::IsInteger> +struct default_max_digits10_impl +{ + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + static int run() { return std::numeric_limits::max_digits10; } +}; + +template +struct default_max_digits10_impl // Floating point +{ + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + static int run() { + using std::log10; + using std::ceil; + typedef typename NumTraits::Real Real; + return int(ceil(internal::default_digits_impl::run()*log10(2)+1)); + } +}; + +template +struct default_max_digits10_impl // Integer +{ + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + static int run() { return 0; } +}; + +} // end namespace internal + +namespace numext { +/** \internal bit-wise cast without changing the underlying bit representation. */ + +// TODO: Replace by std::bit_cast (available in C++20) +template +EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Tgt bit_cast(const Src& src) { + // The behaviour of memcpy is not specified for non-trivially copyable types + EIGEN_STATIC_ASSERT(std::is_trivially_copyable::value, THIS_TYPE_IS_NOT_SUPPORTED); + EIGEN_STATIC_ASSERT(std::is_trivially_copyable::value && std::is_default_constructible::value, + THIS_TYPE_IS_NOT_SUPPORTED); + EIGEN_STATIC_ASSERT(sizeof(Src) == sizeof(Tgt), THIS_TYPE_IS_NOT_SUPPORTED); + + Tgt tgt; + // Load src into registers first. This allows the memcpy to be elided by CUDA. + const Src staged = src; + EIGEN_USING_STD(memcpy) + memcpy(static_cast(&tgt),static_cast(&staged), sizeof(Tgt)); + return tgt; +} +} // namespace numext + +/** \class NumTraits + * \ingroup Core_Module + * + * \brief Holds information about the various numeric (i.e. scalar) types allowed by Eigen. + * + * \tparam T the numeric type at hand + * + * This class stores enums, typedefs and static methods giving information about a numeric type. + * + * The provided data consists of: + * \li A typedef \c Real, giving the "real part" type of \a T. If \a T is already real, + * then \c Real is just a typedef to \a T. If \a T is \c std::complex then \c Real + * is a typedef to \a U. + * \li A typedef \c NonInteger, giving the type that should be used for operations producing non-integral values, + * such as quotients, square roots, etc. If \a T is a floating-point type, then this typedef just gives + * \a T again. Note however that many Eigen functions such as internal::sqrt simply refuse to + * take integers. Outside of a few cases, Eigen doesn't do automatic type promotion. Thus, this typedef is + * only intended as a helper for code that needs to explicitly promote types. + * \li A typedef \c Literal giving the type to use for numeric literals such as "2" or "0.5". For instance, for \c std::complex, Literal is defined as \c U. + * Of course, this type must be fully compatible with \a T. In doubt, just use \a T here. + * \li A typedef \a Nested giving the type to use to nest a value inside of the expression tree. If you don't know what + * this means, just use \a T here. + * \li An enum value \a IsComplex. It is equal to 1 if \a T is a \c std::complex + * type, and to 0 otherwise. + * \li An enum value \a IsInteger. It is equal to \c 1 if \a T is an integer type such as \c int, + * and to \c 0 otherwise. + * \li Enum values ReadCost, AddCost and MulCost representing a rough estimate of the number of CPU cycles needed + * to by move / add / mul instructions respectively, assuming the data is already stored in CPU registers. + * Stay vague here. No need to do architecture-specific stuff. If you don't know what this means, just use \c Eigen::HugeCost. + * \li An enum value \a IsSigned. It is equal to \c 1 if \a T is a signed type and to 0 if \a T is unsigned. + * \li An enum value \a RequireInitialization. It is equal to \c 1 if the constructor of the numeric type \a T must + * be called, and to 0 if it is safe not to call it. Default is 0 if \a T is an arithmetic type, and 1 otherwise. + * \li An epsilon() function which, unlike std::numeric_limits::epsilon(), + * it returns a \a Real instead of a \a T. + * \li A dummy_precision() function returning a weak epsilon value. It is mainly used as a default + * value by the fuzzy comparison operators. + * \li highest() and lowest() functions returning the highest and lowest possible values respectively. + * \li digits() function returning the number of radix digits (non-sign digits for integers, mantissa for floating-point). This is + * the analogue of std::numeric_limits::digits + * which is used as the default implementation if specialized. + * \li digits10() function returning the number of decimal digits that can be represented without change. This is + * the analogue of std::numeric_limits::digits10 + * which is used as the default implementation if specialized. + * \li max_digits10() function returning the number of decimal digits required to uniquely represent all distinct values of the type. This is + * the analogue of std::numeric_limits::max_digits10 + * which is used as the default implementation if specialized. + * \li min_exponent() and max_exponent() functions returning the highest and lowest possible values, respectively, + * such that the radix raised to the power exponent-1 is a normalized floating-point number. These are equivalent to + * std::numeric_limits::min_exponent/ + * std::numeric_limits::max_exponent. + * \li infinity() function returning a representation of positive infinity, if available. + * \li quiet_NaN function returning a non-signaling "not-a-number", if available. + */ + +template struct GenericNumTraits +{ + enum { + IsInteger = std::numeric_limits::is_integer, + IsSigned = std::numeric_limits::is_signed, + IsComplex = 0, + RequireInitialization = internal::is_arithmetic::value ? 0 : 1, + ReadCost = 1, + AddCost = 1, + MulCost = 1 + }; + + typedef T Real; + typedef std::conditional_t, T> NonInteger; + typedef T Nested; + typedef T Literal; + + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + static inline Real epsilon() + { + return numext::numeric_limits::epsilon(); + } + + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + static inline int digits10() + { + return internal::default_digits10_impl::run(); + } + + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + static inline int max_digits10() + { + return internal::default_max_digits10_impl::run(); + } + + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + static inline int digits() + { + return internal::default_digits_impl::run(); + } + + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + static inline int min_exponent() + { + return numext::numeric_limits::min_exponent; + } + + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + static inline int max_exponent() + { + return numext::numeric_limits::max_exponent; + } + + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + static inline Real dummy_precision() + { + // make sure to override this for floating-point types + return Real(0); + } + + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + static inline T highest() { + return (numext::numeric_limits::max)(); + } + + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + static inline T lowest() { + return IsInteger ? (numext::numeric_limits::min)() + : static_cast(-(numext::numeric_limits::max)()); + } + + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + static inline T infinity() { + return numext::numeric_limits::infinity(); + } + + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + static inline T quiet_NaN() { + return numext::numeric_limits::quiet_NaN(); + } +}; + +template struct NumTraits : GenericNumTraits +{}; + +template<> struct NumTraits + : GenericNumTraits +{ + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + static inline float dummy_precision() { return 1e-5f; } +}; + +template<> struct NumTraits : GenericNumTraits +{ + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + static inline double dummy_precision() { return 1e-12; } +}; + +// GPU devices treat `long double` as `double`. +#ifndef EIGEN_GPU_COMPILE_PHASE +template<> struct NumTraits + : GenericNumTraits +{ + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + static inline long double dummy_precision() { return static_cast(1e-15l); } + +#if defined(EIGEN_ARCH_PPC) && (__LDBL_MANT_DIG__ == 106) + // PowerPC double double causes issues with some values + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + static inline long double epsilon() + { + // 2^(-(__LDBL_MANT_DIG__)+1) + return static_cast(2.4651903288156618919116517665087e-32l); + } +#endif +}; +#endif + +template struct NumTraits > + : GenericNumTraits > +{ + typedef Real_ Real; + typedef typename NumTraits::Literal Literal; + enum { + IsComplex = 1, + RequireInitialization = NumTraits::RequireInitialization, + ReadCost = 2 * NumTraits::ReadCost, + AddCost = 2 * NumTraits::AddCost, + MulCost = 4 * NumTraits::MulCost + 2 * NumTraits::AddCost + }; + + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + static inline Real epsilon() { return NumTraits::epsilon(); } + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + static inline Real dummy_precision() { return NumTraits::dummy_precision(); } + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + static inline int digits10() { return NumTraits::digits10(); } + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + static inline int max_digits10() { return NumTraits::max_digits10(); } +}; + +template +struct NumTraits > +{ + typedef Array ArrayType; + typedef typename NumTraits::Real RealScalar; + typedef Array Real; + typedef typename NumTraits::NonInteger NonIntegerScalar; + typedef Array NonInteger; + typedef ArrayType & Nested; + typedef typename NumTraits::Literal Literal; + + enum { + IsComplex = NumTraits::IsComplex, + IsInteger = NumTraits::IsInteger, + IsSigned = NumTraits::IsSigned, + RequireInitialization = 1, + ReadCost = ArrayType::SizeAtCompileTime==Dynamic ? HugeCost : ArrayType::SizeAtCompileTime * int(NumTraits::ReadCost), + AddCost = ArrayType::SizeAtCompileTime==Dynamic ? HugeCost : ArrayType::SizeAtCompileTime * int(NumTraits::AddCost), + MulCost = ArrayType::SizeAtCompileTime==Dynamic ? HugeCost : ArrayType::SizeAtCompileTime * int(NumTraits::MulCost) + }; + + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + static inline RealScalar epsilon() { return NumTraits::epsilon(); } + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + static inline RealScalar dummy_precision() { return NumTraits::dummy_precision(); } + + EIGEN_CONSTEXPR + static inline int digits10() { return NumTraits::digits10(); } + EIGEN_CONSTEXPR + static inline int max_digits10() { return NumTraits::max_digits10(); } +}; + +template<> struct NumTraits + : GenericNumTraits +{ + enum { + RequireInitialization = 1, + ReadCost = HugeCost, + AddCost = HugeCost, + MulCost = HugeCost + }; + + EIGEN_CONSTEXPR + static inline int digits10() { return 0; } + EIGEN_CONSTEXPR + static inline int max_digits10() { return 0; } + + private: + static inline std::string epsilon(); + static inline std::string dummy_precision(); + static inline std::string lowest(); + static inline std::string highest(); + static inline std::string infinity(); + static inline std::string quiet_NaN(); +}; + +// Empty specialization for void to allow template specialization based on NumTraits::Real with T==void and SFINAE. +template<> struct NumTraits {}; + +template<> struct NumTraits : GenericNumTraits {}; + +} // end namespace Eigen + +#endif // EIGEN_NUMTRAITS_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/PartialReduxEvaluator.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/PartialReduxEvaluator.h new file mode 100644 index 0000000000000000000000000000000000000000..e5d77ecad869e8d15e8bddba80a4f5a6aca115cc --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/PartialReduxEvaluator.h @@ -0,0 +1,239 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2011-2018 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_PARTIALREDUX_H +#define EIGEN_PARTIALREDUX_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { + + +/*************************************************************************** +* +* This file provides evaluators for partial reductions. +* There are two modes: +* +* - scalar path: simply calls the respective function on the column or row. +* -> nothing special here, all the tricky part is handled by the return +* types of VectorwiseOp's members. They embed the functor calling the +* respective DenseBase's member function. +* +* - vectorized path: implements a packet-wise reductions followed by +* some (optional) processing of the outcome, e.g., division by n for mean. +* +* For the vectorized path let's observe that the packet-size and outer-unrolling +* are both decided by the assignment logic. So all we have to do is to decide +* on the inner unrolling. +* +* For the unrolling, we can reuse "internal::redux_vec_unroller" from Redux.h, +* but be need to be careful to specify correct increment. +* +***************************************************************************/ + + +/* logic deciding a strategy for unrolling of vectorized paths */ +template +struct packetwise_redux_traits +{ + enum { + OuterSize = int(Evaluator::IsRowMajor) ? Evaluator::RowsAtCompileTime : Evaluator::ColsAtCompileTime, + Cost = OuterSize == Dynamic ? HugeCost + : OuterSize * Evaluator::CoeffReadCost + (OuterSize-1) * functor_traits::Cost, + Unrolling = Cost <= EIGEN_UNROLLING_LIMIT ? CompleteUnrolling : NoUnrolling + }; + +}; + +/* Value to be returned when size==0 , by default let's return 0 */ +template +EIGEN_DEVICE_FUNC +PacketType packetwise_redux_empty_value(const Func& ) { + const typename unpacket_traits::type zero(0); + return pset1(zero); +} + +/* For products the default is 1 */ +template +EIGEN_DEVICE_FUNC +PacketType packetwise_redux_empty_value(const scalar_product_op& ) { + return pset1(Scalar(1)); +} + +/* Perform the actual reduction */ +template::Unrolling +> +struct packetwise_redux_impl; + +/* Perform the actual reduction with unrolling */ +template +struct packetwise_redux_impl +{ + typedef redux_novec_unroller Base; + typedef typename Evaluator::Scalar Scalar; + + template + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE + PacketType run(const Evaluator &eval, const Func& func, Index /*size*/) + { + return redux_vec_unroller::OuterSize>::template run(eval,func); + } +}; + +/* Add a specialization of redux_vec_unroller for size==0 at compiletime. + * This specialization is not required for general reductions, which is + * why it is defined here. + */ +template +struct redux_vec_unroller +{ + template + EIGEN_DEVICE_FUNC + static EIGEN_STRONG_INLINE PacketType run(const Evaluator &, const Func& f) + { + return packetwise_redux_empty_value(f); + } +}; + +/* Perform the actual reduction for dynamic sizes */ +template +struct packetwise_redux_impl +{ + typedef typename Evaluator::Scalar Scalar; + typedef typename redux_traits::PacketType PacketScalar; + + template + EIGEN_DEVICE_FUNC + static PacketType run(const Evaluator &eval, const Func& func, Index size) + { + if(size==0) + return packetwise_redux_empty_value(func); + + const Index size4 = (size-1)&(~3); + PacketType p = eval.template packetByOuterInner(0,0); + Index i = 1; + // This loop is optimized for instruction pipelining: + // - each iteration generates two independent instructions + // - thanks to branch prediction and out-of-order execution we have independent instructions across loops + for(; i(i+0,0),eval.template packetByOuterInner(i+1,0)), + func.packetOp(eval.template packetByOuterInner(i+2,0),eval.template packetByOuterInner(i+3,0)))); + for(; i(i,0)); + return p; + } +}; + +template< typename ArgType, typename MemberOp, int Direction> +struct evaluator > + : evaluator_base > +{ + typedef PartialReduxExpr XprType; + typedef typename internal::nested_eval::type ArgTypeNested; + typedef add_const_on_value_type_t ConstArgTypeNested; + typedef internal::remove_all_t ArgTypeNestedCleaned; + typedef typename ArgType::Scalar InputScalar; + typedef typename XprType::Scalar Scalar; + enum { + TraversalSize = Direction==int(Vertical) ? int(ArgType::RowsAtCompileTime) : int(ArgType::ColsAtCompileTime) + }; + typedef typename MemberOp::template Cost CostOpType; + enum { + CoeffReadCost = TraversalSize==Dynamic ? HugeCost + : TraversalSize==0 ? 1 + : int(TraversalSize) * int(evaluator::CoeffReadCost) + int(CostOpType::value), + + ArgFlags_ = evaluator::Flags, + + Vectorizable_ = bool(int(ArgFlags_)&PacketAccessBit) + && bool(MemberOp::Vectorizable) + && (Direction==int(Vertical) ? bool(ArgFlags_&RowMajorBit) : (ArgFlags_&RowMajorBit)==0) + && (TraversalSize!=0), + + Flags = (traits::Flags&RowMajorBit) + | (evaluator::Flags&(HereditaryBits&(~RowMajorBit))) + | (Vectorizable_ ? PacketAccessBit : 0) + | LinearAccessBit, + + Alignment = 0 // FIXME this will need to be improved once PartialReduxExpr is vectorized + }; + + EIGEN_DEVICE_FUNC explicit evaluator(const XprType xpr) + : m_arg(xpr.nestedExpression()), m_functor(xpr.functor()) + { + EIGEN_INTERNAL_CHECK_COST_VALUE(TraversalSize==Dynamic ? HugeCost : (TraversalSize==0 ? 1 : int(CostOpType::value))); + EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); + } + + typedef typename XprType::CoeffReturnType CoeffReturnType; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + const Scalar coeff(Index i, Index j) const + { + return coeff(Direction==Vertical ? j : i); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + const Scalar coeff(Index index) const + { + return m_functor(m_arg.template subVector(index)); + } + + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + PacketType packet(Index i, Index j) const + { + return packet(Direction==Vertical ? j : i); + } + + template + EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC + PacketType packet(Index idx) const + { + enum { PacketSize = internal::unpacket_traits::size }; + typedef Block PanelType; + + PanelType panel(m_arg, + Direction==Vertical ? 0 : idx, + Direction==Vertical ? idx : 0, + Direction==Vertical ? m_arg.rows() : Index(PacketSize), + Direction==Vertical ? Index(PacketSize) : m_arg.cols()); + + // FIXME + // See bug 1612, currently if PacketSize==1 (i.e. complex with 128bits registers) then the storage-order of panel get reversed + // and methods like packetByOuterInner do not make sense anymore in this context. + // So let's just by pass "vectorization" in this case: + if(PacketSize==1) + return internal::pset1(coeff(idx)); + + typedef typename internal::redux_evaluator PanelEvaluator; + PanelEvaluator panel_eval(panel); + typedef typename MemberOp::BinaryOp BinaryOp; + PacketType p = internal::packetwise_redux_impl::template run(panel_eval,m_functor.binaryFunc(),m_arg.outerSize()); + return p; + } + +protected: + ConstArgTypeNested m_arg; + const MemberOp m_functor; +}; + +} // end namespace internal + +} // end namespace Eigen + +#endif // EIGEN_PARTIALREDUX_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/PermutationMatrix.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/PermutationMatrix.h new file mode 100644 index 0000000000000000000000000000000000000000..73a73006b45c414bb2b4de441d146ed0ccb24a7d --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/PermutationMatrix.h @@ -0,0 +1,607 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2009 Benoit Jacob +// Copyright (C) 2009-2015 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_PERMUTATIONMATRIX_H +#define EIGEN_PERMUTATIONMATRIX_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { + +enum PermPermProduct_t {PermPermProduct}; + +} // end namespace internal + +/** \class PermutationBase + * \ingroup Core_Module + * + * \brief Base class for permutations + * + * \tparam Derived the derived class + * + * This class is the base class for all expressions representing a permutation matrix, + * internally stored as a vector of integers. + * The convention followed here is that if \f$ \sigma \f$ is a permutation, the corresponding permutation matrix + * \f$ P_\sigma \f$ is such that if \f$ (e_1,\ldots,e_p) \f$ is the canonical basis, we have: + * \f[ P_\sigma(e_i) = e_{\sigma(i)}. \f] + * This convention ensures that for any two permutations \f$ \sigma, \tau \f$, we have: + * \f[ P_{\sigma\circ\tau} = P_\sigma P_\tau. \f] + * + * Permutation matrices are square and invertible. + * + * Notice that in addition to the member functions and operators listed here, there also are non-member + * operator* to multiply any kind of permutation object with any kind of matrix expression (MatrixBase) + * on either side. + * + * \sa class PermutationMatrix, class PermutationWrapper + */ +template +class PermutationBase : public EigenBase +{ + typedef internal::traits Traits; + typedef EigenBase Base; + public: + + #ifndef EIGEN_PARSED_BY_DOXYGEN + typedef typename Traits::IndicesType IndicesType; + enum { + Flags = Traits::Flags, + RowsAtCompileTime = Traits::RowsAtCompileTime, + ColsAtCompileTime = Traits::ColsAtCompileTime, + MaxRowsAtCompileTime = Traits::MaxRowsAtCompileTime, + MaxColsAtCompileTime = Traits::MaxColsAtCompileTime + }; + typedef typename Traits::StorageIndex StorageIndex; + typedef Matrix + DenseMatrixType; + typedef PermutationMatrix + PlainPermutationType; + typedef PlainPermutationType PlainObject; + using Base::derived; + typedef Inverse InverseReturnType; + typedef void Scalar; + #endif + + /** Copies the other permutation into *this */ + template + Derived& operator=(const PermutationBase& other) + { + indices() = other.indices(); + return derived(); + } + + /** Assignment from the Transpositions \a tr */ + template + Derived& operator=(const TranspositionsBase& tr) + { + setIdentity(tr.size()); + for(Index k=size()-1; k>=0; --k) + applyTranspositionOnTheRight(k,tr.coeff(k)); + return derived(); + } + + /** \returns the number of rows */ + inline EIGEN_DEVICE_FUNC Index rows() const { return Index(indices().size()); } + + /** \returns the number of columns */ + inline EIGEN_DEVICE_FUNC Index cols() const { return Index(indices().size()); } + + /** \returns the size of a side of the respective square matrix, i.e., the number of indices */ + inline EIGEN_DEVICE_FUNC Index size() const { return Index(indices().size()); } + + #ifndef EIGEN_PARSED_BY_DOXYGEN + template + void evalTo(MatrixBase& other) const + { + other.setZero(); + for (Index i=0; i=0 && j>=0 && i=0 && j>=0 && i + void assignTranspose(const PermutationBase& other) + { + for (Index i=0; i + void assignProduct(const Lhs& lhs, const Rhs& rhs) + { + eigen_assert(lhs.cols() == rhs.rows()); + for (Index i=0; i + inline PlainPermutationType operator*(const PermutationBase& other) const + { return PlainPermutationType(internal::PermPermProduct, derived(), other.derived()); } + + /** \returns the product of a permutation with another inverse permutation. + * + * \note \blank \note_try_to_help_rvo + */ + template + inline PlainPermutationType operator*(const InverseImpl& other) const + { return PlainPermutationType(internal::PermPermProduct, *this, other.eval()); } + + /** \returns the product of an inverse permutation with another permutation. + * + * \note \blank \note_try_to_help_rvo + */ + template friend + inline PlainPermutationType operator*(const InverseImpl& other, const PermutationBase& perm) + { return PlainPermutationType(internal::PermPermProduct, other.eval(), perm); } + + /** \returns the determinant of the permutation matrix, which is either 1 or -1 depending on the parity of the permutation. + * + * This function is O(\c n) procedure allocating a buffer of \c n booleans. + */ + Index determinant() const + { + Index res = 1; + Index n = size(); + Matrix mask(n); + mask.fill(false); + Index r = 0; + while(r < n) + { + // search for the next seed + while(r=n) + break; + // we got one, let's follow it until we are back to the seed + Index k0 = r++; + mask.coeffRef(k0) = true; + for(Index k=indices().coeff(k0); k!=k0; k=indices().coeff(k)) + { + mask.coeffRef(k) = true; + res = -res; + } + } + return res; + } + + protected: + +}; + +namespace internal { +template +struct traits > + : traits > +{ + typedef PermutationStorage StorageKind; + typedef Matrix IndicesType; + typedef StorageIndex_ StorageIndex; + typedef void Scalar; +}; +} + +/** \class PermutationMatrix + * \ingroup Core_Module + * + * \brief Permutation matrix + * + * \tparam SizeAtCompileTime the number of rows/cols, or Dynamic + * \tparam MaxSizeAtCompileTime the maximum number of rows/cols, or Dynamic. This optional parameter defaults to SizeAtCompileTime. Most of the time, you should not have to specify it. + * \tparam StorageIndex_ the integer type of the indices + * + * This class represents a permutation matrix, internally stored as a vector of integers. + * + * \sa class PermutationBase, class PermutationWrapper, class DiagonalMatrix + */ +template +class PermutationMatrix : public PermutationBase > +{ + typedef PermutationBase Base; + typedef internal::traits Traits; + public: + + typedef const PermutationMatrix& Nested; + + #ifndef EIGEN_PARSED_BY_DOXYGEN + typedef typename Traits::IndicesType IndicesType; + typedef typename Traits::StorageIndex StorageIndex; + #endif + + inline PermutationMatrix() + {} + + /** Constructs an uninitialized permutation matrix of given size. + */ + explicit inline PermutationMatrix(Index size) : m_indices(size) + { + eigen_internal_assert(size <= NumTraits::highest()); + } + + /** Copy constructor. */ + template + inline PermutationMatrix(const PermutationBase& other) + : m_indices(other.indices()) {} + + /** Generic constructor from expression of the indices. The indices + * array has the meaning that the permutations sends each integer i to indices[i]. + * + * \warning It is your responsibility to check that the indices array that you passes actually + * describes a permutation, i.e., each value between 0 and n-1 occurs exactly once, where n is the + * array's size. + */ + template + explicit inline PermutationMatrix(const MatrixBase& indices) : m_indices(indices) + {} + + /** Convert the Transpositions \a tr to a permutation matrix */ + template + explicit PermutationMatrix(const TranspositionsBase& tr) + : m_indices(tr.size()) + { + *this = tr; + } + + /** Copies the other permutation into *this */ + template + PermutationMatrix& operator=(const PermutationBase& other) + { + m_indices = other.indices(); + return *this; + } + + /** Assignment from the Transpositions \a tr */ + template + PermutationMatrix& operator=(const TranspositionsBase& tr) + { + return Base::operator=(tr.derived()); + } + + /** const version of indices(). */ + const IndicesType& indices() const { return m_indices; } + /** \returns a reference to the stored array representing the permutation. */ + IndicesType& indices() { return m_indices; } + + + /**** multiplication helpers to hopefully get RVO ****/ + +#ifndef EIGEN_PARSED_BY_DOXYGEN + template + PermutationMatrix(const InverseImpl& other) + : m_indices(other.derived().nestedExpression().size()) + { + eigen_internal_assert(m_indices.size() <= NumTraits::highest()); + StorageIndex end = StorageIndex(m_indices.size()); + for (StorageIndex i=0; i + PermutationMatrix(internal::PermPermProduct_t, const Lhs& lhs, const Rhs& rhs) + : m_indices(lhs.indices().size()) + { + Base::assignProduct(lhs,rhs); + } +#endif + + protected: + + IndicesType m_indices; +}; + + +namespace internal { +template +struct traits,PacketAccess_> > + : traits > +{ + typedef PermutationStorage StorageKind; + typedef Map, PacketAccess_> IndicesType; + typedef StorageIndex_ StorageIndex; + typedef void Scalar; +}; +} + +template +class Map,PacketAccess_> + : public PermutationBase,PacketAccess_> > +{ + typedef PermutationBase Base; + typedef internal::traits Traits; + public: + + #ifndef EIGEN_PARSED_BY_DOXYGEN + typedef typename Traits::IndicesType IndicesType; + typedef typename IndicesType::Scalar StorageIndex; + #endif + + inline Map(const StorageIndex* indicesPtr) + : m_indices(indicesPtr) + {} + + inline Map(const StorageIndex* indicesPtr, Index size) + : m_indices(indicesPtr,size) + {} + + /** Copies the other permutation into *this */ + template + Map& operator=(const PermutationBase& other) + { return Base::operator=(other.derived()); } + + /** Assignment from the Transpositions \a tr */ + template + Map& operator=(const TranspositionsBase& tr) + { return Base::operator=(tr.derived()); } + + #ifndef EIGEN_PARSED_BY_DOXYGEN + /** This is a special case of the templated operator=. Its purpose is to + * prevent a default operator= from hiding the templated operator=. + */ + Map& operator=(const Map& other) + { + m_indices = other.m_indices; + return *this; + } + #endif + + /** const version of indices(). */ + const IndicesType& indices() const { return m_indices; } + /** \returns a reference to the stored array representing the permutation. */ + IndicesType& indices() { return m_indices; } + + protected: + + IndicesType m_indices; +}; + +template class TranspositionsWrapper; +namespace internal { +template +struct traits > +{ + typedef PermutationStorage StorageKind; + typedef void Scalar; + typedef typename IndicesType_::Scalar StorageIndex; + typedef IndicesType_ IndicesType; + enum { + RowsAtCompileTime = IndicesType_::SizeAtCompileTime, + ColsAtCompileTime = IndicesType_::SizeAtCompileTime, + MaxRowsAtCompileTime = IndicesType::MaxSizeAtCompileTime, + MaxColsAtCompileTime = IndicesType::MaxSizeAtCompileTime, + Flags = 0 + }; +}; +} + +/** \class PermutationWrapper + * \ingroup Core_Module + * + * \brief Class to view a vector of integers as a permutation matrix + * + * \tparam IndicesType_ the type of the vector of integer (can be any compatible expression) + * + * This class allows to view any vector expression of integers as a permutation matrix. + * + * \sa class PermutationBase, class PermutationMatrix + */ +template +class PermutationWrapper : public PermutationBase > +{ + typedef PermutationBase Base; + typedef internal::traits Traits; + public: + + #ifndef EIGEN_PARSED_BY_DOXYGEN + typedef typename Traits::IndicesType IndicesType; + #endif + + inline PermutationWrapper(const IndicesType& indices) + : m_indices(indices) + {} + + /** const version of indices(). */ + const internal::remove_all_t& + indices() const { return m_indices; } + + protected: + + typename IndicesType::Nested m_indices; +}; + + +/** \returns the matrix with the permutation applied to the columns. + */ +template +EIGEN_DEVICE_FUNC +const Product +operator*(const MatrixBase &matrix, + const PermutationBase& permutation) +{ + return Product + (matrix.derived(), permutation.derived()); +} + +/** \returns the matrix with the permutation applied to the rows. + */ +template +EIGEN_DEVICE_FUNC +const Product +operator*(const PermutationBase &permutation, + const MatrixBase& matrix) +{ + return Product + (permutation.derived(), matrix.derived()); +} + + +template +class InverseImpl + : public EigenBase > +{ + typedef typename PermutationType::PlainPermutationType PlainPermutationType; + typedef internal::traits PermTraits; + protected: + InverseImpl() {} + public: + typedef Inverse InverseType; + using EigenBase >::derived; + + #ifndef EIGEN_PARSED_BY_DOXYGEN + typedef typename PermutationType::DenseMatrixType DenseMatrixType; + enum { + RowsAtCompileTime = PermTraits::RowsAtCompileTime, + ColsAtCompileTime = PermTraits::ColsAtCompileTime, + MaxRowsAtCompileTime = PermTraits::MaxRowsAtCompileTime, + MaxColsAtCompileTime = PermTraits::MaxColsAtCompileTime + }; + #endif + + #ifndef EIGEN_PARSED_BY_DOXYGEN + template + void evalTo(MatrixBase& other) const + { + other.setZero(); + for (Index i=0; i friend + const Product + operator*(const MatrixBase& matrix, const InverseType& trPerm) + { + return Product(matrix.derived(), trPerm.derived()); + } + + /** \returns the matrix with the inverse permutation applied to the rows. + */ + template + const Product + operator*(const MatrixBase& matrix) const + { + return Product(derived(), matrix.derived()); + } +}; + +template +const PermutationWrapper MatrixBase::asPermutation() const +{ + return derived(); +} + +namespace internal { + +template<> struct AssignmentKind { typedef EigenBase2EigenBase Kind; }; + +} // end namespace internal + +} // end namespace Eigen + +#endif // EIGEN_PERMUTATIONMATRIX_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/PlainObjectBase.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/PlainObjectBase.h new file mode 100644 index 0000000000000000000000000000000000000000..ba6e51d3162dc9f0ea05f0097d4d17214c7765df --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/PlainObjectBase.h @@ -0,0 +1,1099 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008-2009 Gael Guennebaud +// Copyright (C) 2006-2008 Benoit Jacob +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_DENSESTORAGEBASE_H +#define EIGEN_DENSESTORAGEBASE_H + +#if defined(EIGEN_INITIALIZE_MATRICES_BY_ZERO) +# define EIGEN_INITIALIZE_COEFFS +# define EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED for(Index i=0;i::quiet_NaN(); +#else +# undef EIGEN_INITIALIZE_COEFFS +# define EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED +#endif + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { + +template +struct check_rows_cols_for_overflow { + EIGEN_STATIC_ASSERT(MaxRowsAtCompileTime * MaxColsAtCompileTime == MaxSizeAtCompileTime,YOU MADE A PROGRAMMING MISTAKE) + template + EIGEN_DEVICE_FUNC static EIGEN_ALWAYS_INLINE constexpr void run(Index, Index) {} +}; + +template +struct check_rows_cols_for_overflow { + template + EIGEN_DEVICE_FUNC static EIGEN_ALWAYS_INLINE constexpr void run(Index, Index cols) { + constexpr Index MaxIndex = NumTraits::highest(); + bool error = cols > MaxIndex / MaxRowsAtCompileTime; + if (error) throw_std_bad_alloc(); + } +}; + +template +struct check_rows_cols_for_overflow { + template + EIGEN_DEVICE_FUNC static EIGEN_ALWAYS_INLINE constexpr void run(Index rows, Index) { + constexpr Index MaxIndex = NumTraits::highest(); + bool error = rows > MaxIndex / MaxColsAtCompileTime; + if (error) throw_std_bad_alloc(); + } +}; + +template <> +struct check_rows_cols_for_overflow { + template + EIGEN_DEVICE_FUNC static EIGEN_ALWAYS_INLINE constexpr void run(Index rows, Index cols) { + constexpr Index MaxIndex = NumTraits::highest(); + bool error = cols == 0 ? false : (rows > MaxIndex / cols); + if (error) throw_std_bad_alloc(); + } +}; + +template +struct conservative_resize_like_impl; + +template struct matrix_swap_impl; + +} // end namespace internal + +#ifdef EIGEN_PARSED_BY_DOXYGEN +namespace doxygen { + +// This is a workaround to doxygen not being able to understand the inheritance logic +// when it is hidden by the dense_xpr_base helper struct. +// Moreover, doxygen fails to include members that are not documented in the declaration body of +// MatrixBase if we inherits MatrixBase >, +// this is why we simply inherits MatrixBase, though this does not make sense. + +/** This class is just a workaround for Doxygen and it does not not actually exist. */ +template struct dense_xpr_base_dispatcher; +/** This class is just a workaround for Doxygen and it does not not actually exist. */ +template +struct dense_xpr_base_dispatcher > + : public MatrixBase {}; +/** This class is just a workaround for Doxygen and it does not not actually exist. */ +template +struct dense_xpr_base_dispatcher > + : public ArrayBase {}; + +} // namespace doxygen + +/** \class PlainObjectBase + * \ingroup Core_Module + * \brief %Dense storage base class for matrices and arrays. + * + * This class can be extended with the help of the plugin mechanism described on the page + * \ref TopicCustomizing_Plugins by defining the preprocessor symbol \c EIGEN_PLAINOBJECTBASE_PLUGIN. + * + * \tparam Derived is the derived type, e.g., a Matrix or Array + * + * \sa \ref TopicClassHierarchy + */ +template +class PlainObjectBase : public doxygen::dense_xpr_base_dispatcher +#else +template +class PlainObjectBase : public internal::dense_xpr_base::type +#endif +{ + public: + enum { Options = internal::traits::Options }; + typedef typename internal::dense_xpr_base::type Base; + + typedef typename internal::traits::StorageKind StorageKind; + typedef typename internal::traits::Scalar Scalar; + + typedef typename internal::packet_traits::type PacketScalar; + typedef typename NumTraits::Real RealScalar; + typedef Derived DenseType; + + using Base::RowsAtCompileTime; + using Base::ColsAtCompileTime; + using Base::SizeAtCompileTime; + using Base::MaxRowsAtCompileTime; + using Base::MaxColsAtCompileTime; + using Base::MaxSizeAtCompileTime; + using Base::IsVectorAtCompileTime; + using Base::Flags; + + typedef Eigen::Map MapType; + typedef const Eigen::Map ConstMapType; + typedef Eigen::Map AlignedMapType; + typedef const Eigen::Map ConstAlignedMapType; + template struct StridedMapType { typedef Eigen::Map type; }; + template struct StridedConstMapType { typedef Eigen::Map type; }; + template struct StridedAlignedMapType { typedef Eigen::Map type; }; + template struct StridedConstAlignedMapType { typedef Eigen::Map type; }; + + protected: + DenseStorage m_storage; + + public: + enum { NeedsToAlign = (SizeAtCompileTime != Dynamic) && (internal::traits::Alignment>0) }; + EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(NeedsToAlign) + + EIGEN_STATIC_ASSERT(internal::check_implication(MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1, (int(Options)&RowMajor)==RowMajor), INVALID_MATRIX_TEMPLATE_PARAMETERS) + EIGEN_STATIC_ASSERT(internal::check_implication(MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1, (int(Options)&RowMajor)==0), INVALID_MATRIX_TEMPLATE_PARAMETERS) + EIGEN_STATIC_ASSERT((RowsAtCompileTime == Dynamic) || (RowsAtCompileTime >= 0), INVALID_MATRIX_TEMPLATE_PARAMETERS) + EIGEN_STATIC_ASSERT((ColsAtCompileTime == Dynamic) || (ColsAtCompileTime >= 0), INVALID_MATRIX_TEMPLATE_PARAMETERS) + EIGEN_STATIC_ASSERT((MaxRowsAtCompileTime == Dynamic) || (MaxRowsAtCompileTime >= 0), INVALID_MATRIX_TEMPLATE_PARAMETERS) + EIGEN_STATIC_ASSERT((MaxColsAtCompileTime == Dynamic) || (MaxColsAtCompileTime >= 0), INVALID_MATRIX_TEMPLATE_PARAMETERS) + EIGEN_STATIC_ASSERT((MaxRowsAtCompileTime == RowsAtCompileTime || RowsAtCompileTime==Dynamic), INVALID_MATRIX_TEMPLATE_PARAMETERS) + EIGEN_STATIC_ASSERT((MaxColsAtCompileTime == ColsAtCompileTime || ColsAtCompileTime==Dynamic), INVALID_MATRIX_TEMPLATE_PARAMETERS) + EIGEN_STATIC_ASSERT(((Options & (DontAlign|RowMajor)) == Options), INVALID_MATRIX_TEMPLATE_PARAMETERS) + + EIGEN_DEVICE_FUNC + Base& base() { return *static_cast(this); } + EIGEN_DEVICE_FUNC + const Base& base() const { return *static_cast(this); } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR + Index rows() const EIGEN_NOEXCEPT { return m_storage.rows(); } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR + Index cols() const EIGEN_NOEXCEPT { return m_storage.cols(); } + + /** This is an overloaded version of DenseCoeffsBase::coeff(Index,Index) const + * provided to by-pass the creation of an evaluator of the expression, thus saving compilation efforts. + * + * See DenseCoeffsBase::coeff(Index) const for details. */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr const Scalar& coeff(Index rowId, Index colId) const { + if (Flags & RowMajorBit) + return m_storage.data()[colId + rowId * m_storage.cols()]; + else // column-major + return m_storage.data()[rowId + colId * m_storage.rows()]; + } + + /** This is an overloaded version of DenseCoeffsBase::coeff(Index) const + * provided to by-pass the creation of an evaluator of the expression, thus saving compilation efforts. + * + * See DenseCoeffsBase::coeff(Index) const for details. */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE const Scalar& coeff(Index index) const + { + return m_storage.data()[index]; + } + + /** This is an overloaded version of DenseCoeffsBase::coeffRef(Index,Index) const + * provided to by-pass the creation of an evaluator of the expression, thus saving compilation efforts. + * + * See DenseCoeffsBase::coeffRef(Index,Index) const for details. */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Scalar& coeffRef(Index rowId, Index colId) { + if (Flags & RowMajorBit) + return m_storage.data()[colId + rowId * m_storage.cols()]; + else // column-major + return m_storage.data()[rowId + colId * m_storage.rows()]; + } + + /** This is an overloaded version of DenseCoeffsBase::coeffRef(Index) const + * provided to by-pass the creation of an evaluator of the expression, thus saving compilation efforts. + * + * See DenseCoeffsBase::coeffRef(Index) const for details. */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Scalar& coeffRef(Index index) { return m_storage.data()[index]; } + + /** This is the const version of coeffRef(Index,Index) which is thus synonym of coeff(Index,Index). + * It is provided for convenience. */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr const Scalar& coeffRef(Index rowId, Index colId) const { + if (Flags & RowMajorBit) + return m_storage.data()[colId + rowId * m_storage.cols()]; + else // column-major + return m_storage.data()[rowId + colId * m_storage.rows()]; + } + + /** This is the const version of coeffRef(Index) which is thus synonym of coeff(Index). + * It is provided for convenience. */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr const Scalar& coeffRef(Index index) const { + return m_storage.data()[index]; + } + + /** \internal */ + template + EIGEN_STRONG_INLINE PacketScalar packet(Index rowId, Index colId) const + { + return internal::ploadt + (m_storage.data() + (Flags & RowMajorBit + ? colId + rowId * m_storage.cols() + : rowId + colId * m_storage.rows())); + } + + /** \internal */ + template + EIGEN_STRONG_INLINE PacketScalar packet(Index index) const + { + return internal::ploadt(m_storage.data() + index); + } + + /** \internal */ + template + EIGEN_STRONG_INLINE void writePacket(Index rowId, Index colId, const PacketScalar& val) + { + internal::pstoret + (m_storage.data() + (Flags & RowMajorBit + ? colId + rowId * m_storage.cols() + : rowId + colId * m_storage.rows()), val); + } + + /** \internal */ + template + EIGEN_STRONG_INLINE void writePacket(Index index, const PacketScalar& val) + { + internal::pstoret(m_storage.data() + index, val); + } + + /** \returns a const pointer to the data array of this matrix */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar *data() const + { return m_storage.data(); } + + /** \returns a pointer to the data array of this matrix */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar *data() + { return m_storage.data(); } + + /** Resizes \c *this to a \a rows x \a cols matrix. + * + * This method is intended for dynamic-size matrices, although it is legal to call it on any + * matrix as long as fixed dimensions are left unchanged. If you only want to change the number + * of rows and/or of columns, you can use resize(NoChange_t, Index), resize(Index, NoChange_t). + * + * If the current number of coefficients of \c *this exactly matches the + * product \a rows * \a cols, then no memory allocation is performed and + * the current values are left unchanged. In all other cases, including + * shrinking, the data is reallocated and all previous values are lost. + * + * Example: \include Matrix_resize_int_int.cpp + * Output: \verbinclude Matrix_resize_int_int.out + * + * \sa resize(Index) for vectors, resize(NoChange_t, Index), resize(Index, NoChange_t) + */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void resize(Index rows, Index cols) { + eigen_assert(internal::check_implication(RowsAtCompileTime!=Dynamic, rows==RowsAtCompileTime) + && internal::check_implication(ColsAtCompileTime!=Dynamic, cols==ColsAtCompileTime) + && internal::check_implication(RowsAtCompileTime==Dynamic && MaxRowsAtCompileTime!=Dynamic, rows<=MaxRowsAtCompileTime) + && internal::check_implication(ColsAtCompileTime==Dynamic && MaxColsAtCompileTime!=Dynamic, cols<=MaxColsAtCompileTime) + && rows>=0 && cols>=0 && "Invalid sizes when resizing a matrix or array."); + internal::check_rows_cols_for_overflow::run(rows, cols); + #ifdef EIGEN_INITIALIZE_COEFFS + Index size = rows*cols; + bool size_changed = size != this->size(); + m_storage.resize(size, rows, cols); + if(size_changed) EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED + #else + m_storage.resize(rows*cols, rows, cols); + #endif + } + + /** Resizes \c *this to a vector of length \a size + * + * \only_for_vectors. This method does not work for + * partially dynamic matrices when the static dimension is anything other + * than 1. For example it will not work with Matrix. + * + * Example: \include Matrix_resize_int.cpp + * Output: \verbinclude Matrix_resize_int.out + * + * \sa resize(Index,Index), resize(NoChange_t, Index), resize(Index, NoChange_t) + */ + EIGEN_DEVICE_FUNC inline constexpr void resize(Index size) { + EIGEN_STATIC_ASSERT_VECTOR_ONLY(PlainObjectBase) + eigen_assert( + ((SizeAtCompileTime == Dynamic && (MaxSizeAtCompileTime == Dynamic || size <= MaxSizeAtCompileTime)) || + SizeAtCompileTime == size) && + size >= 0); +#ifdef EIGEN_INITIALIZE_COEFFS + bool size_changed = size != this->size(); + #endif + if(RowsAtCompileTime == 1) + m_storage.resize(size, 1, size); + else + m_storage.resize(size, size, 1); + #ifdef EIGEN_INITIALIZE_COEFFS + if(size_changed) EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED + #endif + } + + /** Resizes the matrix, changing only the number of columns. For the parameter of type NoChange_t, just pass the special value \c NoChange + * as in the example below. + * + * Example: \include Matrix_resize_NoChange_int.cpp + * Output: \verbinclude Matrix_resize_NoChange_int.out + * + * \sa resize(Index,Index) + */ + EIGEN_DEVICE_FUNC inline constexpr void resize(NoChange_t, Index cols) { resize(rows(), cols); } + + /** Resizes the matrix, changing only the number of rows. For the parameter of type NoChange_t, just pass the special value \c NoChange + * as in the example below. + * + * Example: \include Matrix_resize_int_NoChange.cpp + * Output: \verbinclude Matrix_resize_int_NoChange.out + * + * \sa resize(Index,Index) + */ + EIGEN_DEVICE_FUNC inline constexpr void resize(Index rows, NoChange_t) { resize(rows, cols()); } + + /** Resizes \c *this to have the same dimensions as \a other. + * Takes care of doing all the checking that's needed. + * + * Note that copying a row-vector into a vector (and conversely) is allowed. + * The resizing, if any, is then done in the appropriate way so that row-vectors + * remain row-vectors and vectors remain vectors. + */ + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void resizeLike(const EigenBase& _other) + { + const OtherDerived& other = _other.derived(); + internal::check_rows_cols_for_overflow::run(other.rows(), other.cols()); + const Index othersize = other.rows()*other.cols(); + if(RowsAtCompileTime == 1) + { + eigen_assert(other.rows() == 1 || other.cols() == 1); + resize(1, othersize); + } + else if(ColsAtCompileTime == 1) + { + eigen_assert(other.rows() == 1 || other.cols() == 1); + resize(othersize, 1); + } + else resize(other.rows(), other.cols()); + } + + /** Resizes the matrix to \a rows x \a cols while leaving old values untouched. + * + * The method is intended for matrices of dynamic size. If you only want to change the number + * of rows and/or of columns, you can use conservativeResize(NoChange_t, Index) or + * conservativeResize(Index, NoChange_t). + * + * Matrices are resized relative to the top-left element. In case values need to be + * appended to the matrix they will be uninitialized. + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void conservativeResize(Index rows, Index cols) + { + internal::conservative_resize_like_impl::run(*this, rows, cols); + } + + /** Resizes the matrix to \a rows x \a cols while leaving old values untouched. + * + * As opposed to conservativeResize(Index rows, Index cols), this version leaves + * the number of columns unchanged. + * + * In case the matrix is growing, new rows will be uninitialized. + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void conservativeResize(Index rows, NoChange_t) + { + // Note: see the comment in conservativeResize(Index,Index) + conservativeResize(rows, cols()); + } + + /** Resizes the matrix to \a rows x \a cols while leaving old values untouched. + * + * As opposed to conservativeResize(Index rows, Index cols), this version leaves + * the number of rows unchanged. + * + * In case the matrix is growing, new columns will be uninitialized. + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void conservativeResize(NoChange_t, Index cols) + { + // Note: see the comment in conservativeResize(Index,Index) + conservativeResize(rows(), cols); + } + + /** Resizes the vector to \a size while retaining old values. + * + * \only_for_vectors. This method does not work for + * partially dynamic matrices when the static dimension is anything other + * than 1. For example it will not work with Matrix. + * + * When values are appended, they will be uninitialized. + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void conservativeResize(Index size) + { + internal::conservative_resize_like_impl::run(*this, size); + } + + /** Resizes the matrix to \a rows x \a cols of \c other, while leaving old values untouched. + * + * The method is intended for matrices of dynamic size. If you only want to change the number + * of rows and/or of columns, you can use conservativeResize(NoChange_t, Index) or + * conservativeResize(Index, NoChange_t). + * + * Matrices are resized relative to the top-left element. In case values need to be + * appended to the matrix they will copied from \c other. + */ + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void conservativeResizeLike(const DenseBase& other) + { + internal::conservative_resize_like_impl::run(*this, other); + } + + /** This is a special case of the templated operator=. Its purpose is to + * prevent a default operator= from hiding the templated operator=. + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Derived& operator=(const PlainObjectBase& other) + { + return _set(other); + } + + /** \sa MatrixBase::lazyAssign() */ + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Derived& lazyAssign(const DenseBase& other) + { + _resize_to_match(other); + return Base::lazyAssign(other.derived()); + } + + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Derived& operator=(const ReturnByValue& func) + { + resize(func.rows(), func.cols()); + return Base::operator=(func); + } + + // Prevent user from trying to instantiate PlainObjectBase objects + // by making all its constructor protected. See bug 1074. + protected: + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE PlainObjectBase() : m_storage() + { +// EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED + } + +#ifndef EIGEN_PARSED_BY_DOXYGEN + // FIXME is it still needed ? + /** \internal */ + EIGEN_DEVICE_FUNC + explicit PlainObjectBase(internal::constructor_without_unaligned_array_assert) + : m_storage(internal::constructor_without_unaligned_array_assert()) + { + // EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED + } +#endif + + EIGEN_DEVICE_FUNC + PlainObjectBase(PlainObjectBase&& other) EIGEN_NOEXCEPT + : m_storage( std::move(other.m_storage) ) + { + } + + EIGEN_DEVICE_FUNC + PlainObjectBase& operator=(PlainObjectBase&& other) EIGEN_NOEXCEPT + { + m_storage = std::move(other.m_storage); + return *this; + } + + /** Copy constructor */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE PlainObjectBase(const PlainObjectBase& other) + : Base(), m_storage(other.m_storage) { } + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE PlainObjectBase(Index size, Index rows, Index cols) + : m_storage(size, rows, cols) + { +// EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED + } + + /** \brief Construct a row of column vector with fixed size from an arbitrary number of coefficients. + * + * \only_for_vectors + * + * This constructor is for 1D array or vectors with more than 4 coefficients. + * + * \warning To construct a column (resp. row) vector of fixed length, the number of values passed to this + * constructor must match the the fixed number of rows (resp. columns) of \c *this. + */ + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + PlainObjectBase(const Scalar& a0, const Scalar& a1, const Scalar& a2, const Scalar& a3, const ArgTypes&... args) + : m_storage() + { + EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(PlainObjectBase, sizeof...(args) + 4); + m_storage.data()[0] = a0; + m_storage.data()[1] = a1; + m_storage.data()[2] = a2; + m_storage.data()[3] = a3; + Index i = 4; + auto x = {(m_storage.data()[i++] = args, 0)...}; + static_cast(x); + } + + /** \brief Constructs a Matrix or Array and initializes it by elements given by an initializer list of initializer + * lists + */ + EIGEN_DEVICE_FUNC explicit constexpr EIGEN_STRONG_INLINE PlainObjectBase( + const std::initializer_list>& list) + : m_storage() { + size_t list_size = 0; + if (list.begin() != list.end()) { + list_size = list.begin()->size(); + } + + // This is to allow syntax like VectorXi {{1, 2, 3, 4}} + if (ColsAtCompileTime == 1 && list.size() == 1) { + eigen_assert(list_size == static_cast(RowsAtCompileTime) || RowsAtCompileTime == Dynamic); + resize(list_size, ColsAtCompileTime); + if (list.begin()->begin() != nullptr) { + std::copy(list.begin()->begin(), list.begin()->end(), m_storage.data()); + } + } else { + eigen_assert(list.size() == static_cast(RowsAtCompileTime) || RowsAtCompileTime == Dynamic); + eigen_assert(list_size == static_cast(ColsAtCompileTime) || ColsAtCompileTime == Dynamic); + resize(list.size(), list_size); + + Index row_index = 0; + for (const std::initializer_list& row : list) { + eigen_assert(list_size == row.size()); + Index col_index = 0; + for (const Scalar& e : row) { + coeffRef(row_index, col_index) = e; + ++col_index; + } + ++row_index; + } + } + } + + /** \sa PlainObjectBase::operator=(const EigenBase&) */ + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE PlainObjectBase(const DenseBase &other) + : m_storage() + { + resizeLike(other); + _set_noalias(other); + } + + /** \sa PlainObjectBase::operator=(const EigenBase&) */ + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE PlainObjectBase(const EigenBase &other) + : m_storage() + { + resizeLike(other); + *this = other.derived(); + } + /** \brief Copy constructor with in-place evaluation */ + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE PlainObjectBase(const ReturnByValue& other) + { + // FIXME this does not automatically transpose vectors if necessary + resize(other.rows(), other.cols()); + other.evalTo(this->derived()); + } + + public: + + /** \brief Copies the generic expression \a other into *this. + * \copydetails DenseBase::operator=(const EigenBase &other) + */ + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Derived& operator=(const EigenBase &other) + { + _resize_to_match(other); + Base::operator=(other.derived()); + return this->derived(); + } + + /** \name Map + * These are convenience functions returning Map objects. The Map() static functions return unaligned Map objects, + * while the AlignedMap() functions return aligned Map objects and thus should be called only with 16-byte-aligned + * \a data pointers. + * + * Here is an example using strides: + * \include Matrix_Map_stride.cpp + * Output: \verbinclude Matrix_Map_stride.out + * + * \see class Map + */ + ///@{ + static inline ConstMapType Map(const Scalar* data) + { return ConstMapType(data); } + static inline MapType Map(Scalar* data) + { return MapType(data); } + static inline ConstMapType Map(const Scalar* data, Index size) + { return ConstMapType(data, size); } + static inline MapType Map(Scalar* data, Index size) + { return MapType(data, size); } + static inline ConstMapType Map(const Scalar* data, Index rows, Index cols) + { return ConstMapType(data, rows, cols); } + static inline MapType Map(Scalar* data, Index rows, Index cols) + { return MapType(data, rows, cols); } + + static inline ConstAlignedMapType MapAligned(const Scalar* data) + { return ConstAlignedMapType(data); } + static inline AlignedMapType MapAligned(Scalar* data) + { return AlignedMapType(data); } + static inline ConstAlignedMapType MapAligned(const Scalar* data, Index size) + { return ConstAlignedMapType(data, size); } + static inline AlignedMapType MapAligned(Scalar* data, Index size) + { return AlignedMapType(data, size); } + static inline ConstAlignedMapType MapAligned(const Scalar* data, Index rows, Index cols) + { return ConstAlignedMapType(data, rows, cols); } + static inline AlignedMapType MapAligned(Scalar* data, Index rows, Index cols) + { return AlignedMapType(data, rows, cols); } + + template + static inline typename StridedConstMapType >::type Map(const Scalar* data, const Stride& stride) + { return typename StridedConstMapType >::type(data, stride); } + template + static inline typename StridedMapType >::type Map(Scalar* data, const Stride& stride) + { return typename StridedMapType >::type(data, stride); } + template + static inline typename StridedConstMapType >::type Map(const Scalar* data, Index size, const Stride& stride) + { return typename StridedConstMapType >::type(data, size, stride); } + template + static inline typename StridedMapType >::type Map(Scalar* data, Index size, const Stride& stride) + { return typename StridedMapType >::type(data, size, stride); } + template + static inline typename StridedConstMapType >::type Map(const Scalar* data, Index rows, Index cols, const Stride& stride) + { return typename StridedConstMapType >::type(data, rows, cols, stride); } + template + static inline typename StridedMapType >::type Map(Scalar* data, Index rows, Index cols, const Stride& stride) + { return typename StridedMapType >::type(data, rows, cols, stride); } + + template + static inline typename StridedConstAlignedMapType >::type MapAligned(const Scalar* data, const Stride& stride) + { return typename StridedConstAlignedMapType >::type(data, stride); } + template + static inline typename StridedAlignedMapType >::type MapAligned(Scalar* data, const Stride& stride) + { return typename StridedAlignedMapType >::type(data, stride); } + template + static inline typename StridedConstAlignedMapType >::type MapAligned(const Scalar* data, Index size, const Stride& stride) + { return typename StridedConstAlignedMapType >::type(data, size, stride); } + template + static inline typename StridedAlignedMapType >::type MapAligned(Scalar* data, Index size, const Stride& stride) + { return typename StridedAlignedMapType >::type(data, size, stride); } + template + static inline typename StridedConstAlignedMapType >::type MapAligned(const Scalar* data, Index rows, Index cols, const Stride& stride) + { return typename StridedConstAlignedMapType >::type(data, rows, cols, stride); } + template + static inline typename StridedAlignedMapType >::type MapAligned(Scalar* data, Index rows, Index cols, const Stride& stride) + { return typename StridedAlignedMapType >::type(data, rows, cols, stride); } + ///@} + + using Base::setConstant; + EIGEN_DEVICE_FUNC Derived& setConstant(Index size, const Scalar& val); + EIGEN_DEVICE_FUNC Derived& setConstant(Index rows, Index cols, const Scalar& val); + EIGEN_DEVICE_FUNC Derived& setConstant(NoChange_t, Index cols, const Scalar& val); + EIGEN_DEVICE_FUNC Derived& setConstant(Index rows, NoChange_t, const Scalar& val); + + using Base::setZero; + EIGEN_DEVICE_FUNC Derived& setZero(Index size); + EIGEN_DEVICE_FUNC Derived& setZero(Index rows, Index cols); + EIGEN_DEVICE_FUNC Derived& setZero(NoChange_t, Index cols); + EIGEN_DEVICE_FUNC Derived& setZero(Index rows, NoChange_t); + + using Base::setOnes; + EIGEN_DEVICE_FUNC Derived& setOnes(Index size); + EIGEN_DEVICE_FUNC Derived& setOnes(Index rows, Index cols); + EIGEN_DEVICE_FUNC Derived& setOnes(NoChange_t, Index cols); + EIGEN_DEVICE_FUNC Derived& setOnes(Index rows, NoChange_t); + + using Base::setRandom; + Derived& setRandom(Index size); + Derived& setRandom(Index rows, Index cols); + Derived& setRandom(NoChange_t, Index cols); + Derived& setRandom(Index rows, NoChange_t); + + #ifdef EIGEN_PLAINOBJECTBASE_PLUGIN + #include EIGEN_PLAINOBJECTBASE_PLUGIN + #endif + + protected: + /** \internal Resizes *this in preparation for assigning \a other to it. + * Takes care of doing all the checking that's needed. + * + * Note that copying a row-vector into a vector (and conversely) is allowed. + * The resizing, if any, is then done in the appropriate way so that row-vectors + * remain row-vectors and vectors remain vectors. + */ + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void _resize_to_match(const EigenBase& other) + { + #ifdef EIGEN_NO_AUTOMATIC_RESIZING + eigen_assert((this->size()==0 || (IsVectorAtCompileTime ? (this->size() == other.size()) + : (rows() == other.rows() && cols() == other.cols()))) + && "Size mismatch. Automatic resizing is disabled because EIGEN_NO_AUTOMATIC_RESIZING is defined"); + EIGEN_ONLY_USED_FOR_DEBUG(other); + #else + resizeLike(other); + #endif + } + + /** + * \brief Copies the value of the expression \a other into \c *this with automatic resizing. + * + * *this might be resized to match the dimensions of \a other. If *this was a null matrix (not already initialized), + * it will be initialized. + * + * Note that copying a row-vector into a vector (and conversely) is allowed. + * The resizing, if any, is then done in the appropriate way so that row-vectors + * remain row-vectors and vectors remain vectors. + * + * \sa operator=(const MatrixBase&), _set_noalias() + * + * \internal + */ + // aliasing is dealt once in internal::call_assignment + // so at this stage we have to assume aliasing... and resising has to be done later. + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Derived& _set(const DenseBase& other) + { + internal::call_assignment(this->derived(), other.derived()); + return this->derived(); + } + + /** \internal Like _set() but additionally makes the assumption that no aliasing effect can happen (which + * is the case when creating a new matrix) so one can enforce lazy evaluation. + * + * \sa operator=(const MatrixBase&), _set() + */ + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Derived& _set_noalias(const DenseBase& other) + { + // I don't think we need this resize call since the lazyAssign will anyways resize + // and lazyAssign will be called by the assign selector. + //_resize_to_match(other); + // the 'false' below means to enforce lazy evaluation. We don't use lazyAssign() because + // it wouldn't allow to copy a row-vector into a column-vector. + internal::call_assignment_no_alias(this->derived(), other.derived(), internal::assign_op()); + return this->derived(); + } + + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void _init2(Index rows, Index cols, std::enable_if_t* = 0) + { + EIGEN_STATIC_ASSERT(internal::is_valid_index_type::value && + internal::is_valid_index_type::value, + T0 AND T1 MUST BE INTEGER TYPES) + resize(rows,cols); + } + + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void _init2(const T0& val0, const T1& val1, std::enable_if_t* = 0) + { + EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(PlainObjectBase, 2) + m_storage.data()[0] = Scalar(val0); + m_storage.data()[1] = Scalar(val1); + } + + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void _init2(const Index& val0, const Index& val1, + std::enable_if_t< (!internal::is_same::value) + && (internal::is_same::value) + && (internal::is_same::value) + && Base::SizeAtCompileTime==2,T1>* = 0) + { + EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(PlainObjectBase, 2) + m_storage.data()[0] = Scalar(val0); + m_storage.data()[1] = Scalar(val1); + } + + // The argument is convertible to the Index type and we either have a non 1x1 Matrix, or a dynamic-sized Array, + // then the argument is meant to be the size of the object. + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void _init1(Index size, std::enable_if_t< (Base::SizeAtCompileTime!=1 || !internal::is_convertible::value) + && ((!internal::is_same::XprKind,ArrayXpr>::value || Base::SizeAtCompileTime==Dynamic)),T>* = 0) + { + // NOTE MSVC 2008 complains if we directly put bool(NumTraits::IsInteger) as the EIGEN_STATIC_ASSERT argument. + const bool is_integer_alike = internal::is_valid_index_type::value; + EIGEN_UNUSED_VARIABLE(is_integer_alike); + EIGEN_STATIC_ASSERT(is_integer_alike, + FLOATING_POINT_ARGUMENT_PASSED__INTEGER_WAS_EXPECTED) + resize(size); + } + + // We have a 1x1 matrix/array => the argument is interpreted as the value of the unique coefficient (case where scalar type can be implicitly converted) + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void _init1(const Scalar& val0, std::enable_if_t::value,T>* = 0) + { + EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(PlainObjectBase, 1) + m_storage.data()[0] = val0; + } + + // We have a 1x1 matrix/array => the argument is interpreted as the value of the unique coefficient (case where scalar type match the index type) + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void _init1(const Index& val0, + std::enable_if_t< (!internal::is_same::value) + && (internal::is_same::value) + && Base::SizeAtCompileTime==1 + && internal::is_convertible::value,T*>* = 0) + { + EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(PlainObjectBase, 1) + m_storage.data()[0] = Scalar(val0); + } + + // Initialize a fixed size matrix from a pointer to raw data + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void _init1(const Scalar* data){ + this->_set_noalias(ConstMapType(data)); + } + + // Initialize an arbitrary matrix from a dense expression + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void _init1(const DenseBase& other){ + this->_set_noalias(other); + } + + // Initialize an arbitrary matrix from an object convertible to the Derived type. + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void _init1(const Derived& other){ + this->_set_noalias(other); + } + + // Initialize an arbitrary matrix from a generic Eigen expression + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void _init1(const EigenBase& other){ + this->derived() = other; + } + + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void _init1(const ReturnByValue& other) + { + resize(other.rows(), other.cols()); + other.evalTo(this->derived()); + } + + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void _init1(const RotationBase& r) + { + this->derived() = r; + } + + // For fixed-size Array + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void _init1(const Scalar& val0, + std::enable_if_t< Base::SizeAtCompileTime!=Dynamic + && Base::SizeAtCompileTime!=1 + && internal::is_convertible::value + && internal::is_same::XprKind,ArrayXpr>::value,T>* = 0) + { + Base::setConstant(val0); + } + + // For fixed-size Array + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void _init1(const Index& val0, + std::enable_if_t< (!internal::is_same::value) + && (internal::is_same::value) + && Base::SizeAtCompileTime!=Dynamic + && Base::SizeAtCompileTime!=1 + && internal::is_convertible::value + && internal::is_same::XprKind,ArrayXpr>::value,T*>* = 0) + { + Base::setConstant(val0); + } + + template + friend struct internal::matrix_swap_impl; + + public: + +#ifndef EIGEN_PARSED_BY_DOXYGEN + /** \internal + * \brief Override DenseBase::swap() since for dynamic-sized matrices + * of same type it is enough to swap the data pointers. + */ + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + void swap(DenseBase & other) + { + enum { SwapPointers = internal::is_same::value && Base::SizeAtCompileTime==Dynamic }; + internal::matrix_swap_impl::run(this->derived(), other.derived()); + } + + /** \internal + * \brief const version forwarded to DenseBase::swap + */ + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + void swap(DenseBase const & other) + { Base::swap(other.derived()); } + + enum { IsPlainObjectBase = 1 }; +#endif + public: + // These apparently need to be down here for nvcc+icc to prevent duplicate + // Map symbol. + template friend class Eigen::Map; + friend class Eigen::Map; + friend class Eigen::Map; +#if EIGEN_MAX_ALIGN_BYTES>0 + // for EIGEN_MAX_ALIGN_BYTES==0, AlignedMax==Unaligned, and many compilers generate warnings for friend-ing a class twice. + friend class Eigen::Map; + friend class Eigen::Map; +#endif +}; + +namespace internal { + +template +struct conservative_resize_like_impl +{ + static constexpr bool IsRelocatable = std::is_trivially_copyable::value; + static void run(DenseBase& _this, Index rows, Index cols) + { + if (_this.rows() == rows && _this.cols() == cols) return; + EIGEN_STATIC_ASSERT_DYNAMIC_SIZE(Derived) + + if ( IsRelocatable + && (( Derived::IsRowMajor && _this.cols() == cols) || // row-major and we change only the number of rows + (!Derived::IsRowMajor && _this.rows() == rows) )) // column-major and we change only the number of columns + { + internal::check_rows_cols_for_overflow::run(rows, cols); + _this.derived().m_storage.conservativeResize(rows*cols,rows,cols); + } + else + { + // The storage order does not allow us to use reallocation. + Derived tmp(rows,cols); + const Index common_rows = numext::mini(rows, _this.rows()); + const Index common_cols = numext::mini(cols, _this.cols()); + tmp.block(0,0,common_rows,common_cols) = _this.block(0,0,common_rows,common_cols); + _this.derived().swap(tmp); + } + } + + static void run(DenseBase& _this, const DenseBase& other) + { + if (_this.rows() == other.rows() && _this.cols() == other.cols()) return; + + // Note: Here is space for improvement. Basically, for conservativeResize(Index,Index), + // neither RowsAtCompileTime or ColsAtCompileTime must be Dynamic. If only one of the + // dimensions is dynamic, one could use either conservativeResize(Index rows, NoChange_t) or + // conservativeResize(NoChange_t, Index cols). For these methods new static asserts like + // EIGEN_STATIC_ASSERT_DYNAMIC_ROWS and EIGEN_STATIC_ASSERT_DYNAMIC_COLS would be good. + EIGEN_STATIC_ASSERT_DYNAMIC_SIZE(Derived) + EIGEN_STATIC_ASSERT_DYNAMIC_SIZE(OtherDerived) + + if ( IsRelocatable && + (( Derived::IsRowMajor && _this.cols() == other.cols()) || // row-major and we change only the number of rows + (!Derived::IsRowMajor && _this.rows() == other.rows()) )) // column-major and we change only the number of columns + { + const Index new_rows = other.rows() - _this.rows(); + const Index new_cols = other.cols() - _this.cols(); + _this.derived().m_storage.conservativeResize(other.size(),other.rows(),other.cols()); + if (new_rows>0) + _this.bottomRightCorner(new_rows, other.cols()) = other.bottomRows(new_rows); + else if (new_cols>0) + _this.bottomRightCorner(other.rows(), new_cols) = other.rightCols(new_cols); + } + else + { + // The storage order does not allow us to use reallocation. + Derived tmp(other); + const Index common_rows = numext::mini(tmp.rows(), _this.rows()); + const Index common_cols = numext::mini(tmp.cols(), _this.cols()); + tmp.block(0,0,common_rows,common_cols) = _this.block(0,0,common_rows,common_cols); + _this.derived().swap(tmp); + } + } +}; + +// Here, the specialization for vectors inherits from the general matrix case +// to allow calling .conservativeResize(rows,cols) on vectors. +template +struct conservative_resize_like_impl + : conservative_resize_like_impl +{ + typedef conservative_resize_like_impl Base; + using Base::run; + using Base::IsRelocatable; + + static void run(DenseBase& _this, Index size) + { + const Index new_rows = Derived::RowsAtCompileTime==1 ? 1 : size; + const Index new_cols = Derived::RowsAtCompileTime==1 ? size : 1; + if(IsRelocatable) + _this.derived().m_storage.conservativeResize(size,new_rows,new_cols); + else + Base::run(_this.derived(), new_rows, new_cols); + } + + static void run(DenseBase& _this, const DenseBase& other) + { + if (_this.rows() == other.rows() && _this.cols() == other.cols()) return; + + const Index num_new_elements = other.size() - _this.size(); + + const Index new_rows = Derived::RowsAtCompileTime==1 ? 1 : other.rows(); + const Index new_cols = Derived::RowsAtCompileTime==1 ? other.cols() : 1; + if(IsRelocatable) + _this.derived().m_storage.conservativeResize(other.size(),new_rows,new_cols); + else + Base::run(_this.derived(), new_rows, new_cols); + + if (num_new_elements > 0) + _this.tail(num_new_elements) = other.tail(num_new_elements); + } +}; + +template +struct matrix_swap_impl +{ + EIGEN_DEVICE_FUNC + static EIGEN_STRONG_INLINE void run(MatrixTypeA& a, MatrixTypeB& b) + { + a.base().swap(b); + } +}; + +template +struct matrix_swap_impl +{ + EIGEN_DEVICE_FUNC + static inline void run(MatrixTypeA& a, MatrixTypeB& b) + { + static_cast(a).m_storage.swap(static_cast(b).m_storage); + } +}; + +} // end namespace internal + +} // end namespace Eigen + +#endif // EIGEN_DENSESTORAGEBASE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Product.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Product.h new file mode 100644 index 0000000000000000000000000000000000000000..85842d1a5cfd6550f8fdd122cad1b8ce34c6705e --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Product.h @@ -0,0 +1,193 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008-2011 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_PRODUCT_H +#define EIGEN_PRODUCT_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +template class ProductImpl; + +namespace internal { + +template +struct traits > +{ + typedef remove_all_t LhsCleaned; + typedef remove_all_t RhsCleaned; + typedef traits LhsTraits; + typedef traits RhsTraits; + + typedef MatrixXpr XprKind; + + typedef typename ScalarBinaryOpTraits::Scalar, typename traits::Scalar>::ReturnType Scalar; + typedef typename product_promote_storage_type::ret>::ret StorageKind; + typedef typename promote_index_type::type StorageIndex; + + enum { + RowsAtCompileTime = LhsTraits::RowsAtCompileTime, + ColsAtCompileTime = RhsTraits::ColsAtCompileTime, + MaxRowsAtCompileTime = LhsTraits::MaxRowsAtCompileTime, + MaxColsAtCompileTime = RhsTraits::MaxColsAtCompileTime, + + // FIXME: only needed by GeneralMatrixMatrixTriangular + InnerSize = min_size_prefer_fixed(LhsTraits::ColsAtCompileTime, RhsTraits::RowsAtCompileTime), + + // The storage order is somewhat arbitrary here. The correct one will be determined through the evaluator. + Flags = (MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1) ? RowMajorBit + : (MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1) ? 0 + : ( ((LhsTraits::Flags&NoPreferredStorageOrderBit) && (RhsTraits::Flags&RowMajorBit)) + || ((RhsTraits::Flags&NoPreferredStorageOrderBit) && (LhsTraits::Flags&RowMajorBit)) ) ? RowMajorBit + : NoPreferredStorageOrderBit + }; +}; + +} // end namespace internal + +/** \class Product + * \ingroup Core_Module + * + * \brief Expression of the product of two arbitrary matrices or vectors + * + * \tparam Lhs_ the type of the left-hand side expression + * \tparam Rhs_ the type of the right-hand side expression + * + * This class represents an expression of the product of two arbitrary matrices. + * + * The other template parameters are: + * \tparam Option can be DefaultProduct, AliasFreeProduct, or LazyProduct + * + */ +template +class Product : public ProductImpl::StorageKind, + typename internal::traits::StorageKind, + internal::product_type::ret>::ret> +{ + public: + + typedef Lhs_ Lhs; + typedef Rhs_ Rhs; + + typedef typename ProductImpl< + Lhs, Rhs, Option, + typename internal::product_promote_storage_type::StorageKind, + typename internal::traits::StorageKind, + internal::product_type::ret>::ret>::Base Base; + EIGEN_GENERIC_PUBLIC_INTERFACE(Product) + + typedef typename internal::ref_selector::type LhsNested; + typedef typename internal::ref_selector::type RhsNested; + typedef internal::remove_all_t LhsNestedCleaned; + typedef internal::remove_all_t RhsNestedCleaned; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Product(const Lhs& lhs, const Rhs& rhs) : m_lhs(lhs), m_rhs(rhs) + { + eigen_assert(lhs.cols() == rhs.rows() + && "invalid matrix product" + && "if you wanted a coeff-wise or a dot product use the respective explicit functions"); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR + Index rows() const EIGEN_NOEXCEPT { return m_lhs.rows(); } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR + Index cols() const EIGEN_NOEXCEPT { return m_rhs.cols(); } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + const LhsNestedCleaned& lhs() const { return m_lhs; } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + const RhsNestedCleaned& rhs() const { return m_rhs; } + + protected: + + LhsNested m_lhs; + RhsNested m_rhs; +}; + +namespace internal { + +template::ret> +class dense_product_base + : public internal::dense_xpr_base >::type +{}; + +/** Conversion to scalar for inner-products */ +template +class dense_product_base + : public internal::dense_xpr_base >::type +{ + typedef Product ProductXpr; + typedef typename internal::dense_xpr_base::type Base; +public: + using Base::derived; + typedef typename Base::Scalar Scalar; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE operator const Scalar() const + { + return internal::evaluator(derived()).coeff(0,0); + } +}; + +} // namespace internal + +// Generic API dispatcher +template +class ProductImpl : public internal::generic_xpr_base, MatrixXpr, StorageKind>::type +{ + public: + typedef typename internal::generic_xpr_base, MatrixXpr, StorageKind>::type Base; +}; + +template +class ProductImpl + : public internal::dense_product_base +{ + typedef Product Derived; + + public: + + typedef typename internal::dense_product_base Base; + EIGEN_DENSE_PUBLIC_INTERFACE(Derived) + protected: + enum { + IsOneByOne = (RowsAtCompileTime == 1 || RowsAtCompileTime == Dynamic) && + (ColsAtCompileTime == 1 || ColsAtCompileTime == Dynamic), + EnableCoeff = IsOneByOne || Option==LazyProduct + }; + + public: + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar coeff(Index row, Index col) const + { + EIGEN_STATIC_ASSERT(EnableCoeff, THIS_METHOD_IS_ONLY_FOR_INNER_OR_LAZY_PRODUCTS); + eigen_assert( (Option==LazyProduct) || (this->rows() == 1 && this->cols() == 1) ); + + return internal::evaluator(derived()).coeff(row,col); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar coeff(Index i) const + { + EIGEN_STATIC_ASSERT(EnableCoeff, THIS_METHOD_IS_ONLY_FOR_INNER_OR_LAZY_PRODUCTS); + eigen_assert( (Option==LazyProduct) || (this->rows() == 1 && this->cols() == 1) ); + + return internal::evaluator(derived()).coeff(i); + } + + +}; + +} // end namespace Eigen + +#endif // EIGEN_PRODUCT_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/ProductEvaluators.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/ProductEvaluators.h new file mode 100644 index 0000000000000000000000000000000000000000..9da240671409f88d11a2584dc9831e2441f2c913 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/ProductEvaluators.h @@ -0,0 +1,1215 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2006-2008 Benoit Jacob +// Copyright (C) 2008-2010 Gael Guennebaud +// Copyright (C) 2011 Jitse Niesen +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +#ifndef EIGEN_PRODUCTEVALUATORS_H +#define EIGEN_PRODUCTEVALUATORS_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { + +/** \internal + * Evaluator of a product expression. + * Since products require special treatments to handle all possible cases, + * we simply defer the evaluation logic to a product_evaluator class + * which offers more partial specialization possibilities. + * + * \sa class product_evaluator + */ +template +struct evaluator > + : public product_evaluator > +{ + typedef Product XprType; + typedef product_evaluator Base; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit evaluator(const XprType& xpr) : Base(xpr) {} +}; + +// Catch "scalar * ( A * B )" and transform it to "(A*scalar) * B" +// TODO we should apply that rule only if that's really helpful +template +struct evaluator_assume_aliasing, + const CwiseNullaryOp, Plain1>, + const Product > > +{ + static const bool value = true; +}; +template +struct evaluator, + const CwiseNullaryOp, Plain1>, + const Product > > + : public evaluator > +{ + typedef CwiseBinaryOp, + const CwiseNullaryOp, Plain1>, + const Product > XprType; + typedef evaluator > Base; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit evaluator(const XprType& xpr) + : Base(xpr.lhs().functor().m_other * xpr.rhs().lhs() * xpr.rhs().rhs()) + {} +}; + + +template +struct evaluator, DiagIndex> > + : public evaluator, DiagIndex> > +{ + typedef Diagonal, DiagIndex> XprType; + typedef evaluator, DiagIndex> > Base; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit evaluator(const XprType& xpr) + : Base(Diagonal, DiagIndex>( + Product(xpr.nestedExpression().lhs(), xpr.nestedExpression().rhs()), + xpr.index() )) + {} +}; + + +// Helper class to perform a matrix product with the destination at hand. +// Depending on the sizes of the factors, there are different evaluation strategies +// as controlled by internal::product_type. +template< typename Lhs, typename Rhs, + typename LhsShape = typename evaluator_traits::Shape, + typename RhsShape = typename evaluator_traits::Shape, + int ProductType = internal::product_type::value> +struct generic_product_impl; + +template +struct evaluator_assume_aliasing > { + static const bool value = true; +}; + +// This is the default evaluator implementation for products: +// It creates a temporary and call generic_product_impl +template +struct product_evaluator, ProductTag, LhsShape, RhsShape> + : public evaluator::PlainObject> +{ + typedef Product XprType; + typedef typename XprType::PlainObject PlainObject; + typedef evaluator Base; + enum { + Flags = Base::Flags | EvalBeforeNestingBit + }; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit product_evaluator(const XprType& xpr) + : m_result(xpr.rows(), xpr.cols()) + { + internal::construct_at(this, m_result); + +// FIXME shall we handle nested_eval here?, +// if so, then we must take care at removing the call to nested_eval in the specializations (e.g., in permutation_matrix_product, transposition_matrix_product, etc.) +// typedef typename internal::nested_eval::type LhsNested; +// typedef typename internal::nested_eval::type RhsNested; +// typedef internal::remove_all_t LhsNestedCleaned; +// typedef internal::remove_all_t RhsNestedCleaned; +// +// const LhsNested lhs(xpr.lhs()); +// const RhsNested rhs(xpr.rhs()); +// +// generic_product_impl::evalTo(m_result, lhs, rhs); + + generic_product_impl::evalTo(m_result, xpr.lhs(), xpr.rhs()); + } + +protected: + PlainObject m_result; +}; + +// The following three shortcuts are enabled only if the scalar types match exactly. +// TODO: we could enable them for different scalar types when the product is not vectorized. + +// Dense = Product +template< typename DstXprType, typename Lhs, typename Rhs, int Options, typename Scalar> +struct Assignment, internal::assign_op, Dense2Dense, + std::enable_if_t<(Options==DefaultProduct || Options==AliasFreeProduct)>> +{ + typedef Product SrcXprType; + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + void run(DstXprType &dst, const SrcXprType &src, const internal::assign_op &) + { + Index dstRows = src.rows(); + Index dstCols = src.cols(); + if((dst.rows()!=dstRows) || (dst.cols()!=dstCols)) + dst.resize(dstRows, dstCols); + // FIXME shall we handle nested_eval here? + generic_product_impl::evalTo(dst, src.lhs(), src.rhs()); + } +}; + +// Dense += Product +template< typename DstXprType, typename Lhs, typename Rhs, int Options, typename Scalar> +struct Assignment, internal::add_assign_op, Dense2Dense, + std::enable_if_t<(Options==DefaultProduct || Options==AliasFreeProduct)>> +{ + typedef Product SrcXprType; + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + void run(DstXprType &dst, const SrcXprType &src, const internal::add_assign_op &) + { + eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols()); + // FIXME shall we handle nested_eval here? + generic_product_impl::addTo(dst, src.lhs(), src.rhs()); + } +}; + +// Dense -= Product +template< typename DstXprType, typename Lhs, typename Rhs, int Options, typename Scalar> +struct Assignment, internal::sub_assign_op, Dense2Dense, + std::enable_if_t<(Options==DefaultProduct || Options==AliasFreeProduct)>> +{ + typedef Product SrcXprType; + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + void run(DstXprType &dst, const SrcXprType &src, const internal::sub_assign_op &) + { + eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols()); + // FIXME shall we handle nested_eval here? + generic_product_impl::subTo(dst, src.lhs(), src.rhs()); + } +}; + + +// Dense ?= scalar * Product +// TODO we should apply that rule if that's really helpful +// for instance, this is not good for inner products +template< typename DstXprType, typename Lhs, typename Rhs, typename AssignFunc, typename Scalar, typename ScalarBis, typename Plain> +struct Assignment, const CwiseNullaryOp,Plain>, + const Product >, AssignFunc, Dense2Dense> +{ + typedef CwiseBinaryOp, + const CwiseNullaryOp,Plain>, + const Product > SrcXprType; + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + void run(DstXprType &dst, const SrcXprType &src, const AssignFunc& func) + { + call_assignment_no_alias(dst, (src.lhs().functor().m_other * src.rhs().lhs())*src.rhs().rhs(), func); + } +}; + +//---------------------------------------- +// Catch "Dense ?= xpr + Product<>" expression to save one temporary +// FIXME we could probably enable these rules for any product, i.e., not only Dense and DefaultProduct + +template +struct evaluator_assume_aliasing::Scalar>, const OtherXpr, + const Product >, DenseShape > { + static const bool value = true; +}; + +template +struct evaluator_assume_aliasing::Scalar>, const OtherXpr, + const Product >, DenseShape > { + static const bool value = true; +}; + +template +struct assignment_from_xpr_op_product +{ + template + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + void run(DstXprType &dst, const SrcXprType &src, const InitialFunc& /*func*/) + { + call_assignment_no_alias(dst, src.lhs(), Func1()); + call_assignment_no_alias(dst, src.rhs(), Func2()); + } +}; + +#define EIGEN_CATCH_ASSIGN_XPR_OP_PRODUCT(ASSIGN_OP,BINOP,ASSIGN_OP2) \ + template< typename DstXprType, typename OtherXpr, typename Lhs, typename Rhs, typename DstScalar, typename SrcScalar, typename OtherScalar,typename ProdScalar> \ + struct Assignment, const OtherXpr, \ + const Product >, internal::ASSIGN_OP, Dense2Dense> \ + : assignment_from_xpr_op_product, internal::ASSIGN_OP, internal::ASSIGN_OP2 > \ + {} + +EIGEN_CATCH_ASSIGN_XPR_OP_PRODUCT(assign_op, scalar_sum_op,add_assign_op); +EIGEN_CATCH_ASSIGN_XPR_OP_PRODUCT(add_assign_op,scalar_sum_op,add_assign_op); +EIGEN_CATCH_ASSIGN_XPR_OP_PRODUCT(sub_assign_op,scalar_sum_op,sub_assign_op); + +EIGEN_CATCH_ASSIGN_XPR_OP_PRODUCT(assign_op, scalar_difference_op,sub_assign_op); +EIGEN_CATCH_ASSIGN_XPR_OP_PRODUCT(add_assign_op,scalar_difference_op,sub_assign_op); +EIGEN_CATCH_ASSIGN_XPR_OP_PRODUCT(sub_assign_op,scalar_difference_op,add_assign_op); + +//---------------------------------------- + +template +struct generic_product_impl +{ + template + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void evalTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) + { + dst.coeffRef(0,0) = (lhs.transpose().cwiseProduct(rhs)).sum(); + } + + template + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void addTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) + { + dst.coeffRef(0,0) += (lhs.transpose().cwiseProduct(rhs)).sum(); + } + + template + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void subTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) + { dst.coeffRef(0,0) -= (lhs.transpose().cwiseProduct(rhs)).sum(); } +}; + + +/*********************************************************************** +* Implementation of outer dense * dense vector product +***********************************************************************/ + +// Column major result +template +void EIGEN_DEVICE_FUNC outer_product_selector_run(Dst& dst, const Lhs &lhs, const Rhs &rhs, const Func& func, const false_type&) +{ + evaluator rhsEval(rhs); + ei_declare_local_nested_eval(Lhs,lhs,Rhs::SizeAtCompileTime,actual_lhs); + // FIXME if cols is large enough, then it might be useful to make sure that lhs is sequentially stored + // FIXME not very good if rhs is real and lhs complex while alpha is real too + const Index cols = dst.cols(); + for (Index j=0; j +void EIGEN_DEVICE_FUNC outer_product_selector_run(Dst& dst, const Lhs &lhs, const Rhs &rhs, const Func& func, const true_type&) +{ + evaluator lhsEval(lhs); + ei_declare_local_nested_eval(Rhs,rhs,Lhs::SizeAtCompileTime,actual_rhs); + // FIXME if rows is large enough, then it might be useful to make sure that rhs is sequentially stored + // FIXME not very good if lhs is real and rhs complex while alpha is real too + const Index rows = dst.rows(); + for (Index i=0; i +struct generic_product_impl +{ + template struct is_row_major : std::conditional_t<(int(T::Flags)&RowMajorBit), internal::true_type, internal::false_type> {}; + typedef typename Product::Scalar Scalar; + + // TODO it would be nice to be able to exploit our *_assign_op functors for that purpose + struct set { template EIGEN_DEVICE_FUNC void operator()(const Dst& dst, const Src& src) const { dst.const_cast_derived() = src; } }; + struct add { template EIGEN_DEVICE_FUNC void operator()(const Dst& dst, const Src& src) const { dst.const_cast_derived() += src; } }; + struct sub { template EIGEN_DEVICE_FUNC void operator()(const Dst& dst, const Src& src) const { dst.const_cast_derived() -= src; } }; + struct adds { + Scalar m_scale; + explicit adds(const Scalar& s) : m_scale(s) {} + template void EIGEN_DEVICE_FUNC operator()(const Dst& dst, const Src& src) const { + dst.const_cast_derived() += m_scale * src; + } + }; + + template + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void evalTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) + { + internal::outer_product_selector_run(dst, lhs, rhs, set(), is_row_major()); + } + + template + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void addTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) + { + internal::outer_product_selector_run(dst, lhs, rhs, add(), is_row_major()); + } + + template + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void subTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) + { + internal::outer_product_selector_run(dst, lhs, rhs, sub(), is_row_major()); + } + + template + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void scaleAndAddTo(Dst& dst, const Lhs& lhs, const Rhs& rhs, const Scalar& alpha) + { + internal::outer_product_selector_run(dst, lhs, rhs, adds(alpha), is_row_major()); + } + +}; + + +// This base class provides default implementations for evalTo, addTo, subTo, in terms of scaleAndAddTo +template +struct generic_product_impl_base +{ + typedef typename Product::Scalar Scalar; + + template + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void evalTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) + { dst.setZero(); scaleAndAddTo(dst, lhs, rhs, Scalar(1)); } + + template + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void addTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) + { scaleAndAddTo(dst,lhs, rhs, Scalar(1)); } + + template + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void subTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) + { scaleAndAddTo(dst, lhs, rhs, Scalar(-1)); } + + template + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void scaleAndAddTo(Dst& dst, const Lhs& lhs, const Rhs& rhs, const Scalar& alpha) + { Derived::scaleAndAddTo(dst,lhs,rhs,alpha); } + +}; + +template +struct generic_product_impl + : generic_product_impl_base > +{ + typedef typename nested_eval::type LhsNested; + typedef typename nested_eval::type RhsNested; + typedef typename Product::Scalar Scalar; + enum { Side = Lhs::IsVectorAtCompileTime ? OnTheLeft : OnTheRight }; + typedef internal::remove_all_t> MatrixType; + + template + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void scaleAndAddTo(Dest& dst, const Lhs& lhs, const Rhs& rhs, const Scalar& alpha) + { + // Fallback to inner product if both the lhs and rhs is a runtime vector. + if (lhs.rows() == 1 && rhs.cols() == 1) { + dst.coeffRef(0,0) += alpha * lhs.row(0).conjugate().dot(rhs.col(0)); + return; + } + LhsNested actual_lhs(lhs); + RhsNested actual_rhs(rhs); + internal::gemv_dense_selector::HasUsableDirectAccess) + >::run(actual_lhs, actual_rhs, dst, alpha); + } +}; + +template +struct generic_product_impl +{ + typedef typename Product::Scalar Scalar; + + template + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void evalTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) + { + // Same as: dst.noalias() = lhs.lazyProduct(rhs); + // but easier on the compiler side + call_assignment_no_alias(dst, lhs.lazyProduct(rhs), internal::assign_op()); + } + + template + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void addTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) + { + // dst.noalias() += lhs.lazyProduct(rhs); + call_assignment_no_alias(dst, lhs.lazyProduct(rhs), internal::add_assign_op()); + } + + template + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void subTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) + { + // dst.noalias() -= lhs.lazyProduct(rhs); + call_assignment_no_alias(dst, lhs.lazyProduct(rhs), internal::sub_assign_op()); + } + + // This is a special evaluation path called from generic_product_impl<...,GemmProduct> in file GeneralMatrixMatrix.h + // This variant tries to extract scalar multiples from both the LHS and RHS and factor them out. For instance: + // dst {,+,-}= (s1*A)*(B*s2) + // will be rewritten as: + // dst {,+,-}= (s1*s2) * (A.lazyProduct(B)) + // There are at least four benefits of doing so: + // 1 - huge performance gain for heap-allocated matrix types as it save costly allocations. + // 2 - it is faster than simply by-passing the heap allocation through stack allocation. + // 3 - it makes this fallback consistent with the heavy GEMM routine. + // 4 - it fully by-passes huge stack allocation attempts when multiplying huge fixed-size matrices. + // (see https://stackoverflow.com/questions/54738495) + // For small fixed sizes matrices, however, the gains are less obvious, it is sometimes x2 faster, but sometimes x3 slower, + // and the behavior depends also a lot on the compiler... This is why this re-writing strategy is currently + // enabled only when falling back from the main GEMM. + template + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + void eval_dynamic(Dst& dst, const Lhs& lhs, const Rhs& rhs, const Func &func) + { + enum { + HasScalarFactor = blas_traits::HasScalarFactor || blas_traits::HasScalarFactor, + ConjLhs = blas_traits::NeedToConjugate, + ConjRhs = blas_traits::NeedToConjugate + }; + // FIXME: in c++11 this should be auto, and extractScalarFactor should also return auto + // this is important for real*complex_mat + Scalar actualAlpha = combine_scalar_factors(lhs, rhs); + + eval_dynamic_impl(dst, + blas_traits::extract(lhs).template conjugateIf(), + blas_traits::extract(rhs).template conjugateIf(), + func, + actualAlpha, + std::conditional_t()); + } + +protected: + + template + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + void eval_dynamic_impl(Dst& dst, const LhsT& lhs, const RhsT& rhs, const Func &func, const Scalar& s /* == 1 */, false_type) + { + EIGEN_UNUSED_VARIABLE(s); + eigen_internal_assert(numext::is_exactly_one(s)); + call_restricted_packet_assignment_no_alias(dst, lhs.lazyProduct(rhs), func); + } + + template + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + void eval_dynamic_impl(Dst& dst, const LhsT& lhs, const RhsT& rhs, const Func &func, const Scalar& s, true_type) + { + call_restricted_packet_assignment_no_alias(dst, s * lhs.lazyProduct(rhs), func); + } +}; + +// This specialization enforces the use of a coefficient-based evaluation strategy +template +struct generic_product_impl + : generic_product_impl {}; + +// Case 2: Evaluate coeff by coeff +// +// This is mostly taken from CoeffBasedProduct.h +// The main difference is that we add an extra argument to the etor_product_*_impl::run() function +// for the inner dimension of the product, because evaluator object do not know their size. + +template +struct etor_product_coeff_impl; + +template +struct etor_product_packet_impl; + +template +struct product_evaluator, ProductTag, DenseShape, DenseShape> + : evaluator_base > +{ + typedef Product XprType; + typedef typename XprType::Scalar Scalar; + typedef typename XprType::CoeffReturnType CoeffReturnType; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit product_evaluator(const XprType& xpr) + : m_lhs(xpr.lhs()), + m_rhs(xpr.rhs()), + m_lhsImpl(m_lhs), // FIXME the creation of the evaluator objects should result in a no-op, but check that! + m_rhsImpl(m_rhs), // Moreover, they are only useful for the packet path, so we could completely disable them when not needed, + // or perhaps declare them on the fly on the packet method... We have experiment to check what's best. + m_innerDim(xpr.lhs().cols()) + { + EIGEN_INTERNAL_CHECK_COST_VALUE(NumTraits::MulCost); + EIGEN_INTERNAL_CHECK_COST_VALUE(NumTraits::AddCost); + EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); +#if 0 + std::cerr << "LhsOuterStrideBytes= " << LhsOuterStrideBytes << "\n"; + std::cerr << "RhsOuterStrideBytes= " << RhsOuterStrideBytes << "\n"; + std::cerr << "LhsAlignment= " << LhsAlignment << "\n"; + std::cerr << "RhsAlignment= " << RhsAlignment << "\n"; + std::cerr << "CanVectorizeLhs= " << CanVectorizeLhs << "\n"; + std::cerr << "CanVectorizeRhs= " << CanVectorizeRhs << "\n"; + std::cerr << "CanVectorizeInner= " << CanVectorizeInner << "\n"; + std::cerr << "EvalToRowMajor= " << EvalToRowMajor << "\n"; + std::cerr << "Alignment= " << Alignment << "\n"; + std::cerr << "Flags= " << Flags << "\n"; +#endif + } + + // Everything below here is taken from CoeffBasedProduct.h + + typedef typename internal::nested_eval::type LhsNested; + typedef typename internal::nested_eval::type RhsNested; + + typedef internal::remove_all_t LhsNestedCleaned; + typedef internal::remove_all_t RhsNestedCleaned; + + typedef evaluator LhsEtorType; + typedef evaluator RhsEtorType; + + enum { + RowsAtCompileTime = LhsNestedCleaned::RowsAtCompileTime, + ColsAtCompileTime = RhsNestedCleaned::ColsAtCompileTime, + InnerSize = min_size_prefer_fixed(LhsNestedCleaned::ColsAtCompileTime, RhsNestedCleaned::RowsAtCompileTime), + MaxRowsAtCompileTime = LhsNestedCleaned::MaxRowsAtCompileTime, + MaxColsAtCompileTime = RhsNestedCleaned::MaxColsAtCompileTime + }; + + typedef typename find_best_packet::type LhsVecPacketType; + typedef typename find_best_packet::type RhsVecPacketType; + + enum { + + LhsCoeffReadCost = LhsEtorType::CoeffReadCost, + RhsCoeffReadCost = RhsEtorType::CoeffReadCost, + CoeffReadCost = InnerSize==0 ? NumTraits::ReadCost + : InnerSize == Dynamic ? HugeCost + : InnerSize * (NumTraits::MulCost + int(LhsCoeffReadCost) + int(RhsCoeffReadCost)) + + (InnerSize - 1) * NumTraits::AddCost, + + Unroll = CoeffReadCost <= EIGEN_UNROLLING_LIMIT, + + LhsFlags = LhsEtorType::Flags, + RhsFlags = RhsEtorType::Flags, + + LhsRowMajor = LhsFlags & RowMajorBit, + RhsRowMajor = RhsFlags & RowMajorBit, + + LhsVecPacketSize = unpacket_traits::size, + RhsVecPacketSize = unpacket_traits::size, + + // Here, we don't care about alignment larger than the usable packet size. + LhsAlignment = plain_enum_min(LhsEtorType::Alignment, LhsVecPacketSize*int(sizeof(typename LhsNestedCleaned::Scalar))), + RhsAlignment = plain_enum_min(RhsEtorType::Alignment, RhsVecPacketSize*int(sizeof(typename RhsNestedCleaned::Scalar))), + + SameType = is_same::value, + + CanVectorizeRhs = bool(RhsRowMajor) && (RhsFlags & PacketAccessBit) && (ColsAtCompileTime!=1), + CanVectorizeLhs = (!LhsRowMajor) && (LhsFlags & PacketAccessBit) && (RowsAtCompileTime!=1), + + EvalToRowMajor = (MaxRowsAtCompileTime==1&&MaxColsAtCompileTime!=1) ? 1 + : (MaxColsAtCompileTime==1&&MaxRowsAtCompileTime!=1) ? 0 + : (bool(RhsRowMajor) && !CanVectorizeLhs), + + Flags = ((int(LhsFlags) | int(RhsFlags)) & HereditaryBits & ~RowMajorBit) + | (EvalToRowMajor ? RowMajorBit : 0) + // TODO enable vectorization for mixed types + | (SameType && (CanVectorizeLhs || CanVectorizeRhs) ? PacketAccessBit : 0) + | (XprType::IsVectorAtCompileTime ? LinearAccessBit : 0), + + LhsOuterStrideBytes = int(LhsNestedCleaned::OuterStrideAtCompileTime) * int(sizeof(typename LhsNestedCleaned::Scalar)), + RhsOuterStrideBytes = int(RhsNestedCleaned::OuterStrideAtCompileTime) * int(sizeof(typename RhsNestedCleaned::Scalar)), + + Alignment = bool(CanVectorizeLhs) ? (LhsOuterStrideBytes<=0 || (int(LhsOuterStrideBytes) % plain_enum_max(1, LhsAlignment))!=0 ? 0 : LhsAlignment) + : bool(CanVectorizeRhs) ? (RhsOuterStrideBytes<=0 || (int(RhsOuterStrideBytes) % plain_enum_max(1, RhsAlignment))!=0 ? 0 : RhsAlignment) + : 0, + + /* CanVectorizeInner deserves special explanation. It does not affect the product flags. It is not used outside + * of Product. If the Product itself is not a packet-access expression, there is still a chance that the inner + * loop of the product might be vectorized. This is the meaning of CanVectorizeInner. Since it doesn't affect + * the Flags, it is safe to make this value depend on ActualPacketAccessBit, that doesn't affect the ABI. + */ + CanVectorizeInner = SameType + && LhsRowMajor + && (!RhsRowMajor) + && (int(LhsFlags) & int(RhsFlags) & ActualPacketAccessBit) + && (int(InnerSize) % packet_traits::size == 0) + }; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CoeffReturnType coeff(Index row, Index col) const + { + return (m_lhs.row(row).transpose().cwiseProduct( m_rhs.col(col) )).sum(); + } + + /* Allow index-based non-packet access. It is impossible though to allow index-based packed access, + * which is why we don't set the LinearAccessBit. + * TODO: this seems possible when the result is a vector + */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + const CoeffReturnType coeff(Index index) const + { + const Index row = (RowsAtCompileTime == 1 || MaxRowsAtCompileTime==1) ? 0 : index; + const Index col = (RowsAtCompileTime == 1 || MaxRowsAtCompileTime==1) ? index : 0; + return (m_lhs.row(row).transpose().cwiseProduct( m_rhs.col(col) )).sum(); + } + + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + const PacketType packet(Index row, Index col) const + { + PacketType res; + typedef etor_product_packet_impl PacketImpl; + PacketImpl::run(row, col, m_lhsImpl, m_rhsImpl, m_innerDim, res); + return res; + } + + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + const PacketType packet(Index index) const + { + const Index row = (RowsAtCompileTime == 1 || MaxRowsAtCompileTime==1) ? 0 : index; + const Index col = (RowsAtCompileTime == 1 || MaxRowsAtCompileTime==1) ? index : 0; + return packet(row,col); + } + +protected: + add_const_on_value_type_t m_lhs; + add_const_on_value_type_t m_rhs; + + LhsEtorType m_lhsImpl; + RhsEtorType m_rhsImpl; + + // TODO: Get rid of m_innerDim if known at compile time + Index m_innerDim; +}; + +template +struct product_evaluator, LazyCoeffBasedProductMode, DenseShape, DenseShape> + : product_evaluator, CoeffBasedProductMode, DenseShape, DenseShape> +{ + typedef Product XprType; + typedef Product BaseProduct; + typedef product_evaluator Base; + enum { + Flags = Base::Flags | EvalBeforeNestingBit + }; + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit product_evaluator(const XprType& xpr) + : Base(BaseProduct(xpr.lhs(),xpr.rhs())) + {} +}; + +/**************************************** +*** Coeff based product, Packet path *** +****************************************/ + +template +struct etor_product_packet_impl +{ + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Index row, Index col, const Lhs& lhs, const Rhs& rhs, Index innerDim, Packet &res) + { + etor_product_packet_impl::run(row, col, lhs, rhs, innerDim, res); + res = pmadd(pset1(lhs.coeff(row, Index(UnrollingIndex-1))), rhs.template packet(Index(UnrollingIndex-1), col), res); + } +}; + +template +struct etor_product_packet_impl +{ + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Index row, Index col, const Lhs& lhs, const Rhs& rhs, Index innerDim, Packet &res) + { + etor_product_packet_impl::run(row, col, lhs, rhs, innerDim, res); + res = pmadd(lhs.template packet(row, Index(UnrollingIndex-1)), pset1(rhs.coeff(Index(UnrollingIndex-1), col)), res); + } +}; + +template +struct etor_product_packet_impl +{ + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Index row, Index col, const Lhs& lhs, const Rhs& rhs, Index /*innerDim*/, Packet &res) + { + res = pmul(pset1(lhs.coeff(row, Index(0))),rhs.template packet(Index(0), col)); + } +}; + +template +struct etor_product_packet_impl +{ + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Index row, Index col, const Lhs& lhs, const Rhs& rhs, Index /*innerDim*/, Packet &res) + { + res = pmul(lhs.template packet(row, Index(0)), pset1(rhs.coeff(Index(0), col))); + } +}; + +template +struct etor_product_packet_impl +{ + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Index /*row*/, Index /*col*/, const Lhs& /*lhs*/, const Rhs& /*rhs*/, Index /*innerDim*/, Packet &res) + { + res = pset1(typename unpacket_traits::type(0)); + } +}; + +template +struct etor_product_packet_impl +{ + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Index /*row*/, Index /*col*/, const Lhs& /*lhs*/, const Rhs& /*rhs*/, Index /*innerDim*/, Packet &res) + { + res = pset1(typename unpacket_traits::type(0)); + } +}; + +template +struct etor_product_packet_impl +{ + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Index row, Index col, const Lhs& lhs, const Rhs& rhs, Index innerDim, Packet& res) + { + res = pset1(typename unpacket_traits::type(0)); + for(Index i = 0; i < innerDim; ++i) + res = pmadd(pset1(lhs.coeff(row, i)), rhs.template packet(i, col), res); + } +}; + +template +struct etor_product_packet_impl +{ + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Index row, Index col, const Lhs& lhs, const Rhs& rhs, Index innerDim, Packet& res) + { + res = pset1(typename unpacket_traits::type(0)); + for(Index i = 0; i < innerDim; ++i) + res = pmadd(lhs.template packet(row, i), pset1(rhs.coeff(i, col)), res); + } +}; + + +/*************************************************************************** +* Triangular products +***************************************************************************/ +template +struct triangular_product_impl; + +template +struct generic_product_impl + : generic_product_impl_base > +{ + typedef typename Product::Scalar Scalar; + + template + static void scaleAndAddTo(Dest& dst, const Lhs& lhs, const Rhs& rhs, const Scalar& alpha) + { + triangular_product_impl + ::run(dst, lhs.nestedExpression(), rhs, alpha); + } +}; + +template +struct generic_product_impl +: generic_product_impl_base > +{ + typedef typename Product::Scalar Scalar; + + template + static void scaleAndAddTo(Dest& dst, const Lhs& lhs, const Rhs& rhs, const Scalar& alpha) + { + triangular_product_impl::run(dst, lhs, rhs.nestedExpression(), alpha); + } +}; + + +/*************************************************************************** +* SelfAdjoint products +***************************************************************************/ +template +struct selfadjoint_product_impl; + +template +struct generic_product_impl + : generic_product_impl_base > +{ + typedef typename Product::Scalar Scalar; + + template + static EIGEN_DEVICE_FUNC + void scaleAndAddTo(Dest& dst, const Lhs& lhs, const Rhs& rhs, const Scalar& alpha) + { + selfadjoint_product_impl::run(dst, lhs.nestedExpression(), rhs, alpha); + } +}; + +template +struct generic_product_impl +: generic_product_impl_base > +{ + typedef typename Product::Scalar Scalar; + + template + static void scaleAndAddTo(Dest& dst, const Lhs& lhs, const Rhs& rhs, const Scalar& alpha) + { + selfadjoint_product_impl::run(dst, lhs, rhs.nestedExpression(), alpha); + } +}; + + +/*************************************************************************** +* Diagonal products +***************************************************************************/ + +template +struct diagonal_product_evaluator_base + : evaluator_base +{ + typedef typename ScalarBinaryOpTraits::ReturnType Scalar; +public: + enum { + CoeffReadCost = int(NumTraits::MulCost) + int(evaluator::CoeffReadCost) + int(evaluator::CoeffReadCost), + + MatrixFlags = evaluator::Flags, + DiagFlags = evaluator::Flags, + + StorageOrder_ = (Derived::MaxRowsAtCompileTime==1 && Derived::MaxColsAtCompileTime!=1) ? RowMajor + : (Derived::MaxColsAtCompileTime==1 && Derived::MaxRowsAtCompileTime!=1) ? ColMajor + : MatrixFlags & RowMajorBit ? RowMajor : ColMajor, + SameStorageOrder_ = StorageOrder_ == (MatrixFlags & RowMajorBit ? RowMajor : ColMajor), + + ScalarAccessOnDiag_ = !((int(StorageOrder_) == ColMajor && int(ProductOrder) == OnTheLeft) + ||(int(StorageOrder_) == RowMajor && int(ProductOrder) == OnTheRight)), + SameTypes_ = is_same::value, + // FIXME currently we need same types, but in the future the next rule should be the one + //Vectorizable_ = bool(int(MatrixFlags)&PacketAccessBit) && ((!_PacketOnDiag) || (SameTypes_ && bool(int(DiagFlags)&PacketAccessBit))), + Vectorizable_ = bool(int(MatrixFlags)&PacketAccessBit) + && SameTypes_ + && (SameStorageOrder_ || (MatrixFlags&LinearAccessBit)==LinearAccessBit) + && (ScalarAccessOnDiag_ || (bool(int(DiagFlags)&PacketAccessBit))), + LinearAccessMask_ = (MatrixType::RowsAtCompileTime==1 || MatrixType::ColsAtCompileTime==1) ? LinearAccessBit : 0, + Flags = ((HereditaryBits|LinearAccessMask_) & (unsigned int)(MatrixFlags)) | (Vectorizable_ ? PacketAccessBit : 0), + Alignment = evaluator::Alignment, + + AsScalarProduct = (DiagonalType::SizeAtCompileTime==1) + || (DiagonalType::SizeAtCompileTime==Dynamic && MatrixType::RowsAtCompileTime==1 && ProductOrder==OnTheLeft) + || (DiagonalType::SizeAtCompileTime==Dynamic && MatrixType::ColsAtCompileTime==1 && ProductOrder==OnTheRight) + }; + + EIGEN_DEVICE_FUNC diagonal_product_evaluator_base(const MatrixType &mat, const DiagonalType &diag) + : m_diagImpl(diag), m_matImpl(mat) + { + EIGEN_INTERNAL_CHECK_COST_VALUE(NumTraits::MulCost); + EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar coeff(Index idx) const + { + if(AsScalarProduct) + return m_diagImpl.coeff(0) * m_matImpl.coeff(idx); + else + return m_diagImpl.coeff(idx) * m_matImpl.coeff(idx); + } + +protected: + template + EIGEN_STRONG_INLINE PacketType packet_impl(Index row, Index col, Index id, internal::true_type) const + { + return internal::pmul(m_matImpl.template packet(row, col), + internal::pset1(m_diagImpl.coeff(id))); + } + + template + EIGEN_STRONG_INLINE PacketType packet_impl(Index row, Index col, Index id, internal::false_type) const + { + enum { + InnerSize = (MatrixType::Flags & RowMajorBit) ? MatrixType::ColsAtCompileTime : MatrixType::RowsAtCompileTime, + DiagonalPacketLoadMode = plain_enum_min(LoadMode,((InnerSize%16) == 0) ? int(Aligned16) : int(evaluator::Alignment)) // FIXME hardcoded 16!! + }; + return internal::pmul(m_matImpl.template packet(row, col), + m_diagImpl.template packet(id)); + } + + evaluator m_diagImpl; + evaluator m_matImpl; +}; + +// diagonal * dense +template +struct product_evaluator, ProductTag, DiagonalShape, DenseShape> + : diagonal_product_evaluator_base, OnTheLeft> +{ + typedef diagonal_product_evaluator_base, OnTheLeft> Base; + using Base::m_diagImpl; + using Base::m_matImpl; + using Base::coeff; + typedef typename Base::Scalar Scalar; + + typedef Product XprType; + typedef typename XprType::PlainObject PlainObject; + typedef typename Lhs::DiagonalVectorType DiagonalType; + + + enum { StorageOrder = Base::StorageOrder_ }; + + EIGEN_DEVICE_FUNC explicit product_evaluator(const XprType& xpr) + : Base(xpr.rhs(), xpr.lhs().diagonal()) + { + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar coeff(Index row, Index col) const + { + return m_diagImpl.coeff(row) * m_matImpl.coeff(row, col); + } + +#ifndef EIGEN_GPUCC + template + EIGEN_STRONG_INLINE PacketType packet(Index row, Index col) const + { + // FIXME: NVCC used to complain about the template keyword, but we have to check whether this is still the case. + // See also similar calls below. + return this->template packet_impl(row,col, row, + std::conditional_t()); + } + + template + EIGEN_STRONG_INLINE PacketType packet(Index idx) const + { + return packet(int(StorageOrder)==ColMajor?idx:0,int(StorageOrder)==ColMajor?0:idx); + } +#endif +}; + +// dense * diagonal +template +struct product_evaluator, ProductTag, DenseShape, DiagonalShape> + : diagonal_product_evaluator_base, OnTheRight> +{ + typedef diagonal_product_evaluator_base, OnTheRight> Base; + using Base::m_diagImpl; + using Base::m_matImpl; + using Base::coeff; + typedef typename Base::Scalar Scalar; + + typedef Product XprType; + typedef typename XprType::PlainObject PlainObject; + + enum { StorageOrder = Base::StorageOrder_ }; + + EIGEN_DEVICE_FUNC explicit product_evaluator(const XprType& xpr) + : Base(xpr.lhs(), xpr.rhs().diagonal()) + { + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar coeff(Index row, Index col) const + { + return m_matImpl.coeff(row, col) * m_diagImpl.coeff(col); + } + +#ifndef EIGEN_GPUCC + template + EIGEN_STRONG_INLINE PacketType packet(Index row, Index col) const + { + return this->template packet_impl(row,col, col, + std::conditional_t()); + } + + template + EIGEN_STRONG_INLINE PacketType packet(Index idx) const + { + return packet(int(StorageOrder)==ColMajor?idx:0,int(StorageOrder)==ColMajor?0:idx); + } +#endif +}; + +/*************************************************************************** +* Products with permutation matrices +***************************************************************************/ + +/** \internal + * \class permutation_matrix_product + * Internal helper class implementing the product between a permutation matrix and a matrix. + * This class is specialized for DenseShape below and for SparseShape in SparseCore/SparsePermutation.h + */ +template +struct permutation_matrix_product; + +template +struct permutation_matrix_product +{ + typedef typename nested_eval::type MatrixType; + typedef remove_all_t MatrixTypeCleaned; + + template + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Dest& dst, const PermutationType& perm, const ExpressionType& xpr) + { + MatrixType mat(xpr); + const Index n = Side==OnTheLeft ? mat.rows() : mat.cols(); + // FIXME we need an is_same for expression that is not sensitive to constness. For instance + // is_same_xpr, Block >::value should be true. + //if(is_same::value && extract_data(dst) == extract_data(mat)) + if(is_same_dense(dst, mat)) + { + // apply the permutation inplace + Matrix mask(perm.size()); + mask.fill(false); + Index r = 0; + while(r < perm.size()) + { + // search for the next seed + while(r=perm.size()) + break; + // we got one, let's follow it until we are back to the seed + Index k0 = r++; + Index kPrev = k0; + mask.coeffRef(k0) = true; + for(Index k=perm.indices().coeff(k0); k!=k0; k=perm.indices().coeff(k)) + { + Block(dst, k) + .swap(Block + (dst,((Side==OnTheLeft) ^ Transposed) ? k0 : kPrev)); + + mask.coeffRef(k) = true; + kPrev = k; + } + } + } + else + { + for(Index i = 0; i < n; ++i) + { + Block + (dst, ((Side==OnTheLeft) ^ Transposed) ? perm.indices().coeff(i) : i) + + = + + Block + (mat, ((Side==OnTheRight) ^ Transposed) ? perm.indices().coeff(i) : i); + } + } + } +}; + +template +struct generic_product_impl +{ + template + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void evalTo(Dest& dst, const Lhs& lhs, const Rhs& rhs) + { + permutation_matrix_product::run(dst, lhs, rhs); + } +}; + +template +struct generic_product_impl +{ + template + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void evalTo(Dest& dst, const Lhs& lhs, const Rhs& rhs) + { + permutation_matrix_product::run(dst, rhs, lhs); + } +}; + +template +struct generic_product_impl, Rhs, PermutationShape, MatrixShape, ProductTag> +{ + template + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void evalTo(Dest& dst, const Inverse& lhs, const Rhs& rhs) + { + permutation_matrix_product::run(dst, lhs.nestedExpression(), rhs); + } +}; + +template +struct generic_product_impl, MatrixShape, PermutationShape, ProductTag> +{ + template + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void evalTo(Dest& dst, const Lhs& lhs, const Inverse& rhs) + { + permutation_matrix_product::run(dst, rhs.nestedExpression(), lhs); + } +}; + + +/*************************************************************************** +* Products with transpositions matrices +***************************************************************************/ + +// FIXME could we unify Transpositions and Permutation into a single "shape"?? + +/** \internal + * \class transposition_matrix_product + * Internal helper class implementing the product between a permutation matrix and a matrix. + */ +template +struct transposition_matrix_product +{ + typedef typename nested_eval::type MatrixType; + typedef remove_all_t MatrixTypeCleaned; + + template + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Dest& dst, const TranspositionType& tr, const ExpressionType& xpr) + { + MatrixType mat(xpr); + typedef typename TranspositionType::StorageIndex StorageIndex; + const Index size = tr.size(); + StorageIndex j = 0; + + if(!is_same_dense(dst,mat)) + dst = mat; + + for(Index k=(Transposed?size-1:0) ; Transposed?k>=0:k +struct generic_product_impl +{ + template + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void evalTo(Dest& dst, const Lhs& lhs, const Rhs& rhs) + { + transposition_matrix_product::run(dst, lhs, rhs); + } +}; + +template +struct generic_product_impl +{ + template + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void evalTo(Dest& dst, const Lhs& lhs, const Rhs& rhs) + { + transposition_matrix_product::run(dst, rhs, lhs); + } +}; + + +template +struct generic_product_impl, Rhs, TranspositionsShape, MatrixShape, ProductTag> +{ + template + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void evalTo(Dest& dst, const Transpose& lhs, const Rhs& rhs) + { + transposition_matrix_product::run(dst, lhs.nestedExpression(), rhs); + } +}; + +template +struct generic_product_impl, MatrixShape, TranspositionsShape, ProductTag> +{ + template + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void evalTo(Dest& dst, const Lhs& lhs, const Transpose& rhs) + { + transposition_matrix_product::run(dst, rhs.nestedExpression(), lhs); + } +}; + +/*************************************************************************** +* skew symmetric products +* for now we just call the generic implementation +***************************************************************************/ +template +struct generic_product_impl +{ + template + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void evalTo(Dest& dst, const Lhs& lhs, const Rhs& rhs) + { + generic_product_impl::evalTo(dst, lhs, rhs); + } +}; + +template +struct generic_product_impl +{ + template + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void evalTo(Dest& dst, const Lhs& lhs, const Rhs& rhs) + { + generic_product_impl::evalTo(dst, lhs, rhs); + } +}; + +template +struct generic_product_impl +{ + template + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void evalTo(Dest& dst, const Lhs& lhs, const Rhs& rhs) + { + generic_product_impl::evalTo(dst, lhs, rhs); + } +}; + +} // end namespace internal + +} // end namespace Eigen + +#endif // EIGEN_PRODUCT_EVALUATORS_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Random.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Random.h new file mode 100644 index 0000000000000000000000000000000000000000..fab6889dca6de86af53db357a3d76eef52a4cc40 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Random.h @@ -0,0 +1,219 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_RANDOM_H +#define EIGEN_RANDOM_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { + +template struct scalar_random_op { + inline const Scalar operator() () const { return random(); } +}; + +template +struct functor_traits > +{ enum { Cost = 5 * NumTraits::MulCost, PacketAccess = false, IsRepeatable = false }; }; + +} // end namespace internal + +/** \returns a random matrix expression + * + * Numbers are uniformly spread through their whole definition range for integer types, + * and in the [-1:1] range for floating point scalar types. + * + * The parameters \a rows and \a cols are the number of rows and of columns of + * the returned matrix. Must be compatible with this MatrixBase type. + * + * \not_reentrant + * + * This variant is meant to be used for dynamic-size matrix types. For fixed-size types, + * it is redundant to pass \a rows and \a cols as arguments, so Random() should be used + * instead. + * + * + * Example: \include MatrixBase_random_int_int.cpp + * Output: \verbinclude MatrixBase_random_int_int.out + * + * This expression has the "evaluate before nesting" flag so that it will be evaluated into + * a temporary matrix whenever it is nested in a larger expression. This prevents unexpected + * behavior with expressions involving random matrices. + * + * See DenseBase::NullaryExpr(Index, const CustomNullaryOp&) for an example using C++11 random generators. + * + * \sa DenseBase::setRandom(), DenseBase::Random(Index), DenseBase::Random() + */ +template +inline const typename DenseBase::RandomReturnType +DenseBase::Random(Index rows, Index cols) +{ + return NullaryExpr(rows, cols, internal::scalar_random_op()); +} + +/** \returns a random vector expression + * + * Numbers are uniformly spread through their whole definition range for integer types, + * and in the [-1:1] range for floating point scalar types. + * + * The parameter \a size is the size of the returned vector. + * Must be compatible with this MatrixBase type. + * + * \only_for_vectors + * \not_reentrant + * + * This variant is meant to be used for dynamic-size vector types. For fixed-size types, + * it is redundant to pass \a size as argument, so Random() should be used + * instead. + * + * Example: \include MatrixBase_random_int.cpp + * Output: \verbinclude MatrixBase_random_int.out + * + * This expression has the "evaluate before nesting" flag so that it will be evaluated into + * a temporary vector whenever it is nested in a larger expression. This prevents unexpected + * behavior with expressions involving random matrices. + * + * \sa DenseBase::setRandom(), DenseBase::Random(Index,Index), DenseBase::Random() + */ +template +inline const typename DenseBase::RandomReturnType +DenseBase::Random(Index size) +{ + return NullaryExpr(size, internal::scalar_random_op()); +} + +/** \returns a fixed-size random matrix or vector expression + * + * Numbers are uniformly spread through their whole definition range for integer types, + * and in the [-1:1] range for floating point scalar types. + * + * This variant is only for fixed-size MatrixBase types. For dynamic-size types, you + * need to use the variants taking size arguments. + * + * Example: \include MatrixBase_random.cpp + * Output: \verbinclude MatrixBase_random.out + * + * This expression has the "evaluate before nesting" flag so that it will be evaluated into + * a temporary matrix whenever it is nested in a larger expression. This prevents unexpected + * behavior with expressions involving random matrices. + * + * \not_reentrant + * + * \sa DenseBase::setRandom(), DenseBase::Random(Index,Index), DenseBase::Random(Index) + */ +template +inline const typename DenseBase::RandomReturnType +DenseBase::Random() +{ + return NullaryExpr(RowsAtCompileTime, ColsAtCompileTime, internal::scalar_random_op()); +} + +/** Sets all coefficients in this expression to random values. + * + * Numbers are uniformly spread through their whole definition range for integer types, + * and in the [-1:1] range for floating point scalar types. + * + * \not_reentrant + * + * Example: \include MatrixBase_setRandom.cpp + * Output: \verbinclude MatrixBase_setRandom.out + * + * \sa class CwiseNullaryOp, setRandom(Index), setRandom(Index,Index) + */ +template +EIGEN_DEVICE_FUNC inline Derived& DenseBase::setRandom() +{ + return *this = Random(rows(), cols()); +} + +/** Resizes to the given \a newSize, and sets all coefficients in this expression to random values. + * + * Numbers are uniformly spread through their whole definition range for integer types, + * and in the [-1:1] range for floating point scalar types. + * + * \only_for_vectors + * \not_reentrant + * + * Example: \include Matrix_setRandom_int.cpp + * Output: \verbinclude Matrix_setRandom_int.out + * + * \sa DenseBase::setRandom(), setRandom(Index,Index), class CwiseNullaryOp, DenseBase::Random() + */ +template +EIGEN_STRONG_INLINE Derived& +PlainObjectBase::setRandom(Index newSize) +{ + resize(newSize); + return setRandom(); +} + +/** Resizes to the given size, and sets all coefficients in this expression to random values. + * + * Numbers are uniformly spread through their whole definition range for integer types, + * and in the [-1:1] range for floating point scalar types. + * + * \not_reentrant + * + * \param rows the new number of rows + * \param cols the new number of columns + * + * Example: \include Matrix_setRandom_int_int.cpp + * Output: \verbinclude Matrix_setRandom_int_int.out + * + * \sa DenseBase::setRandom(), setRandom(Index), class CwiseNullaryOp, DenseBase::Random() + */ +template +EIGEN_STRONG_INLINE Derived& +PlainObjectBase::setRandom(Index rows, Index cols) +{ + resize(rows, cols); + return setRandom(); +} + +/** Resizes to the given size, changing only the number of columns, and sets all + * coefficients in this expression to random values. For the parameter of type + * NoChange_t, just pass the special value \c NoChange. + * + * Numbers are uniformly spread through their whole definition range for integer types, + * and in the [-1:1] range for floating point scalar types. + * + * \not_reentrant + * + * \sa DenseBase::setRandom(), setRandom(Index), setRandom(Index, NoChange_t), class CwiseNullaryOp, DenseBase::Random() + */ +template +EIGEN_STRONG_INLINE Derived& +PlainObjectBase::setRandom(NoChange_t, Index cols) +{ + return setRandom(rows(), cols); +} + +/** Resizes to the given size, changing only the number of rows, and sets all + * coefficients in this expression to random values. For the parameter of type + * NoChange_t, just pass the special value \c NoChange. + * + * Numbers are uniformly spread through their whole definition range for integer types, + * and in the [-1:1] range for floating point scalar types. + * + * \not_reentrant + * + * \sa DenseBase::setRandom(), setRandom(Index), setRandom(NoChange_t, Index), class CwiseNullaryOp, DenseBase::Random() + */ +template +EIGEN_STRONG_INLINE Derived& +PlainObjectBase::setRandom(Index rows, NoChange_t) +{ + return setRandom(rows, cols()); +} + +} // end namespace Eigen + +#endif // EIGEN_RANDOM_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Redux.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Redux.h new file mode 100644 index 0000000000000000000000000000000000000000..8f5f761ac1c5572f111f3684ec26e39c88f824d6 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Redux.h @@ -0,0 +1,602 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008 Gael Guennebaud +// Copyright (C) 2006-2008 Benoit Jacob +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_REDUX_H +#define EIGEN_REDUX_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { + +// TODO +// * implement other kind of vectorization +// * factorize code + +/*************************************************************************** +* Part 1 : the logic deciding a strategy for vectorization and unrolling +***************************************************************************/ + +template +struct redux_traits +{ +public: + typedef typename find_best_packet::type PacketType; + enum { + PacketSize = unpacket_traits::size, + InnerMaxSize = int(Evaluator::IsRowMajor) + ? Evaluator::MaxColsAtCompileTime + : Evaluator::MaxRowsAtCompileTime, + OuterMaxSize = int(Evaluator::IsRowMajor) + ? Evaluator::MaxRowsAtCompileTime + : Evaluator::MaxColsAtCompileTime, + SliceVectorizedWork = int(InnerMaxSize)==Dynamic ? Dynamic + : int(OuterMaxSize)==Dynamic ? (int(InnerMaxSize)>=int(PacketSize) ? Dynamic : 0) + : (int(InnerMaxSize)/int(PacketSize)) * int(OuterMaxSize) + }; + + enum { + MayLinearize = (int(Evaluator::Flags) & LinearAccessBit), + MightVectorize = (int(Evaluator::Flags)&ActualPacketAccessBit) + && (functor_traits::PacketAccess), + MayLinearVectorize = bool(MightVectorize) && bool(MayLinearize), + MaySliceVectorize = bool(MightVectorize) && (int(SliceVectorizedWork)==Dynamic || int(SliceVectorizedWork)>=3) + }; + +public: + enum { + Traversal = int(MayLinearVectorize) ? int(LinearVectorizedTraversal) + : int(MaySliceVectorize) ? int(SliceVectorizedTraversal) + : int(MayLinearize) ? int(LinearTraversal) + : int(DefaultTraversal) + }; + +public: + enum { + Cost = Evaluator::SizeAtCompileTime == Dynamic ? HugeCost + : int(Evaluator::SizeAtCompileTime) * int(Evaluator::CoeffReadCost) + (Evaluator::SizeAtCompileTime-1) * functor_traits::Cost, + UnrollingLimit = EIGEN_UNROLLING_LIMIT * (int(Traversal) == int(DefaultTraversal) ? 1 : int(PacketSize)) + }; + +public: + enum { + Unrolling = Cost <= UnrollingLimit ? CompleteUnrolling : NoUnrolling + }; + +#ifdef EIGEN_DEBUG_ASSIGN + static void debug() + { + std::cerr << "Xpr: " << typeid(typename Evaluator::XprType).name() << std::endl; + std::cerr.setf(std::ios::hex, std::ios::basefield); + EIGEN_DEBUG_VAR(Evaluator::Flags) + std::cerr.unsetf(std::ios::hex); + EIGEN_DEBUG_VAR(InnerMaxSize) + EIGEN_DEBUG_VAR(OuterMaxSize) + EIGEN_DEBUG_VAR(SliceVectorizedWork) + EIGEN_DEBUG_VAR(PacketSize) + EIGEN_DEBUG_VAR(MightVectorize) + EIGEN_DEBUG_VAR(MayLinearVectorize) + EIGEN_DEBUG_VAR(MaySliceVectorize) + std::cerr << "Traversal" << " = " << Traversal << " (" << demangle_traversal(Traversal) << ")" << std::endl; + EIGEN_DEBUG_VAR(UnrollingLimit) + std::cerr << "Unrolling" << " = " << Unrolling << " (" << demangle_unrolling(Unrolling) << ")" << std::endl; + std::cerr << std::endl; + } +#endif +}; + +/*************************************************************************** +* Part 2 : unrollers +***************************************************************************/ + +/*** no vectorization ***/ + +template +struct redux_novec_unroller +{ + static constexpr Index HalfLength = Length/2; + + typedef typename Evaluator::Scalar Scalar; + + EIGEN_DEVICE_FUNC + static EIGEN_STRONG_INLINE Scalar run(const Evaluator &eval, const Func& func) + { + return func(redux_novec_unroller::run(eval,func), + redux_novec_unroller::run(eval,func)); + } +}; + +template +struct redux_novec_unroller +{ + static constexpr Index outer = Start / Evaluator::InnerSizeAtCompileTime; + static constexpr Index inner = Start % Evaluator::InnerSizeAtCompileTime; + + typedef typename Evaluator::Scalar Scalar; + + EIGEN_DEVICE_FUNC + static EIGEN_STRONG_INLINE Scalar run(const Evaluator &eval, const Func&) + { + return eval.coeffByOuterInner(outer, inner); + } +}; + +// This is actually dead code and will never be called. It is required +// to prevent false warnings regarding failed inlining though +// for 0 length run() will never be called at all. +template +struct redux_novec_unroller +{ + typedef typename Evaluator::Scalar Scalar; + EIGEN_DEVICE_FUNC + static EIGEN_STRONG_INLINE Scalar run(const Evaluator&, const Func&) { return Scalar(); } +}; + +template +struct redux_novec_linear_unroller +{ + static constexpr Index HalfLength = Length/2; + + typedef typename Evaluator::Scalar Scalar; + + EIGEN_DEVICE_FUNC + static EIGEN_STRONG_INLINE Scalar run(const Evaluator &eval, const Func& func) + { + return func(redux_novec_linear_unroller::run(eval,func), + redux_novec_linear_unroller::run(eval,func)); + } +}; + +template +struct redux_novec_linear_unroller +{ + typedef typename Evaluator::Scalar Scalar; + + EIGEN_DEVICE_FUNC + static EIGEN_STRONG_INLINE Scalar run(const Evaluator &eval, const Func&) + { + return eval.coeff(Start); + } +}; + +// This is actually dead code and will never be called. It is required +// to prevent false warnings regarding failed inlining though +// for 0 length run() will never be called at all. +template +struct redux_novec_linear_unroller +{ + typedef typename Evaluator::Scalar Scalar; + EIGEN_DEVICE_FUNC + static EIGEN_STRONG_INLINE Scalar run(const Evaluator&, const Func&) { return Scalar(); } +}; + +/*** vectorization ***/ + +template +struct redux_vec_unroller +{ + template + EIGEN_DEVICE_FUNC + static EIGEN_STRONG_INLINE PacketType run(const Evaluator &eval, const Func& func) + { + constexpr Index HalfLength = Length/2; + + return func.packetOp( + redux_vec_unroller::template run(eval,func), + redux_vec_unroller::template run(eval,func) ); + } +}; + +template +struct redux_vec_unroller +{ + template + EIGEN_DEVICE_FUNC + static EIGEN_STRONG_INLINE PacketType run(const Evaluator &eval, const Func&) + { + constexpr Index PacketSize = unpacket_traits::size; + constexpr Index index = Start * PacketSize; + constexpr Index outer = index / int(Evaluator::InnerSizeAtCompileTime); + constexpr Index inner = index % int(Evaluator::InnerSizeAtCompileTime); + constexpr int alignment = Evaluator::Alignment; + + return eval.template packetByOuterInner(outer, inner); + } +}; + +template +struct redux_vec_linear_unroller +{ + template + EIGEN_DEVICE_FUNC + static EIGEN_STRONG_INLINE PacketType run(const Evaluator &eval, const Func& func) + { + constexpr Index HalfLength = Length/2; + + return func.packetOp( + redux_vec_linear_unroller::template run(eval,func), + redux_vec_linear_unroller::template run(eval,func) ); + } +}; + +template +struct redux_vec_linear_unroller +{ + template + EIGEN_DEVICE_FUNC + static EIGEN_STRONG_INLINE PacketType run(const Evaluator &eval, const Func&) + { + constexpr Index PacketSize = unpacket_traits::size; + constexpr Index index = (Start * PacketSize); + constexpr int alignment = Evaluator::Alignment; + return eval.template packet(index); + } +}; + +/*************************************************************************** +* Part 3 : implementation of all cases +***************************************************************************/ + +template::Traversal, + int Unrolling = redux_traits::Unrolling +> +struct redux_impl; + +template +struct redux_impl +{ + typedef typename Evaluator::Scalar Scalar; + + template + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE + Scalar run(const Evaluator &eval, const Func& func, const XprType& xpr) + { + eigen_assert(xpr.rows()>0 && xpr.cols()>0 && "you are using an empty matrix"); + Scalar res = eval.coeffByOuterInner(0, 0); + for(Index i = 1; i < xpr.innerSize(); ++i) + res = func(res, eval.coeffByOuterInner(0, i)); + for(Index i = 1; i < xpr.outerSize(); ++i) + for(Index j = 0; j < xpr.innerSize(); ++j) + res = func(res, eval.coeffByOuterInner(i, j)); + return res; + } +}; + +template +struct redux_impl +{ + typedef typename Evaluator::Scalar Scalar; + + template + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE + Scalar run(const Evaluator &eval, const Func& func, const XprType& xpr) + { + eigen_assert(xpr.size()>0 && "you are using an empty matrix"); + Scalar res = eval.coeff(0); + for(Index k = 1; k < xpr.size(); ++k) + res = func(res, eval.coeff(k)); + return res; + } +}; + +template +struct redux_impl + : redux_novec_unroller +{ + typedef redux_novec_unroller Base; + typedef typename Evaluator::Scalar Scalar; + template + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE + Scalar run(const Evaluator &eval, const Func& func, const XprType& /*xpr*/) + { + return Base::run(eval,func); + } +}; + +template +struct redux_impl + : redux_novec_linear_unroller +{ + typedef redux_novec_linear_unroller Base; + typedef typename Evaluator::Scalar Scalar; + template + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE + Scalar run(const Evaluator &eval, const Func& func, const XprType& /*xpr*/) + { + return Base::run(eval,func); + } +}; + +template +struct redux_impl +{ + typedef typename Evaluator::Scalar Scalar; + typedef typename redux_traits::PacketType PacketScalar; + + template + static Scalar run(const Evaluator &eval, const Func& func, const XprType& xpr) + { + const Index size = xpr.size(); + + constexpr Index packetSize = redux_traits::PacketSize; + constexpr int packetAlignment = unpacket_traits::alignment; + constexpr int alignment0 = (bool(Evaluator::Flags & DirectAccessBit) && bool(packet_traits::AlignedOnScalar)) ? int(packetAlignment) : int(Unaligned); + constexpr int alignment = plain_enum_max(alignment0, Evaluator::Alignment); + const Index alignedStart = internal::first_default_aligned(xpr); + const Index alignedSize2 = ((size-alignedStart)/(2*packetSize))*(2*packetSize); + const Index alignedSize = ((size-alignedStart)/(packetSize))*(packetSize); + const Index alignedEnd2 = alignedStart + alignedSize2; + const Index alignedEnd = alignedStart + alignedSize; + Scalar res; + if(alignedSize) + { + PacketScalar packet_res0 = eval.template packet(alignedStart); + if(alignedSize>packetSize) // we have at least two packets to partly unroll the loop + { + PacketScalar packet_res1 = eval.template packet(alignedStart+packetSize); + for(Index index = alignedStart + 2*packetSize; index < alignedEnd2; index += 2*packetSize) + { + packet_res0 = func.packetOp(packet_res0, eval.template packet(index)); + packet_res1 = func.packetOp(packet_res1, eval.template packet(index+packetSize)); + } + + packet_res0 = func.packetOp(packet_res0,packet_res1); + if(alignedEnd>alignedEnd2) + packet_res0 = func.packetOp(packet_res0, eval.template packet(alignedEnd2)); + } + res = func.predux(packet_res0); + + for(Index index = 0; index < alignedStart; ++index) + res = func(res,eval.coeff(index)); + + for(Index index = alignedEnd; index < size; ++index) + res = func(res,eval.coeff(index)); + } + else // too small to vectorize anything. + // since this is dynamic-size hence inefficient anyway for such small sizes, don't try to optimize. + { + res = eval.coeff(0); + for(Index index = 1; index < size; ++index) + res = func(res,eval.coeff(index)); + } + + return res; + } +}; + +// NOTE: for SliceVectorizedTraversal we simply bypass unrolling +template +struct redux_impl +{ + typedef typename Evaluator::Scalar Scalar; + typedef typename redux_traits::PacketType PacketType; + + template + EIGEN_DEVICE_FUNC static Scalar run(const Evaluator &eval, const Func& func, const XprType& xpr) + { + eigen_assert(xpr.rows()>0 && xpr.cols()>0 && "you are using an empty matrix"); + constexpr Index packetSize = redux_traits::PacketSize; + const Index innerSize = xpr.innerSize(); + const Index outerSize = xpr.outerSize(); + const Index packetedInnerSize = ((innerSize)/packetSize)*packetSize; + Scalar res; + if(packetedInnerSize) + { + PacketType packet_res = eval.template packet(0,0); + for(Index j=0; j(j,i)); + + res = func.predux(packet_res); + for(Index j=0; j::run(eval, func, xpr); + } + + return res; + } +}; + +template +struct redux_impl +{ + typedef typename Evaluator::Scalar Scalar; + + typedef typename redux_traits::PacketType PacketType; + static constexpr Index PacketSize = redux_traits::PacketSize; + static constexpr Index Size = Evaluator::SizeAtCompileTime; + static constexpr Index VectorizedSize = (int(Size) / int(PacketSize)) * int(PacketSize); + + template + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE + Scalar run(const Evaluator &eval, const Func& func, const XprType &xpr) + { + EIGEN_ONLY_USED_FOR_DEBUG(xpr) + eigen_assert(xpr.rows()>0 && xpr.cols()>0 && "you are using an empty matrix"); + if (VectorizedSize > 0) { + Scalar res = func.predux(redux_vec_linear_unroller::template run(eval,func)); + if (VectorizedSize != Size) + res = func(res,redux_novec_linear_unroller::run(eval,func)); + return res; + } + else { + return redux_novec_linear_unroller::run(eval,func); + } + } +}; + +// evaluator adaptor +template +class redux_evaluator : public internal::evaluator +{ + typedef internal::evaluator Base; +public: + typedef XprType_ XprType; + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit redux_evaluator(const XprType &xpr) : Base(xpr) {} + + typedef typename XprType::Scalar Scalar; + typedef typename XprType::CoeffReturnType CoeffReturnType; + typedef typename XprType::PacketScalar PacketScalar; + + enum { + MaxRowsAtCompileTime = XprType::MaxRowsAtCompileTime, + MaxColsAtCompileTime = XprType::MaxColsAtCompileTime, + // TODO we should not remove DirectAccessBit and rather find an elegant way to query the alignment offset at runtime from the evaluator + Flags = Base::Flags & ~DirectAccessBit, + IsRowMajor = XprType::IsRowMajor, + SizeAtCompileTime = XprType::SizeAtCompileTime, + InnerSizeAtCompileTime = XprType::InnerSizeAtCompileTime + }; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeffByOuterInner(Index outer, Index inner) const + { return Base::coeff(IsRowMajor ? outer : inner, IsRowMajor ? inner : outer); } + + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + PacketType packetByOuterInner(Index outer, Index inner) const + { return Base::template packet(IsRowMajor ? outer : inner, IsRowMajor ? inner : outer); } + +}; + +} // end namespace internal + +/*************************************************************************** +* Part 4 : public API +***************************************************************************/ + + +/** \returns the result of a full redux operation on the whole matrix or vector using \a func + * + * The template parameter \a BinaryOp is the type of the functor \a func which must be + * an associative operator. Both current C++98 and C++11 functor styles are handled. + * + * \warning the matrix must be not empty, otherwise an assertion is triggered. + * + * \sa DenseBase::sum(), DenseBase::minCoeff(), DenseBase::maxCoeff(), MatrixBase::colwise(), MatrixBase::rowwise() + */ +template +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename internal::traits::Scalar +DenseBase::redux(const Func& func) const +{ + eigen_assert(this->rows()>0 && this->cols()>0 && "you are using an empty matrix"); + + typedef typename internal::redux_evaluator ThisEvaluator; + ThisEvaluator thisEval(derived()); + + // The initial expression is passed to the reducer as an additional argument instead of + // passing it as a member of redux_evaluator to help + return internal::redux_impl::run(thisEval, func, derived()); +} + +/** \returns the minimum of all coefficients of \c *this. + * In case \c *this contains NaN, NaNPropagation determines the behavior: + * NaNPropagation == PropagateFast : undefined + * NaNPropagation == PropagateNaN : result is NaN + * NaNPropagation == PropagateNumbers : result is minimum of elements that are not NaN + * \warning the matrix must be not empty, otherwise an assertion is triggered. + */ +template +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename internal::traits::Scalar +DenseBase::minCoeff() const +{ + return derived().redux(Eigen::internal::scalar_min_op()); +} + +/** \returns the maximum of all coefficients of \c *this. + * In case \c *this contains NaN, NaNPropagation determines the behavior: + * NaNPropagation == PropagateFast : undefined + * NaNPropagation == PropagateNaN : result is NaN + * NaNPropagation == PropagateNumbers : result is maximum of elements that are not NaN + * \warning the matrix must be not empty, otherwise an assertion is triggered. + */ +template +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename internal::traits::Scalar +DenseBase::maxCoeff() const +{ + return derived().redux(Eigen::internal::scalar_max_op()); +} + +/** \returns the sum of all coefficients of \c *this + * + * If \c *this is empty, then the value 0 is returned. + * + * \sa trace(), prod(), mean() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename internal::traits::Scalar +DenseBase::sum() const +{ + if(SizeAtCompileTime==0 || (SizeAtCompileTime==Dynamic && size()==0)) + return Scalar(0); + return derived().redux(Eigen::internal::scalar_sum_op()); +} + +/** \returns the mean of all coefficients of *this +* +* \sa trace(), prod(), sum() +*/ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename internal::traits::Scalar +DenseBase::mean() const +{ +#ifdef __INTEL_COMPILER + #pragma warning push + #pragma warning ( disable : 2259 ) +#endif + return Scalar(derived().redux(Eigen::internal::scalar_sum_op())) / Scalar(this->size()); +#ifdef __INTEL_COMPILER + #pragma warning pop +#endif +} + +/** \returns the product of all coefficients of *this + * + * Example: \include MatrixBase_prod.cpp + * Output: \verbinclude MatrixBase_prod.out + * + * \sa sum(), mean(), trace() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename internal::traits::Scalar +DenseBase::prod() const +{ + if(SizeAtCompileTime==0 || (SizeAtCompileTime==Dynamic && size()==0)) + return Scalar(1); + return derived().redux(Eigen::internal::scalar_product_op()); +} + +/** \returns the trace of \c *this, i.e. the sum of the coefficients on the main diagonal. + * + * \c *this can be any matrix, not necessarily square. + * + * \sa diagonal(), sum() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename internal::traits::Scalar +MatrixBase::trace() const +{ + return derived().diagonal().sum(); +} + +} // end namespace Eigen + +#endif // EIGEN_REDUX_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Ref.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Ref.h new file mode 100644 index 0000000000000000000000000000000000000000..32d51d2369b1869684a05d404ac4829cd5777060 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Ref.h @@ -0,0 +1,408 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2012 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_REF_H +#define EIGEN_REF_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { + +template +struct traits > + : public traits > +{ + typedef PlainObjectType_ PlainObjectType; + typedef StrideType_ StrideType; + enum { + Options = Options_, + Flags = traits >::Flags | NestByRefBit, + Alignment = traits >::Alignment + }; + + template struct match { + enum { + IsVectorAtCompileTime = PlainObjectType::IsVectorAtCompileTime || Derived::IsVectorAtCompileTime, + HasDirectAccess = internal::has_direct_access::ret, + StorageOrderMatch = IsVectorAtCompileTime || ((PlainObjectType::Flags&RowMajorBit)==(Derived::Flags&RowMajorBit)), + InnerStrideMatch = int(StrideType::InnerStrideAtCompileTime)==int(Dynamic) + || int(StrideType::InnerStrideAtCompileTime)==int(Derived::InnerStrideAtCompileTime) + || (int(StrideType::InnerStrideAtCompileTime)==0 && int(Derived::InnerStrideAtCompileTime)==1), + OuterStrideMatch = IsVectorAtCompileTime + || int(StrideType::OuterStrideAtCompileTime)==int(Dynamic) || int(StrideType::OuterStrideAtCompileTime)==int(Derived::OuterStrideAtCompileTime), + // NOTE, this indirection of evaluator::Alignment is needed + // to workaround a very strange bug in MSVC related to the instantiation + // of has_*ary_operator in evaluator. + // This line is surprisingly very sensitive. For instance, simply adding parenthesis + // as "DerivedAlignment = (int(evaluator::Alignment))," will make MSVC fail... + DerivedAlignment = int(evaluator::Alignment), + AlignmentMatch = (int(traits::Alignment)==int(Unaligned)) || (DerivedAlignment >= int(Alignment)), // FIXME the first condition is not very clear, it should be replaced by the required alignment + ScalarTypeMatch = internal::is_same::value, + MatchAtCompileTime = HasDirectAccess && StorageOrderMatch && InnerStrideMatch && OuterStrideMatch && AlignmentMatch && ScalarTypeMatch + }; + typedef std::conditional_t type; + }; + +}; + +template +struct traits > : public traits {}; + +} + +template class RefBase + : public MapBase +{ + typedef typename internal::traits::PlainObjectType PlainObjectType; + typedef typename internal::traits::StrideType StrideType; + +public: + + typedef MapBase Base; + EIGEN_DENSE_PUBLIC_INTERFACE(RefBase) + + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index innerStride() const + { + return StrideType::InnerStrideAtCompileTime != 0 ? m_stride.inner() : 1; + } + + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outerStride() const + { + return StrideType::OuterStrideAtCompileTime != 0 ? m_stride.outer() + : IsVectorAtCompileTime ? this->size() + : int(Flags)&RowMajorBit ? this->cols() + : this->rows(); + } + + EIGEN_DEVICE_FUNC RefBase() + : Base(0,RowsAtCompileTime==Dynamic?0:RowsAtCompileTime,ColsAtCompileTime==Dynamic?0:ColsAtCompileTime), + // Stride<> does not allow default ctor for Dynamic strides, so let' initialize it with dummy values: + m_stride(StrideType::OuterStrideAtCompileTime==Dynamic?0:StrideType::OuterStrideAtCompileTime, + StrideType::InnerStrideAtCompileTime==Dynamic?0:StrideType::InnerStrideAtCompileTime) + {} + + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(RefBase) + +protected: + + typedef Stride StrideBase; + + // Resolves inner stride if default 0. + static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index resolveInnerStride(Index inner) { + return inner == 0 ? 1 : inner; + } + + // Resolves outer stride if default 0. + static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index resolveOuterStride(Index inner, Index outer, Index rows, Index cols, bool isVectorAtCompileTime, bool isRowMajor) { + return outer == 0 ? isVectorAtCompileTime ? inner * rows * cols : isRowMajor ? inner * cols : inner * rows : outer; + } + + // Returns true if construction is valid, false if there is a stride mismatch, + // and fails if there is a size mismatch. + template + EIGEN_DEVICE_FUNC bool construct(Expression& expr) + { + // Check matrix sizes. If this is a compile-time vector, we do allow + // implicitly transposing. + EIGEN_STATIC_ASSERT( + EIGEN_PREDICATE_SAME_MATRIX_SIZE(PlainObjectType, Expression) + // If it is a vector, the transpose sizes might match. + || ( PlainObjectType::IsVectorAtCompileTime + && ((int(PlainObjectType::RowsAtCompileTime)==Eigen::Dynamic + || int(Expression::ColsAtCompileTime)==Eigen::Dynamic + || int(PlainObjectType::RowsAtCompileTime)==int(Expression::ColsAtCompileTime)) + && (int(PlainObjectType::ColsAtCompileTime)==Eigen::Dynamic + || int(Expression::RowsAtCompileTime)==Eigen::Dynamic + || int(PlainObjectType::ColsAtCompileTime)==int(Expression::RowsAtCompileTime)))), + YOU_MIXED_MATRICES_OF_DIFFERENT_SIZES + ) + + // Determine runtime rows and columns. + Index rows = expr.rows(); + Index cols = expr.cols(); + if(PlainObjectType::RowsAtCompileTime==1) + { + eigen_assert(expr.rows()==1 || expr.cols()==1); + rows = 1; + cols = expr.size(); + } + else if(PlainObjectType::ColsAtCompileTime==1) + { + eigen_assert(expr.rows()==1 || expr.cols()==1); + rows = expr.size(); + cols = 1; + } + // Verify that the sizes are valid. + eigen_assert( + (PlainObjectType::RowsAtCompileTime == Dynamic) || (PlainObjectType::RowsAtCompileTime == rows)); + eigen_assert( + (PlainObjectType::ColsAtCompileTime == Dynamic) || (PlainObjectType::ColsAtCompileTime == cols)); + + + // If this is a vector, we might be transposing, which means that stride should swap. + const bool transpose = PlainObjectType::IsVectorAtCompileTime && (rows != expr.rows()); + // If the storage format differs, we also need to swap the stride. + const bool row_major = ((PlainObjectType::Flags)&RowMajorBit) != 0; + const bool expr_row_major = (Expression::Flags&RowMajorBit) != 0; + const bool storage_differs = (row_major != expr_row_major); + + const bool swap_stride = (transpose != storage_differs); + + // Determine expr's actual strides, resolving any defaults if zero. + const Index expr_inner_actual = resolveInnerStride(expr.innerStride()); + const Index expr_outer_actual = resolveOuterStride(expr_inner_actual, + expr.outerStride(), + expr.rows(), + expr.cols(), + Expression::IsVectorAtCompileTime != 0, + expr_row_major); + + // If this is a column-major row vector or row-major column vector, the inner-stride + // is arbitrary, so set it to either the compile-time inner stride or 1. + const bool row_vector = (rows == 1); + const bool col_vector = (cols == 1); + const Index inner_stride = + ( (!row_major && row_vector) || (row_major && col_vector) ) ? + ( StrideType::InnerStrideAtCompileTime > 0 ? Index(StrideType::InnerStrideAtCompileTime) : 1) + : swap_stride ? expr_outer_actual : expr_inner_actual; + + // If this is a column-major column vector or row-major row vector, the outer-stride + // is arbitrary, so set it to either the compile-time outer stride or vector size. + const Index outer_stride = + ( (!row_major && col_vector) || (row_major && row_vector) ) ? + ( StrideType::OuterStrideAtCompileTime > 0 ? Index(StrideType::OuterStrideAtCompileTime) : rows * cols * inner_stride) + : swap_stride ? expr_inner_actual : expr_outer_actual; + + // Check if given inner/outer strides are compatible with compile-time strides. + const bool inner_valid = (StrideType::InnerStrideAtCompileTime == Dynamic) + || (resolveInnerStride(Index(StrideType::InnerStrideAtCompileTime)) == inner_stride); + if (!inner_valid) { + return false; + } + + const bool outer_valid = (StrideType::OuterStrideAtCompileTime == Dynamic) + || (resolveOuterStride( + inner_stride, + Index(StrideType::OuterStrideAtCompileTime), + rows, cols, PlainObjectType::IsVectorAtCompileTime != 0, + row_major) + == outer_stride); + if (!outer_valid) { + return false; + } + + internal::construct_at(this, expr.data(), rows, cols); + internal::construct_at(&m_stride, + (StrideType::OuterStrideAtCompileTime == 0) ? 0 : outer_stride, + (StrideType::InnerStrideAtCompileTime == 0) ? 0 : inner_stride ); + return true; + } + + StrideBase m_stride; +}; + +/** \class Ref + * \ingroup Core_Module + * + * \brief A matrix or vector expression mapping an existing expression + * + * \tparam PlainObjectType the equivalent matrix type of the mapped data + * \tparam Options specifies the pointer alignment in bytes. It can be: \c #Aligned128, , \c #Aligned64, \c #Aligned32, \c #Aligned16, \c #Aligned8 or \c #Unaligned. + * The default is \c #Unaligned. + * \tparam StrideType optionally specifies strides. By default, Ref implies a contiguous storage along the inner dimension (inner stride==1), + * but accepts a variable outer stride (leading dimension). + * This can be overridden by specifying strides. + * The type passed here must be a specialization of the Stride template, see examples below. + * + * This class provides a way to write non-template functions taking Eigen objects as parameters while limiting the number of copies. + * A Ref<> object can represent either a const expression or a l-value: + * \code + * // in-out argument: + * void foo1(Ref x); + * + * // read-only const argument: + * void foo2(const Ref& x); + * \endcode + * + * In the in-out case, the input argument must satisfy the constraints of the actual Ref<> type, otherwise a compilation issue will be triggered. + * By default, a Ref can reference any dense vector expression of float having a contiguous memory layout. + * Likewise, a Ref can reference any column-major dense matrix expression of float whose column's elements are contiguously stored with + * the possibility to have a constant space in-between each column, i.e. the inner stride must be equal to 1, but the outer stride (or leading dimension) + * can be greater than the number of rows. + * + * In the const case, if the input expression does not match the above requirement, then it is evaluated into a temporary before being passed to the function. + * Here are some examples: + * \code + * MatrixXf A; + * VectorXf a; + * foo1(a.head()); // OK + * foo1(A.col()); // OK + * foo1(A.row()); // Compilation error because here innerstride!=1 + * foo2(A.row()); // Compilation error because A.row() is a 1xN object while foo2 is expecting a Nx1 object + * foo2(A.row().transpose()); // The row is copied into a contiguous temporary + * foo2(2*a); // The expression is evaluated into a temporary + * foo2(A.col().segment(2,4)); // No temporary + * \endcode + * + * The range of inputs that can be referenced without temporary can be enlarged using the last two template parameters. + * Here is an example accepting an innerstride!=1: + * \code + * // in-out argument: + * void foo3(Ref > x); + * foo3(A.row()); // OK + * \endcode + * The downside here is that the function foo3 might be significantly slower than foo1 because it won't be able to exploit vectorization, and will involve more + * expensive address computations even if the input is contiguously stored in memory. To overcome this issue, one might propose to overload internally calling a + * template function, e.g.: + * \code + * // in the .h: + * void foo(const Ref& A); + * void foo(const Ref >& A); + * + * // in the .cpp: + * template void foo_impl(const TypeOfA& A) { + * ... // crazy code goes here + * } + * void foo(const Ref& A) { foo_impl(A); } + * void foo(const Ref >& A) { foo_impl(A); } + * \endcode + * + * See also the following stackoverflow questions for further references: + * - Correct usage of the Eigen::Ref<> class + * + * \sa PlainObjectBase::Map(), \ref TopicStorageOrders + */ +template class Ref + : public RefBase > +{ + private: + typedef internal::traits Traits; + template + EIGEN_DEVICE_FUNC inline Ref(const PlainObjectBase& expr, + std::enable_if_t::MatchAtCompileTime),Derived>* = 0); + public: + + typedef RefBase Base; + EIGEN_DENSE_PUBLIC_INTERFACE(Ref) + + + #ifndef EIGEN_PARSED_BY_DOXYGEN + template + EIGEN_DEVICE_FUNC inline Ref(PlainObjectBase& expr, + std::enable_if_t::MatchAtCompileTime),Derived>* = 0) + { + EIGEN_STATIC_ASSERT(bool(Traits::template match::MatchAtCompileTime), STORAGE_LAYOUT_DOES_NOT_MATCH); + // Construction must pass since we will not create temporary storage in the non-const case. + const bool success = Base::construct(expr.derived()); + EIGEN_UNUSED_VARIABLE(success) + eigen_assert(success); + } + template + EIGEN_DEVICE_FUNC inline Ref(const DenseBase& expr, + std::enable_if_t::MatchAtCompileTime),Derived>* = 0) + #else + /** Implicit constructor from any dense expression */ + template + inline Ref(DenseBase& expr) + #endif + { + EIGEN_STATIC_ASSERT(bool(internal::is_lvalue::value), THIS_EXPRESSION_IS_NOT_A_LVALUE__IT_IS_READ_ONLY); + EIGEN_STATIC_ASSERT(bool(Traits::template match::MatchAtCompileTime), STORAGE_LAYOUT_DOES_NOT_MATCH); + EIGEN_STATIC_ASSERT(!Derived::IsPlainObjectBase,THIS_EXPRESSION_IS_NOT_A_LVALUE__IT_IS_READ_ONLY); + // Construction must pass since we will not create temporary storage in the non-const case. + const bool success = Base::construct(expr.const_cast_derived()); + EIGEN_UNUSED_VARIABLE(success) + eigen_assert(success); + } + + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Ref) + +}; + +// this is the const ref version +template class Ref + : public RefBase > +{ + typedef internal::traits Traits; + + static constexpr bool may_map_m_object_successfully = + (static_cast(StrideType::InnerStrideAtCompileTime) == 0 || + static_cast(StrideType::InnerStrideAtCompileTime) == 1 || + static_cast(StrideType::InnerStrideAtCompileTime) == Dynamic) && + (TPlainObjectType::IsVectorAtCompileTime || + static_cast(StrideType::OuterStrideAtCompileTime) == 0 || + static_cast(StrideType::OuterStrideAtCompileTime) == Dynamic || + static_cast(StrideType::OuterStrideAtCompileTime) == static_cast(TPlainObjectType::InnerSizeAtCompileTime) || + static_cast(TPlainObjectType::InnerSizeAtCompileTime) == Dynamic); + public: + + typedef RefBase Base; + EIGEN_DENSE_PUBLIC_INTERFACE(Ref) + + template + EIGEN_DEVICE_FUNC inline Ref(const DenseBase& expr, + std::enable_if_t::ScalarTypeMatch),Derived>* = 0) + { +// std::cout << match_helper::HasDirectAccess << "," << match_helper::OuterStrideMatch << "," << match_helper::InnerStrideMatch << "\n"; +// std::cout << int(StrideType::OuterStrideAtCompileTime) << " - " << int(Derived::OuterStrideAtCompileTime) << "\n"; +// std::cout << int(StrideType::InnerStrideAtCompileTime) << " - " << int(Derived::InnerStrideAtCompileTime) << "\n"; + EIGEN_STATIC_ASSERT(Traits::template match::type::value || may_map_m_object_successfully, + STORAGE_LAYOUT_DOES_NOT_MATCH); + construct(expr.derived(), typename Traits::template match::type()); + } + + EIGEN_DEVICE_FUNC inline Ref(const Ref& other) : Base(other) { + // copy constructor shall not copy the m_object, to avoid unnecessary malloc and copy + } + + EIGEN_DEVICE_FUNC inline Ref(Ref&& other) { + if (other.data() == other.m_object.data()) { + m_object = std::move(other.m_object); + Base::construct(m_object); + } + else + Base::construct(other); + } + + template + EIGEN_DEVICE_FUNC inline Ref(const RefBase& other) { + EIGEN_STATIC_ASSERT(Traits::template match::type::value || may_map_m_object_successfully, + STORAGE_LAYOUT_DOES_NOT_MATCH); + construct(other.derived(), typename Traits::template match::type()); + } + + protected: + + template + EIGEN_DEVICE_FUNC void construct(const Expression& expr,internal::true_type) + { + // Check if we can use the underlying expr's storage directly, otherwise call the copy version. + if (!Base::construct(expr)) { + construct(expr, internal::false_type()); + } + } + + template + EIGEN_DEVICE_FUNC void construct(const Expression& expr, internal::false_type) + { + internal::call_assignment_no_alias(m_object,expr,internal::assign_op()); + const bool success = Base::construct(m_object); + EIGEN_ONLY_USED_FOR_DEBUG(success) + eigen_assert(success); + } + + protected: + TPlainObjectType m_object; +}; + +} // end namespace Eigen + +#endif // EIGEN_REF_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Replicate.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Replicate.h new file mode 100644 index 0000000000000000000000000000000000000000..4f91bbe4cdb33497704e530261fbad5fa74aedfb --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Replicate.h @@ -0,0 +1,144 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2009-2010 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_REPLICATE_H +#define EIGEN_REPLICATE_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { +template +struct traits > + : traits +{ + typedef typename MatrixType::Scalar Scalar; + typedef typename traits::StorageKind StorageKind; + typedef typename traits::XprKind XprKind; + typedef typename ref_selector::type MatrixTypeNested; + typedef std::remove_reference_t MatrixTypeNested_; + enum { + RowsAtCompileTime = RowFactor==Dynamic || int(MatrixType::RowsAtCompileTime)==Dynamic + ? Dynamic + : RowFactor * MatrixType::RowsAtCompileTime, + ColsAtCompileTime = ColFactor==Dynamic || int(MatrixType::ColsAtCompileTime)==Dynamic + ? Dynamic + : ColFactor * MatrixType::ColsAtCompileTime, + //FIXME we don't propagate the max sizes !!! + MaxRowsAtCompileTime = RowsAtCompileTime, + MaxColsAtCompileTime = ColsAtCompileTime, + IsRowMajor = MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1 ? 1 + : MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1 ? 0 + : (MatrixType::Flags & RowMajorBit) ? 1 : 0, + + // FIXME enable DirectAccess with negative strides? + Flags = IsRowMajor ? RowMajorBit : 0 + }; +}; +} + +/** + * \class Replicate + * \ingroup Core_Module + * + * \brief Expression of the multiple replication of a matrix or vector + * + * \tparam MatrixType the type of the object we are replicating + * \tparam RowFactor number of repetitions at compile time along the vertical direction, can be Dynamic. + * \tparam ColFactor number of repetitions at compile time along the horizontal direction, can be Dynamic. + * + * This class represents an expression of the multiple replication of a matrix or vector. + * It is the return type of DenseBase::replicate() and most of the time + * this is the only way it is used. + * + * \sa DenseBase::replicate() + */ +template class Replicate + : public internal::dense_xpr_base< Replicate >::type +{ + typedef typename internal::traits::MatrixTypeNested MatrixTypeNested; + typedef typename internal::traits::MatrixTypeNested_ MatrixTypeNested_; + public: + + typedef typename internal::dense_xpr_base::type Base; + EIGEN_DENSE_PUBLIC_INTERFACE(Replicate) + typedef internal::remove_all_t NestedExpression; + + template + EIGEN_DEVICE_FUNC + inline explicit Replicate(const OriginalMatrixType& matrix) + : m_matrix(matrix), m_rowFactor(RowFactor), m_colFactor(ColFactor) + { + EIGEN_STATIC_ASSERT((internal::is_same,OriginalMatrixType>::value), + THE_MATRIX_OR_EXPRESSION_THAT_YOU_PASSED_DOES_NOT_HAVE_THE_EXPECTED_TYPE) + eigen_assert(RowFactor!=Dynamic && ColFactor!=Dynamic); + } + + template + EIGEN_DEVICE_FUNC + inline Replicate(const OriginalMatrixType& matrix, Index rowFactor, Index colFactor) + : m_matrix(matrix), m_rowFactor(rowFactor), m_colFactor(colFactor) + { + EIGEN_STATIC_ASSERT((internal::is_same,OriginalMatrixType>::value), + THE_MATRIX_OR_EXPRESSION_THAT_YOU_PASSED_DOES_NOT_HAVE_THE_EXPECTED_TYPE) + } + + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index rows() const { return m_matrix.rows() * m_rowFactor.value(); } + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index cols() const { return m_matrix.cols() * m_colFactor.value(); } + + EIGEN_DEVICE_FUNC + const MatrixTypeNested_& nestedExpression() const + { + return m_matrix; + } + + protected: + MatrixTypeNested m_matrix; + const internal::variable_if_dynamic m_rowFactor; + const internal::variable_if_dynamic m_colFactor; +}; + +/** + * \return an expression of the replication of \c *this + * + * Example: \include MatrixBase_replicate.cpp + * Output: \verbinclude MatrixBase_replicate.out + * + * \sa VectorwiseOp::replicate(), DenseBase::replicate(Index,Index), class Replicate + */ +template +template +EIGEN_DEVICE_FUNC const Replicate +DenseBase::replicate() const +{ + return Replicate(derived()); +} + +/** + * \return an expression of the replication of each column (or row) of \c *this + * + * Example: \include DirectionWise_replicate_int.cpp + * Output: \verbinclude DirectionWise_replicate_int.out + * + * \sa VectorwiseOp::replicate(), DenseBase::replicate(), class Replicate + */ +template +EIGEN_DEVICE_FUNC const typename VectorwiseOp::ReplicateReturnType +VectorwiseOp::replicate(Index factor) const +{ + return typename VectorwiseOp::ReplicateReturnType + (_expression(),Direction==Vertical?factor:1,Direction==Horizontal?factor:1); +} + +} // end namespace Eigen + +#endif // EIGEN_REPLICATE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Reshaped.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Reshaped.h new file mode 100644 index 0000000000000000000000000000000000000000..508bc25297d367da54a5dee1677985b8f7068a46 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Reshaped.h @@ -0,0 +1,455 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008-2017 Gael Guennebaud +// Copyright (C) 2014 yoco +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_RESHAPED_H +#define EIGEN_RESHAPED_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +/** \class Reshaped + * \ingroup Core_Module + * + * \brief Expression of a fixed-size or dynamic-size reshape + * + * \tparam XprType the type of the expression in which we are taking a reshape + * \tparam Rows the number of rows of the reshape we are taking at compile time (optional) + * \tparam Cols the number of columns of the reshape we are taking at compile time (optional) + * \tparam Order can be ColMajor or RowMajor, default is ColMajor. + * + * This class represents an expression of either a fixed-size or dynamic-size reshape. + * It is the return type of DenseBase::reshaped(NRowsType,NColsType) and + * most of the time this is the only way it is used. + * + * If you want to directly manipulate reshaped expressions, + * for instance if you want to write a function returning such an expression, + * it is advised to use the \em auto keyword for such use cases. + * + * Here is an example illustrating the dynamic case: + * \include class_Reshaped.cpp + * Output: \verbinclude class_Reshaped.out + * + * Here is an example illustrating the fixed-size case: + * \include class_FixedReshaped.cpp + * Output: \verbinclude class_FixedReshaped.out + * + * \sa DenseBase::reshaped(NRowsType,NColsType) + */ + +namespace internal { + +template +struct traits > : traits +{ + typedef typename traits::Scalar Scalar; + typedef typename traits::StorageKind StorageKind; + typedef typename traits::XprKind XprKind; + enum{ + MatrixRows = traits::RowsAtCompileTime, + MatrixCols = traits::ColsAtCompileTime, + RowsAtCompileTime = Rows, + ColsAtCompileTime = Cols, + MaxRowsAtCompileTime = Rows, + MaxColsAtCompileTime = Cols, + XpxStorageOrder = ((int(traits::Flags) & RowMajorBit) == RowMajorBit) ? RowMajor : ColMajor, + ReshapedStorageOrder = (RowsAtCompileTime == 1 && ColsAtCompileTime != 1) ? RowMajor + : (ColsAtCompileTime == 1 && RowsAtCompileTime != 1) ? ColMajor + : XpxStorageOrder, + HasSameStorageOrderAsXprType = (ReshapedStorageOrder == XpxStorageOrder), + InnerSize = (ReshapedStorageOrder==int(RowMajor)) ? int(ColsAtCompileTime) : int(RowsAtCompileTime), + InnerStrideAtCompileTime = HasSameStorageOrderAsXprType + ? int(inner_stride_at_compile_time::ret) + : Dynamic, + OuterStrideAtCompileTime = Dynamic, + + HasDirectAccess = internal::has_direct_access::ret + && (Order==int(XpxStorageOrder)) + && ((evaluator::Flags&LinearAccessBit)==LinearAccessBit), + + MaskPacketAccessBit = (InnerSize == Dynamic || (InnerSize % packet_traits::size) == 0) + && (InnerStrideAtCompileTime == 1) + ? PacketAccessBit : 0, + //MaskAlignedBit = ((OuterStrideAtCompileTime!=Dynamic) && (((OuterStrideAtCompileTime * int(sizeof(Scalar))) % 16) == 0)) ? AlignedBit : 0, + FlagsLinearAccessBit = (RowsAtCompileTime == 1 || ColsAtCompileTime == 1) ? LinearAccessBit : 0, + FlagsLvalueBit = is_lvalue::value ? LvalueBit : 0, + FlagsRowMajorBit = (ReshapedStorageOrder==int(RowMajor)) ? RowMajorBit : 0, + FlagsDirectAccessBit = HasDirectAccess ? DirectAccessBit : 0, + Flags0 = traits::Flags & ( (HereditaryBits & ~RowMajorBit) | MaskPacketAccessBit), + + Flags = (Flags0 | FlagsLinearAccessBit | FlagsLvalueBit | FlagsRowMajorBit | FlagsDirectAccessBit) + }; +}; + +template class ReshapedImpl_dense; + +} // end namespace internal + +template class ReshapedImpl; + +template class Reshaped + : public ReshapedImpl::StorageKind> +{ + typedef ReshapedImpl::StorageKind> Impl; + public: + //typedef typename Impl::Base Base; + typedef Impl Base; + EIGEN_GENERIC_PUBLIC_INTERFACE(Reshaped) + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Reshaped) + + /** Fixed-size constructor + */ + EIGEN_DEVICE_FUNC + inline Reshaped(XprType& xpr) + : Impl(xpr) + { + EIGEN_STATIC_ASSERT(RowsAtCompileTime!=Dynamic && ColsAtCompileTime!=Dynamic,THIS_METHOD_IS_ONLY_FOR_FIXED_SIZE) + eigen_assert(Rows * Cols == xpr.rows() * xpr.cols()); + } + + /** Dynamic-size constructor + */ + EIGEN_DEVICE_FUNC + inline Reshaped(XprType& xpr, + Index reshapeRows, Index reshapeCols) + : Impl(xpr, reshapeRows, reshapeCols) + { + eigen_assert((RowsAtCompileTime==Dynamic || RowsAtCompileTime==reshapeRows) + && (ColsAtCompileTime==Dynamic || ColsAtCompileTime==reshapeCols)); + eigen_assert(reshapeRows * reshapeCols == xpr.rows() * xpr.cols()); + } +}; + +// The generic default implementation for dense reshape simply forward to the internal::ReshapedImpl_dense +// that must be specialized for direct and non-direct access... +template +class ReshapedImpl + : public internal::ReshapedImpl_dense >::HasDirectAccess> +{ + typedef internal::ReshapedImpl_dense >::HasDirectAccess> Impl; + public: + typedef Impl Base; + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(ReshapedImpl) + EIGEN_DEVICE_FUNC inline ReshapedImpl(XprType& xpr) : Impl(xpr) {} + EIGEN_DEVICE_FUNC inline ReshapedImpl(XprType& xpr, Index reshapeRows, Index reshapeCols) + : Impl(xpr, reshapeRows, reshapeCols) {} +}; + +namespace internal { + +/** \internal Internal implementation of dense Reshaped in the general case. */ +template +class ReshapedImpl_dense + : public internal::dense_xpr_base >::type +{ + typedef Reshaped ReshapedType; + public: + + typedef typename internal::dense_xpr_base::type Base; + EIGEN_DENSE_PUBLIC_INTERFACE(ReshapedType) + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(ReshapedImpl_dense) + + typedef typename internal::ref_selector::non_const_type MatrixTypeNested; + typedef internal::remove_all_t NestedExpression; + + class InnerIterator; + + /** Fixed-size constructor + */ + EIGEN_DEVICE_FUNC + inline ReshapedImpl_dense(XprType& xpr) + : m_xpr(xpr), m_rows(Rows), m_cols(Cols) + {} + + /** Dynamic-size constructor + */ + EIGEN_DEVICE_FUNC + inline ReshapedImpl_dense(XprType& xpr, Index nRows, Index nCols) + : m_xpr(xpr), m_rows(nRows), m_cols(nCols) + {} + + EIGEN_DEVICE_FUNC Index rows() const { return m_rows; } + EIGEN_DEVICE_FUNC Index cols() const { return m_cols; } + + #ifdef EIGEN_PARSED_BY_DOXYGEN + /** \sa MapBase::data() */ + EIGEN_DEVICE_FUNC inline const Scalar* data() const; + EIGEN_DEVICE_FUNC inline Index innerStride() const; + EIGEN_DEVICE_FUNC inline Index outerStride() const; + #endif + + /** \returns the nested expression */ + EIGEN_DEVICE_FUNC + const internal::remove_all_t& + nestedExpression() const { return m_xpr; } + + /** \returns the nested expression */ + EIGEN_DEVICE_FUNC + std::remove_reference_t& + nestedExpression() { return m_xpr; } + + protected: + + MatrixTypeNested m_xpr; + const internal::variable_if_dynamic m_rows; + const internal::variable_if_dynamic m_cols; +}; + + +/** \internal Internal implementation of dense Reshaped in the direct access case. */ +template +class ReshapedImpl_dense + : public MapBase > +{ + typedef Reshaped ReshapedType; + typedef typename internal::ref_selector::non_const_type XprTypeNested; + public: + + typedef MapBase Base; + EIGEN_DENSE_PUBLIC_INTERFACE(ReshapedType) + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(ReshapedImpl_dense) + + /** Fixed-size constructor + */ + EIGEN_DEVICE_FUNC + inline ReshapedImpl_dense(XprType& xpr) + : Base(xpr.data()), m_xpr(xpr) + {} + + /** Dynamic-size constructor + */ + EIGEN_DEVICE_FUNC + inline ReshapedImpl_dense(XprType& xpr, Index nRows, Index nCols) + : Base(xpr.data(), nRows, nCols), + m_xpr(xpr) + {} + + EIGEN_DEVICE_FUNC + const internal::remove_all_t& nestedExpression() const + { + return m_xpr; + } + + EIGEN_DEVICE_FUNC + XprType& nestedExpression() { return m_xpr; } + + /** \sa MapBase::innerStride() */ + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index innerStride() const + { + return m_xpr.innerStride(); + } + + /** \sa MapBase::outerStride() */ + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index outerStride() const + { + return (((Flags&RowMajorBit)==RowMajorBit) ? this->cols() : this->rows()) * m_xpr.innerStride(); + } + + protected: + + XprTypeNested m_xpr; +}; + +// Evaluators +template struct reshaped_evaluator; + +template +struct evaluator > + : reshaped_evaluator >::HasDirectAccess> +{ + typedef Reshaped XprType; + typedef typename XprType::Scalar Scalar; + // TODO: should check for smaller packet types + typedef typename packet_traits::type PacketScalar; + + enum { + CoeffReadCost = evaluator::CoeffReadCost, + HasDirectAccess = traits::HasDirectAccess, + +// RowsAtCompileTime = traits::RowsAtCompileTime, +// ColsAtCompileTime = traits::ColsAtCompileTime, +// MaxRowsAtCompileTime = traits::MaxRowsAtCompileTime, +// MaxColsAtCompileTime = traits::MaxColsAtCompileTime, +// +// InnerStrideAtCompileTime = traits::HasSameStorageOrderAsXprType +// ? int(inner_stride_at_compile_time::ret) +// : Dynamic, +// OuterStrideAtCompileTime = Dynamic, + + FlagsLinearAccessBit = (traits::RowsAtCompileTime == 1 || traits::ColsAtCompileTime == 1 || HasDirectAccess) ? LinearAccessBit : 0, + FlagsRowMajorBit = (traits::ReshapedStorageOrder==int(RowMajor)) ? RowMajorBit : 0, + FlagsDirectAccessBit = HasDirectAccess ? DirectAccessBit : 0, + Flags0 = evaluator::Flags & (HereditaryBits & ~RowMajorBit), + Flags = Flags0 | FlagsLinearAccessBit | FlagsRowMajorBit | FlagsDirectAccessBit, + + PacketAlignment = unpacket_traits::alignment, + Alignment = evaluator::Alignment + }; + typedef reshaped_evaluator reshaped_evaluator_type; + EIGEN_DEVICE_FUNC explicit evaluator(const XprType& xpr) : reshaped_evaluator_type(xpr) + { + EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); + } +}; + +template +struct reshaped_evaluator + : evaluator_base > +{ + typedef Reshaped XprType; + + enum { + CoeffReadCost = evaluator::CoeffReadCost /* TODO + cost of index computations */, + + Flags = (evaluator::Flags & (HereditaryBits /*| LinearAccessBit | DirectAccessBit*/)), + + Alignment = 0 + }; + + EIGEN_DEVICE_FUNC explicit reshaped_evaluator(const XprType& xpr) : m_argImpl(xpr.nestedExpression()), m_xpr(xpr) + { + EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); + } + + typedef typename XprType::Scalar Scalar; + typedef typename XprType::CoeffReturnType CoeffReturnType; + + typedef std::pair RowCol; + + EIGEN_DEVICE_FUNC inline RowCol index_remap(Index rowId, Index colId) const + { + if(Order==ColMajor) + { + const Index nth_elem_idx = colId * m_xpr.rows() + rowId; + return RowCol(nth_elem_idx % m_xpr.nestedExpression().rows(), + nth_elem_idx / m_xpr.nestedExpression().rows()); + } + else + { + const Index nth_elem_idx = colId + rowId * m_xpr.cols(); + return RowCol(nth_elem_idx / m_xpr.nestedExpression().cols(), + nth_elem_idx % m_xpr.nestedExpression().cols()); + } + } + + EIGEN_DEVICE_FUNC + inline Scalar& coeffRef(Index rowId, Index colId) + { + EIGEN_STATIC_ASSERT_LVALUE(XprType) + const RowCol row_col = index_remap(rowId, colId); + return m_argImpl.coeffRef(row_col.first, row_col.second); + } + + EIGEN_DEVICE_FUNC + inline const Scalar& coeffRef(Index rowId, Index colId) const + { + const RowCol row_col = index_remap(rowId, colId); + return m_argImpl.coeffRef(row_col.first, row_col.second); + } + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE const CoeffReturnType coeff(Index rowId, Index colId) const + { + const RowCol row_col = index_remap(rowId, colId); + return m_argImpl.coeff(row_col.first, row_col.second); + } + + EIGEN_DEVICE_FUNC + inline Scalar& coeffRef(Index index) + { + EIGEN_STATIC_ASSERT_LVALUE(XprType) + const RowCol row_col = index_remap(Rows == 1 ? 0 : index, + Rows == 1 ? index : 0); + return m_argImpl.coeffRef(row_col.first, row_col.second); + + } + + EIGEN_DEVICE_FUNC + inline const Scalar& coeffRef(Index index) const + { + const RowCol row_col = index_remap(Rows == 1 ? 0 : index, + Rows == 1 ? index : 0); + return m_argImpl.coeffRef(row_col.first, row_col.second); + } + + EIGEN_DEVICE_FUNC + inline const CoeffReturnType coeff(Index index) const + { + const RowCol row_col = index_remap(Rows == 1 ? 0 : index, + Rows == 1 ? index : 0); + return m_argImpl.coeff(row_col.first, row_col.second); + } +#if 0 + EIGEN_DEVICE_FUNC + template + inline PacketScalar packet(Index rowId, Index colId) const + { + const RowCol row_col = index_remap(rowId, colId); + return m_argImpl.template packet(row_col.first, row_col.second); + + } + + template + EIGEN_DEVICE_FUNC + inline void writePacket(Index rowId, Index colId, const PacketScalar& val) + { + const RowCol row_col = index_remap(rowId, colId); + m_argImpl.const_cast_derived().template writePacket + (row_col.first, row_col.second, val); + } + + template + EIGEN_DEVICE_FUNC + inline PacketScalar packet(Index index) const + { + const RowCol row_col = index_remap(RowsAtCompileTime == 1 ? 0 : index, + RowsAtCompileTime == 1 ? index : 0); + return m_argImpl.template packet(row_col.first, row_col.second); + } + + template + EIGEN_DEVICE_FUNC + inline void writePacket(Index index, const PacketScalar& val) + { + const RowCol row_col = index_remap(RowsAtCompileTime == 1 ? 0 : index, + RowsAtCompileTime == 1 ? index : 0); + return m_argImpl.template packet(row_col.first, row_col.second, val); + } +#endif +protected: + + evaluator m_argImpl; + const XprType& m_xpr; + +}; + +template +struct reshaped_evaluator +: mapbase_evaluator, + typename Reshaped::PlainObject> +{ + typedef Reshaped XprType; + typedef typename XprType::Scalar Scalar; + + EIGEN_DEVICE_FUNC explicit reshaped_evaluator(const XprType& xpr) + : mapbase_evaluator(xpr) + { + // TODO: for the 3.4 release, this should be turned to an internal assertion, but let's keep it as is for the beta lifetime + eigen_assert(((std::uintptr_t(xpr.data()) % plain_enum_max(1, evaluator::Alignment)) == 0) && "data is not aligned"); + } +}; + +} // end namespace internal + +} // end namespace Eigen + +#endif // EIGEN_RESHAPED_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/ReturnByValue.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/ReturnByValue.h new file mode 100644 index 0000000000000000000000000000000000000000..90252829bce62e310d1dcc31dd5606644a80c0f7 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/ReturnByValue.h @@ -0,0 +1,121 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2009-2010 Gael Guennebaud +// Copyright (C) 2009-2010 Benoit Jacob +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_RETURNBYVALUE_H +#define EIGEN_RETURNBYVALUE_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { + +template +struct traits > + : public traits::ReturnType> +{ + enum { + // We're disabling the DirectAccess because e.g. the constructor of + // the Block-with-DirectAccess expression requires to have a coeffRef method. + // Also, we don't want to have to implement the stride stuff. + Flags = (traits::ReturnType>::Flags + | EvalBeforeNestingBit) & ~DirectAccessBit + }; +}; + +/* The ReturnByValue object doesn't even have a coeff() method. + * So the only way that nesting it in an expression can work, is by evaluating it into a plain matrix. + * So internal::nested always gives the plain return matrix type. + * + * FIXME: I don't understand why we need this specialization: isn't this taken care of by the EvalBeforeNestingBit ?? + * Answer: EvalBeforeNestingBit should be deprecated since we have the evaluators + */ +template +struct nested_eval, n, PlainObject> +{ + typedef typename traits::ReturnType type; +}; + +} // end namespace internal + +/** \class ReturnByValue + * \ingroup Core_Module + * + */ +template class ReturnByValue + : public internal::dense_xpr_base< ReturnByValue >::type, internal::no_assignment_operator +{ + public: + typedef typename internal::traits::ReturnType ReturnType; + + typedef typename internal::dense_xpr_base::type Base; + EIGEN_DENSE_PUBLIC_INTERFACE(ReturnByValue) + + template + EIGEN_DEVICE_FUNC + inline void evalTo(Dest& dst) const + { static_cast(this)->evalTo(dst); } + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index rows() const EIGEN_NOEXCEPT { return static_cast(this)->rows(); } + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index cols() const EIGEN_NOEXCEPT { return static_cast(this)->cols(); } + +#ifndef EIGEN_PARSED_BY_DOXYGEN +#define Unusable YOU_ARE_TRYING_TO_ACCESS_A_SINGLE_COEFFICIENT_IN_A_SPECIAL_EXPRESSION_WHERE_THAT_IS_NOT_ALLOWED_BECAUSE_THAT_WOULD_BE_INEFFICIENT + class Unusable{ + Unusable(const Unusable&) {} + Unusable& operator=(const Unusable&) {return *this;} + }; + const Unusable& coeff(Index) const { return *reinterpret_cast(this); } + const Unusable& coeff(Index,Index) const { return *reinterpret_cast(this); } + Unusable& coeffRef(Index) { return *reinterpret_cast(this); } + Unusable& coeffRef(Index,Index) { return *reinterpret_cast(this); } +#undef Unusable +#endif +}; + +template +template +EIGEN_DEVICE_FUNC Derived& DenseBase::operator=(const ReturnByValue& other) +{ + other.evalTo(derived()); + return derived(); +} + +namespace internal { + +// Expression is evaluated in a temporary; default implementation of Assignment is bypassed so that +// when a ReturnByValue expression is assigned, the evaluator is not constructed. +// TODO: Finalize port to new regime; ReturnByValue should not exist in the expression world + +template +struct evaluator > + : public evaluator::ReturnType> +{ + typedef ReturnByValue XprType; + typedef typename internal::traits::ReturnType PlainObject; + typedef evaluator Base; + + EIGEN_DEVICE_FUNC explicit evaluator(const XprType& xpr) + : m_result(xpr.rows(), xpr.cols()) + { + internal::construct_at(this, m_result); + xpr.evalTo(m_result); + } + +protected: + PlainObject m_result; +}; + +} // end namespace internal + +} // end namespace Eigen + +#endif // EIGEN_RETURNBYVALUE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Reverse.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Reverse.h new file mode 100644 index 0000000000000000000000000000000000000000..97e1d68e9e30ba3fbe88925a1073807d32a804ff --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Reverse.h @@ -0,0 +1,219 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2006-2008 Benoit Jacob +// Copyright (C) 2009 Ricard Marxer +// Copyright (C) 2009-2010 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_REVERSE_H +#define EIGEN_REVERSE_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +namespace internal { + +template +struct traits > + : traits +{ + typedef typename MatrixType::Scalar Scalar; + typedef typename traits::StorageKind StorageKind; + typedef typename traits::XprKind XprKind; + typedef typename ref_selector::type MatrixTypeNested; + typedef std::remove_reference_t MatrixTypeNested_; + enum { + RowsAtCompileTime = MatrixType::RowsAtCompileTime, + ColsAtCompileTime = MatrixType::ColsAtCompileTime, + MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime, + MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime, + Flags = MatrixTypeNested_::Flags & (RowMajorBit | LvalueBit) + }; +}; + +template struct reverse_packet_cond +{ + static inline PacketType run(const PacketType& x) { return preverse(x); } +}; + +template struct reverse_packet_cond +{ + static inline PacketType run(const PacketType& x) { return x; } +}; + +} // end namespace internal + +/** \class Reverse + * \ingroup Core_Module + * + * \brief Expression of the reverse of a vector or matrix + * + * \tparam MatrixType the type of the object of which we are taking the reverse + * \tparam Direction defines the direction of the reverse operation, can be Vertical, Horizontal, or BothDirections + * + * This class represents an expression of the reverse of a vector. + * It is the return type of MatrixBase::reverse() and VectorwiseOp::reverse() + * and most of the time this is the only way it is used. + * + * \sa MatrixBase::reverse(), VectorwiseOp::reverse() + */ +template class Reverse + : public internal::dense_xpr_base< Reverse >::type +{ + public: + + typedef typename internal::dense_xpr_base::type Base; + EIGEN_DENSE_PUBLIC_INTERFACE(Reverse) + typedef internal::remove_all_t NestedExpression; + using Base::IsRowMajor; + + protected: + enum { + PacketSize = internal::packet_traits::size, + IsColMajor = !IsRowMajor, + ReverseRow = (Direction == Vertical) || (Direction == BothDirections), + ReverseCol = (Direction == Horizontal) || (Direction == BothDirections), + OffsetRow = ReverseRow && IsColMajor ? PacketSize : 1, + OffsetCol = ReverseCol && IsRowMajor ? PacketSize : 1, + ReversePacket = (Direction == BothDirections) + || ((Direction == Vertical) && IsColMajor) + || ((Direction == Horizontal) && IsRowMajor) + }; + typedef internal::reverse_packet_cond reverse_packet; + public: + + EIGEN_DEVICE_FUNC explicit inline Reverse(const MatrixType& matrix) : m_matrix(matrix) { } + + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Reverse) + + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); } + EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR + inline Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); } + + EIGEN_DEVICE_FUNC inline Index innerStride() const + { + return -m_matrix.innerStride(); + } + + EIGEN_DEVICE_FUNC const internal::remove_all_t& + nestedExpression() const + { + return m_matrix; + } + + protected: + typename MatrixType::Nested m_matrix; +}; + +/** \returns an expression of the reverse of *this. + * + * Example: \include MatrixBase_reverse.cpp + * Output: \verbinclude MatrixBase_reverse.out + * + */ +template +EIGEN_DEVICE_FUNC inline typename DenseBase::ReverseReturnType +DenseBase::reverse() +{ + return ReverseReturnType(derived()); +} + + +//reverse const overload moved DenseBase.h due to a CUDA compiler bug + +/** This is the "in place" version of reverse: it reverses \c *this. + * + * In most cases it is probably better to simply use the reversed expression + * of a matrix. However, when reversing the matrix data itself is really needed, + * then this "in-place" version is probably the right choice because it provides + * the following additional benefits: + * - less error prone: doing the same operation with .reverse() requires special care: + * \code m = m.reverse().eval(); \endcode + * - this API enables reverse operations without the need for a temporary + * - it allows future optimizations (cache friendliness, etc.) + * + * \sa VectorwiseOp::reverseInPlace(), reverse() */ +template +EIGEN_DEVICE_FUNC inline void DenseBase::reverseInPlace() +{ + if(cols()>rows()) + { + Index half = cols()/2; + leftCols(half).swap(rightCols(half).reverse()); + if((cols()%2)==1) + { + Index half2 = rows()/2; + col(half).head(half2).swap(col(half).tail(half2).reverse()); + } + } + else + { + Index half = rows()/2; + topRows(half).swap(bottomRows(half).reverse()); + if((rows()%2)==1) + { + Index half2 = cols()/2; + row(half).head(half2).swap(row(half).tail(half2).reverse()); + } + } +} + +namespace internal { + +template +struct vectorwise_reverse_inplace_impl; + +template<> +struct vectorwise_reverse_inplace_impl +{ + template + static void run(ExpressionType &xpr) + { + constexpr Index HalfAtCompileTime = ExpressionType::RowsAtCompileTime==Dynamic?Dynamic:ExpressionType::RowsAtCompileTime/2; + Index half = xpr.rows()/2; + xpr.template topRows(half) + .swap(xpr.template bottomRows(half).colwise().reverse()); + } +}; + +template<> +struct vectorwise_reverse_inplace_impl +{ + template + static void run(ExpressionType &xpr) + { + constexpr Index HalfAtCompileTime = ExpressionType::ColsAtCompileTime==Dynamic?Dynamic:ExpressionType::ColsAtCompileTime/2; + Index half = xpr.cols()/2; + xpr.template leftCols(half) + .swap(xpr.template rightCols(half).rowwise().reverse()); + } +}; + +} // end namespace internal + +/** This is the "in place" version of VectorwiseOp::reverse: it reverses each column or row of \c *this. + * + * In most cases it is probably better to simply use the reversed expression + * of a matrix. However, when reversing the matrix data itself is really needed, + * then this "in-place" version is probably the right choice because it provides + * the following additional benefits: + * - less error prone: doing the same operation with .reverse() requires special care: + * \code m = m.reverse().eval(); \endcode + * - this API enables reverse operations without the need for a temporary + * + * \sa DenseBase::reverseInPlace(), reverse() */ +template +EIGEN_DEVICE_FUNC void VectorwiseOp::reverseInPlace() +{ + internal::vectorwise_reverse_inplace_impl::run(m_matrix); +} + +} // end namespace Eigen + +#endif // EIGEN_REVERSE_H diff --git a/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Select.h b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Select.h new file mode 100644 index 0000000000000000000000000000000000000000..fdc93c5cdb3f9f670236171596f6f1ccc64bfd92 --- /dev/null +++ b/miniconda3/envs/active_proaction/lib/python3.10/site-packages/tensorflow/include/Eigen/src/Core/Select.h @@ -0,0 +1,191 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008-2010 Gael Guennebaud +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef EIGEN_SELECT_H +#define EIGEN_SELECT_H + +#include "./InternalHeaderCheck.h" + +namespace Eigen { + +/** \class Select + * \ingroup Core_Module + * + * \brief Expression of a coefficient wise version of the C++ ternary operator ?: + * + * \tparam ConditionMatrixType the type of the \em condition expression which must be a boolean matrix + * \tparam ThenMatrixType the type of the \em then expression + * \tparam ElseMatrixType the type of the \em else expression + * + * This class represents an expression of a coefficient wise version of the C++ ternary operator ?:. + * It is the return type of DenseBase::select() and most of the time this is the only way it is used. + * + * \sa DenseBase::select(const DenseBase&, const DenseBase&) const + */ + +namespace internal { +template +struct traits > + : traits +{ + typedef typename traits::Scalar Scalar; + typedef Dense StorageKind; + typedef typename traits::XprKind XprKind; + typedef typename ConditionMatrixType::Nested ConditionMatrixNested; + typedef typename ThenMatrixType::Nested ThenMatrixNested; + typedef typename ElseMatrixType::Nested ElseMatrixNested; + enum { + RowsAtCompileTime = ConditionMatrixType::RowsAtCompileTime, + ColsAtCompileTime = ConditionMatrixType::ColsAtCompileTime, + MaxRowsAtCompileTime = ConditionMatrixType::MaxRowsAtCompileTime, + MaxColsAtCompileTime = ConditionMatrixType::MaxColsAtCompileTime, + Flags = (unsigned int)ThenMatrixType::Flags & ElseMatrixType::Flags & RowMajorBit + }; +}; +} + +template +class Select : public internal::dense_xpr_base< Select >::type, + internal::no_assignment_operator +{ + public: + + typedef typename internal::dense_xpr_base