Graph.control_dependencies() using the default graph.',!1,`Wrapper for \`Graph.control_dependencies()\` using the default graph.
+
+ See \`tf.Graph.control_dependencies\` for more details.
+
+ Note: *In TensorFlow 2 with eager and/or Autograph, you should not require
+ this method, as ops execute in the expected order thanks to automatic control
+ dependencies.* Only use \`tf.control_dependencies\` when working with v1
+ \`tf.Graph\` code.
+
+ When eager execution is enabled, any callable object in the \`control_inputs\`
+ list will be called.
+
+ Args:
+ control_inputs: A list of \`Operation\` or \`Tensor\` objects which must be
+ executed or computed before running the operations defined in the context.
+ Can also be \`None\` to clear the control dependencies. If eager execution
+ is enabled, any callable object in the \`control_inputs\` list will be
+ called.
+
+ Returns:
+ A context manager that specifies control dependencies for all
+ operations constructed within the context.
+ `],["tf.convert_to_tensor","description: Converts the given value to a Tensor.",!1,`Converts the given \`value\` to a \`Tensor\`.
+
+ This function converts Python objects of various types to \`Tensor\`
+ objects. It accepts \`Tensor\` objects, numpy arrays, Python lists,
+ and Python scalars.
+
+ For example:
+
+ >>> import numpy as np
+ >>> def my_func(arg):
+ ... arg = tf.convert_to_tensor(arg, dtype=tf.float32)
+ ... return arg
+
+ >>> # The following calls are equivalent.
+ ...
+ >>> value_1 = my_func(tf.constant([[1.0, 2.0], [3.0, 4.0]]))
+ >>> print(value_1)
+ tf.Tensor(
+ [[1. 2.]
+ [3. 4.]], shape=(2, 2), dtype=float32)
+ >>> value_2 = my_func([[1.0, 2.0], [3.0, 4.0]])
+ >>> print(value_2)
+ tf.Tensor(
+ [[1. 2.]
+ [3. 4.]], shape=(2, 2), dtype=float32)
+ >>> value_3 = my_func(np.array([[1.0, 2.0], [3.0, 4.0]], dtype=np.float32))
+ >>> print(value_3)
+ tf.Tensor(
+ [[1. 2.]
+ [3. 4.]], shape=(2, 2), dtype=float32)
+
+ This function can be useful when composing a new operation in Python
+ (such as \`my_func\` in the example above). All standard Python op
+ constructors apply this function to each of their Tensor-valued
+ inputs, which allows those ops to accept numpy arrays, Python lists,
+ and scalars in addition to \`Tensor\` objects.
+
+ Note: This function diverges from default Numpy behavior for \`float\` and
+ \`string\` types when \`None\` is present in a Python list or scalar. Rather
+ than silently converting \`None\` values, an error will be thrown.
+
+ Args:
+ value: An object whose type has a registered \`Tensor\` conversion function.
+ dtype: Optional element type for the returned tensor. If missing, the type
+ is inferred from the type of \`value\`.
+ dtype_hint: Optional element type for the returned tensor, used when dtype
+ is None. In some cases, a caller may not have a dtype in mind when
+ converting to a tensor, so dtype_hint can be used as a soft preference.
+ If the conversion to \`dtype_hint\` is not possible, this argument has no
+ effect.
+ name: Optional name to use if a new \`Tensor\` is created.
+
+ Returns:
+ A \`Tensor\` based on \`value\`.
+
+ Raises:
+ TypeError: If no conversion function is registered for \`value\` to \`dtype\`.
+ RuntimeError: If a registered conversion function returns an invalid value.
+ ValueError: If the \`value\` is a tensor not of given \`dtype\` in graph mode.
+ `],["tf.CriticalSection","description: Critical section.",!1,`Critical section.
+
+ A \`CriticalSection\` object is a resource in the graph which executes subgraphs
+ in **serial** order. A common example of a subgraph one may wish to run
+ exclusively is the one given by the following function:
+
+ \`\`\`python
+ v = resource_variable_ops.ResourceVariable(0.0, name="v")
+
+ def count():
+ value = v.read_value()
+ with tf.control_dependencies([value]):
+ with tf.control_dependencies([v.assign_add(1)]):
+ return tf.identity(value)
+ \`\`\`
+
+ Here, a snapshot of \`v\` is captured in \`value\`; and then \`v\` is updated.
+ The snapshot value is returned.
+
+ If multiple workers or threads all execute \`count\` in parallel, there is no
+ guarantee that access to the variable \`v\` is atomic at any point within
+ any thread's calculation of \`count\`. In fact, even implementing an atomic
+ counter that guarantees that the user will see each value \`0, 1, ...,\` is
+ currently impossible.
+
+ The solution is to ensure any access to the underlying resource \`v\` is
+ only processed through a critical section:
+
+ \`\`\`python
+ cs = CriticalSection()
+ f1 = cs.execute(count)
+ f2 = cs.execute(count)
+ output = f1 + f2
+ session.run(output)
+ \`\`\`
+ The functions \`f1\` and \`f2\` will be executed serially, and updates to \`v\`
+ will be atomic.
+
+ **NOTES**
+
+ All resource objects, including the critical section and any captured
+ variables of functions executed on that critical section, will be
+ colocated to the same device (host and cpu/gpu).
+
+ When using multiple critical sections on the same resources, there is no
+ guarantee of exclusive access to those resources. This behavior is disallowed
+ by default (but see the kwarg \`exclusive_resource_access\`).
+
+ For example, running the same function in two separate critical sections
+ will not ensure serial execution:
+
+ \`\`\`python
+ v = tf.compat.v1.get_variable("v", initializer=0.0, use_resource=True)
+ def accumulate(up):
+ x = v.read_value()
+ with tf.control_dependencies([x]):
+ with tf.control_dependencies([v.assign_add(up)]):
+ return tf.identity(x)
+ ex1 = CriticalSection().execute(
+ accumulate, 1.0, exclusive_resource_access=False)
+ ex2 = CriticalSection().execute(
+ accumulate, 1.0, exclusive_resource_access=False)
+ bad_sum = ex1 + ex2
+ sess.run(v.initializer)
+ sess.run(bad_sum) # May return 0.0
+ \`\`\`
+ `],["tf.custom_gradient","description: Decorator to define a function with a custom gradient.",!1,`Decorator to define a function with a custom gradient.
+
+ This decorator allows fine grained control over the gradients of a sequence
+ for operations. This may be useful for multiple reasons, including providing
+ a more efficient or numerically stable gradient for a sequence of operations.
+
+ For example, consider the following function that commonly occurs in the
+ computation of cross entropy and log likelihoods:
+
+ \`\`\`python
+ def log1pexp(x):
+ return tf.math.log(1 + tf.exp(x))
+ \`\`\`
+
+ Due to numerical instability, the gradient of this function evaluated at x=100
+ is NaN. For example:
+
+ \`\`\`python
+ x = tf.constant(100.)
+ y = log1pexp(x)
+ dy_dx = tf.gradients(y, x) # Will be NaN when evaluated.
+ \`\`\`
+
+ The gradient expression can be analytically simplified to provide numerical
+ stability:
+
+ \`\`\`python
+ @tf.custom_gradient
+ def log1pexp(x):
+ e = tf.exp(x)
+ def grad(upstream):
+ return upstream * (1 - 1 / (1 + e))
+ return tf.math.log(1 + e), grad
+ \`\`\`
+
+ With this definition, the gradient \`dy_dx\` at \`x = 100\` will be correctly
+ evaluated as 1.0.
+
+ The variable \`upstream\` is defined as the upstream gradient. i.e. the gradient
+ from all the layers or functions originating from this layer. The above
+ example has no upstream functions, therefore \`upstream = dy/dy = 1.0\`.
+
+ Assume that \`x_i\` is \`log1pexp\` in the forward pass \`x_1 = x_1(x_0)\`,
+ \`x_2 = x_2(x_1)\`, ..., \`x_i = x_i(x_i-1)\`, ..., \`x_n = x_n(x_n-1)\`. By
+ chain rule we know that \`dx_n/dx_0 = dx_n/dx_n-1 * dx_n-1/dx_n-2 * ... *
+ dx_i/dx_i-1 * ... * dx_1/dx_0\`.
+
+ In this case the gradient of our current function defined as
+ \`dx_i/dx_i-1 = (1 - 1 / (1 + e))\`. The upstream gradient \`upstream\` would be
+ \`dx_n/dx_n-1 * dx_n-1/dx_n-2 * ... * dx_i+1/dx_i\`. The upstream gradient
+ multiplied by the current gradient is then passed downstream.
+
+ In case the function takes multiple variables as input, the \`grad\`
+ function must also return the same number of variables.
+ We take the function \`z = x * y\` as an example.
+
+ >>> @tf.custom_gradient
+ ... def bar(x, y):
+ ... def grad(upstream):
+ ... dz_dx = y
+ ... dz_dy = x
+ ... return upstream * dz_dx, upstream * dz_dy
+ ... z = x * y
+ ... return z, grad
+ >>> x = tf.constant(2.0, dtype=tf.float32)
+ >>> y = tf.constant(3.0, dtype=tf.float32)
+ >>> with tf.GradientTape(persistent=True) as tape:
+ ... tape.watch(x)
+ ... tape.watch(y)
+ ... z = bar(x, y)
+ >>> z
+ tf.data.Dataset API for input pipelines.',!0,`\`tf.data.Dataset\` API for input pipelines.
+
+See [Importing Data](https://tensorflow.org/guide/data) for an overview.
+
+`],["tf.debugging","description: Public API for tf.debugging namespace.",!0,`Public API for tf.debugging namespace.
+`],["tf.device","description: Specifies the device for ops created/executed in this context.",!1,`Specifies the device for ops created/executed in this context.
+
+ This function specifies the device to be used for ops created/executed in a
+ particular context. Nested contexts will inherit and also create/execute
+ their ops on the specified device. If a specific device is not required,
+ consider not using this function so that a device can be automatically
+ assigned. In general the use of this function is optional. \`device_name\` can
+ be fully specified, as in "/job:worker/task:1/device:cpu:0", or partially
+ specified, containing only a subset of the "/"-separated fields. Any fields
+ which are specified will override device annotations from outer scopes.
+
+ For example:
+
+ \`\`\`python
+ with tf.device('/job:foo'):
+ # ops created here have devices with /job:foo
+ with tf.device('/job:bar/task:0/device:gpu:2'):
+ # ops created here have the fully specified device above
+ with tf.device('/device:gpu:1'):
+ # ops created here have the device '/job:foo/device:gpu:1'
+ \`\`\`
+
+ Args:
+ device_name: The device name to use in the context.
+
+ Returns:
+ A context manager that specifies the default device to use for newly
+ created ops.
+
+ Raises:
+ RuntimeError: If a function is passed in.
+ `],["tf.DeviceSpec","description: Represents a (possibly partial) specification for a TensorFlow device.",!1,`Represents a (possibly partial) specification for a TensorFlow device.
+
+ \`DeviceSpec\`s are used throughout TensorFlow to describe where state is stored
+ and computations occur. Using \`DeviceSpec\` allows you to parse device spec
+ strings to verify their validity, merge them or compose them programmatically.
+
+ Example:
+
+ \`\`\`python
+ # Place the operations on device "GPU:0" in the "ps" job.
+ device_spec = DeviceSpec(job="ps", device_type="GPU", device_index=0)
+ with tf.device(device_spec.to_string()):
+ # Both my_var and squared_var will be placed on /job:ps/device:GPU:0.
+ my_var = tf.Variable(..., name="my_variable")
+ squared_var = tf.square(my_var)
+ \`\`\`
+
+ With eager execution disabled (by default in TensorFlow 1.x and by calling
+ disable_eager_execution() in TensorFlow 2.x), the following syntax
+ can be used:
+
+ \`\`\`python
+ tf.compat.v1.disable_eager_execution()
+
+ # Same as previous
+ device_spec = DeviceSpec(job="ps", device_type="GPU", device_index=0)
+ # No need of .to_string() method.
+ with tf.device(device_spec):
+ my_var = tf.Variable(..., name="my_variable")
+ squared_var = tf.square(my_var)
+ \`\`\`
+
+ If a \`DeviceSpec\` is partially specified, it will be merged with other
+ \`DeviceSpec\`s according to the scope in which it is defined. \`DeviceSpec\`
+ components defined in inner scopes take precedence over those defined in
+ outer scopes.
+
+ \`\`\`python
+ gpu0_spec = DeviceSpec(job="ps", device_type="GPU", device_index=0)
+ with tf.device(DeviceSpec(job="train").to_string()):
+ with tf.device(gpu0_spec.to_string()):
+ # Nodes created here will be assigned to /job:ps/device:GPU:0.
+ with tf.device(DeviceSpec(device_type="GPU", device_index=1).to_string()):
+ # Nodes created here will be assigned to /job:train/device:GPU:1.
+ \`\`\`
+
+ A \`DeviceSpec\` consists of 5 components -- each of
+ which is optionally specified:
+
+ * Job: The job name.
+ * Replica: The replica index.
+ * Task: The task index.
+ * Device type: The device type string (e.g. "CPU" or "GPU").
+ * Device index: The device index.
+ `],["tf.distribute","description: Library for running a computation across multiple devices.",!0,`Library for running a computation across multiple devices.
+
+The intent of this library is that you can write an algorithm in a stylized way
+and it will be usable with a variety of different \`tf.distribute.Strategy\`
+implementations. Each descendant will implement a different strategy for
+distributing the algorithm across multiple devices/machines. Furthermore, these
+changes can be hidden inside the specific layers and other library classes that
+need special treatment to run in a distributed setting, so that most users'
+model definition code can run unchanged. The \`tf.distribute.Strategy\` API works
+the same way with eager and graph execution.
+
+*Guides*
+
+* [TensorFlow v2.x](https://www.tensorflow.org/guide/distributed_training)
+* [TensorFlow v1.x](https://github.com/tensorflow/docs/blob/master/site/en/r1/guide/distribute_strategy.ipynb)
+
+*Tutorials*
+
+* [Distributed Training Tutorials](https://www.tensorflow.org/tutorials/distribute/)
+
+ The tutorials cover how to use \`tf.distribute.Strategy\` to do distributed
+ training with native Keras APIs, custom training loops,
+ and Estimator APIs. They also cover how to save/load model when using
+ \`tf.distribute.Strategy\`.
+
+*Glossary*
+
+* _Data parallelism_ is where we run multiple copies of the model
+ on different slices of the input data. This is in contrast to
+ _model parallelism_ where we divide up a single copy of a model
+ across multiple devices.
+ Note: we only support data parallelism for now, but
+ hope to add support for model parallelism in the future.
+* A _device_ is a CPU or accelerator (e.g. GPUs, TPUs) on some machine that
+ TensorFlow can run operations on (see e.g. \`tf.device\`). You may have multiple
+ devices on a single machine, or be connected to devices on multiple
+ machines. Devices used to run computations are called _worker devices_.
+ Devices used to store variables are _parameter devices_. For some strategies,
+ such as \`tf.distribute.MirroredStrategy\`, the worker and parameter devices
+ will be the same (see mirrored variables below). For others they will be
+ different. For example, \`tf.distribute.experimental.CentralStorageStrategy\`
+ puts the variables on a single device (which may be a worker device or may be
+ the CPU), and \`tf.distribute.experimental.ParameterServerStrategy\` puts the
+ variables on separate machines called _parameter servers_ (see below).
+* A _replica_ is one copy of the model, running on one slice of the
+ input data. Right now each replica is executed on its own
+ worker device, but once we add support for model parallelism
+ a replica may span multiple worker devices.
+* A _host_ is the CPU device on a machine with worker devices, typically
+ used for running input pipelines.
+* A _worker_ is defined to be the physical machine(s) containing the physical
+ devices (e.g. GPUs, TPUs) on which the replicated computation is executed. A
+ worker may contain one or more replicas, but contains at least one
+ replica. Typically one worker will correspond to one machine, but in the case
+ of very large models with model parallelism, one worker may span multiple
+ machines. We typically run one input pipeline per worker, feeding all the
+ replicas on that worker.
+* _Synchronous_, or more commonly _sync_, training is where the updates from
+ each replica are aggregated together before updating the model variables. This
+ is in contrast to _asynchronous_, or _async_ training, where each replica
+ updates the model variables independently. You may also have replicas
+ partitioned into groups which are in sync within each group but async between
+ groups.
+* _Parameter servers_: These are machines that hold a single copy of
+ parameters/variables, used by some strategies (right now just
+ \`tf.distribute.experimental.ParameterServerStrategy\`). All replicas that want
+ to operate on a variable retrieve it at the beginning of a step and send an
+ update to be applied at the end of the step. These can in principle support
+ either sync or async training, but right now we only have support for async
+ training with parameter servers. Compare to
+ \`tf.distribute.experimental.CentralStorageStrategy\`, which puts all variables
+ on a single device on the same machine (and does sync training), and
+ \`tf.distribute.MirroredStrategy\`, which mirrors variables to multiple devices
+ (see below).
+
+* _Replica context_ vs. _Cross-replica context_ vs _Update context_
+
+ A _replica context_ applies
+ when you execute the computation function that was called with \`strategy.run\`.
+ Conceptually, you're in replica context when executing the computation
+ function that is being replicated.
+
+ An _update context_ is entered in a \`tf.distribute.StrategyExtended.update\`
+ call.
+
+ An _cross-replica context_ is entered when you enter a \`strategy.scope\`. This
+ is useful for calling \`tf.distribute.Strategy\` methods which operate across
+ the replicas (like \`reduce_to()\`). By default you start in a _replica context_
+ (the "default single _replica context_") and then some methods can switch you
+ back and forth.
+
+* _Distributed value_: Distributed value is represented by the base class
+ \`tf.distribute.DistributedValues\`. \`tf.distribute.DistributedValues\` is useful
+ to represent values on multiple devices, and it contains a map from replica id
+ to values. Two representative kinds of \`tf.distribute.DistributedValues\` are
+ "PerReplica" and "Mirrored" values.
+
+ "PerReplica" values exist on the worker
+ devices, with a different value for each replica. They are produced by
+ iterating through a distributed dataset returned by
+ \`tf.distribute.Strategy.experimental_distribute_dataset\` and
+ \`tf.distribute.Strategy.distribute_datasets_from_function\`. They
+ are also the typical result returned by
+ \`tf.distribute.Strategy.run\`.
+
+ "Mirrored" values are like "PerReplica" values, except we know that the value
+ on all replicas are the same. We can safely read a "Mirrored" value in a
+ cross-replica context by using the value on any replica.
+
+* _Unwrapping_ and _merging_: Consider calling a function \`fn\` on multiple
+ replicas, like \`strategy.run(fn, args=[w])\` with an
+ argument \`w\` that is a \`tf.distribute.DistributedValues\`. This means \`w\` will
+ have a map taking replica id \`0\` to \`w0\`, replica id \`1\` to \`w1\`, etc.
+ \`strategy.run()\` unwraps \`w\` before calling \`fn\`, so it calls \`fn(w0)\` on
+ device \`d0\`, \`fn(w1)\` on device \`d1\`, etc. It then merges the return
+ values from \`fn()\`, which leads to one common object if the returned values
+ are the same object from every replica, or a \`DistributedValues\` object
+ otherwise.
+
+* _Reductions_ and _all-reduce_: A _reduction_ is a method of aggregating
+ multiple values into one value, like "sum" or "mean". If a strategy is doing
+ sync training, we will perform a reduction on the gradients to a parameter
+ from all replicas before applying the update. _All-reduce_ is an algorithm for
+ performing a reduction on values from multiple devices and making the result
+ available on all of those devices.
+
+* _Mirrored variables_: These are variables that are created on multiple
+ devices, where we keep the variables in sync by applying the same
+ updates to every copy. Mirrored variables are created with
+ \`tf.Variable(...synchronization=tf.VariableSynchronization.ON_WRITE...)\`.
+ Normally they are only used in synchronous training.
+
+* _SyncOnRead variables_
+
+ _SyncOnRead variables_ are created by
+ \`tf.Variable(...synchronization=tf.VariableSynchronization.ON_READ...)\`, and
+ they are created on multiple devices. In replica context, each
+ component variable on the local replica can perform reads and writes without
+ synchronization with each other. When the
+ _SyncOnRead variable_ is read in cross-replica context, the values from
+ component variables are aggregated and returned.
+
+ _SyncOnRead variables_ bring a lot of custom configuration difficulty to the
+ underlying logic, so we do not encourage users to instantiate and use
+ _SyncOnRead variable_ on their own. We have mainly used _SyncOnRead
+ variables_ for use cases such as batch norm and metrics. For performance
+ reasons, we often don't need to keep these statistics in sync every step and
+ they can be accumulated on each replica independently. The only time we want
+ to sync them is reporting or checkpointing, which typically happens in
+ cross-replica context. _SyncOnRead variables_ are also often used by advanced
+ users who want to control when variable values are aggregated. For example,
+ users sometimes want to maintain gradients independently on each replica for a
+ couple of steps without aggregation.
+
+* _Distribute-aware layers_
+
+ Layers are generally called in a replica context, except when defining a
+ Keras functional model. \`tf.distribute.in_cross_replica_context\` will let you
+ determine which case you are in. If in a replica context,
+ the \`tf.distribute.get_replica_context\` function will return the default
+ replica context outside a strategy scope, \`None\` within a strategy scope, and
+ a \`tf.distribute.ReplicaContext\` object inside a strategy scope and within a
+ \`tf.distribute.Strategy.run\` function. The \`ReplicaContext\` object has an
+ \`all_reduce\` method for aggregating across all replicas.
+
+
+Note that we provide a default version of \`tf.distribute.Strategy\` that is
+used when no other strategy is in scope, that provides the same API with
+reasonable default behavior.
+
+`],["tf.dtypes","description: Public API for tf.dtypes namespace.",!0,`Public API for tf.dtypes namespace.
+`],["tf.dynamic_partition","description: Partitions data into num_partitions tensors using indices from partitions.",!1,'Partitions `data` into `num_partitions` tensors using indices from `partitions`.\n\n For each index tuple `js` of size `partitions.ndim`, the slice `data[js, ...]`\n becomes part of `outputs[partitions[js]]`. The slices with `partitions[js] = i`\n are placed in `outputs[i]` in lexicographic order of `js`, and the first\n dimension of `outputs[i]` is the number of entries in `partitions` equal to `i`.\n In detail,\n\n ```python\n outputs[i].shape = [sum(partitions == i)] + data.shape[partitions.ndim:]\n\n outputs[i] = pack([data[js, ...] for js if partitions[js] == i])\n ```\n\n `data.shape` must start with `partitions.shape`.\n\n For example:\n\n ```python\n # Scalar partitions.\n partitions = 1\n num_partitions = 2\n data = [10, 20]\n outputs[0] = [] # Empty with shape [0, 2]\n outputs[1] = [[10, 20]]\n\n # Vector partitions.\n partitions = [0, 0, 1, 1, 0]\n num_partitions = 2\n data = [10, 20, 30, 40, 50]\n outputs[0] = [10, 20, 50]\n outputs[1] = [30, 40]\n ```\n\n See `dynamic_stitch` for an example on how to merge partitions back.\n\n
\n
+
+tf.name_scope(...)s.',!1,`Returns current full name scope specified by \`tf.name_scope(...)\`s.
+
+ For example,
+ \`\`\`python
+ with tf.name_scope("outer"):
+ tf.get_current_name_scope() # "outer"
+
+ with tf.name_scope("inner"):
+ tf.get_current_name_scope() # "outer/inner"
+ \`\`\`
+
+ In other words, \`tf.get_current_name_scope()\` returns the op name prefix that
+ will be prepended to, if an op is created at that place.
+
+ Note that \`@tf.function\` resets the name scope stack as shown below.
+
+ \`\`\`
+ with tf.name_scope("outer"):
+
+ @tf.function
+ def foo(x):
+ with tf.name_scope("inner"):
+ return tf.add(x * x) # Op name is "inner/Add", not "outer/inner/Add"
+ \`\`\`
+ `],["tf.get_logger","description: Return TF logger instance.",!1,"Return TF logger instance."],["tf.get_static_value","description: Returns the constant value of the given tensor, if efficiently calculable.",!1,`Returns the constant value of the given tensor, if efficiently calculable.
+
+ This function attempts to partially evaluate the given tensor, and
+ returns its value as a numpy ndarray if this succeeds.
+
+ Example usage:
+
+ >>> a = tf.constant(10)
+ >>> tf.get_static_value(a)
+ 10
+ >>> b = tf.constant(20)
+ >>> tf.get_static_value(tf.add(a, b))
+ 30
+
+ >>> # \`tf.Variable\` is not supported.
+ >>> c = tf.Variable(30)
+ >>> print(tf.get_static_value(c))
+ None
+
+ Using \`partial\` option is most relevant when calling \`get_static_value\` inside
+ a \`tf.function\`. Setting it to \`True\` will return the results but for the
+ values that cannot be evaluated will be \`None\`. For example:
+
+ \`\`\`python
+ class Foo(object):
+ def __init__(self):
+ self.a = tf.Variable(1)
+ self.b = tf.constant(2)
+
+ @tf.function
+ def bar(self, partial):
+ packed = tf.raw_ops.Pack(values=[self.a, self.b])
+ static_val = tf.get_static_value(packed, partial=partial)
+ tf.print(static_val)
+
+ f = Foo()
+ f.bar(partial=True) # \`array([None, array(2, dtype=int32)], dtype=object)\`
+ f.bar(partial=False) # \`None\`
+ \`\`\`
+
+ Compatibility(V1): If \`constant_value(tensor)\` returns a non-\`None\` result, it
+ will no longer be possible to feed a different value for \`tensor\`. This allows
+ the result of this function to influence the graph that is constructed, and
+ permits static shape optimizations.
+
+ Args:
+ tensor: The Tensor to be evaluated.
+ partial: If True, the returned numpy array is allowed to have partially
+ evaluated values. Values that can't be evaluated will be None.
+
+ Returns:
+ A numpy ndarray containing the constant value of the given \`tensor\`,
+ or None if it cannot be calculated.
+
+ Raises:
+ TypeError: if tensor is not an ops.Tensor.
+ `],["tf.gradients","description: Constructs symbolic derivatives of sum of ys w.r.t. x in xs.",!1,"Constructs symbolic derivatives of sum of `ys` w.r.t. x in `xs`.\n\n `tf.gradients` is only valid in a graph context. In particular,\n it is valid in the context of a `tf.function` wrapper, where code\n is executing as a graph.\n\n `ys` and `xs` are each a `Tensor` or a list of tensors. `grad_ys`\n is a list of `Tensor`, holding the gradients received by the\n `ys`. The list must be the same length as `ys`.\n\n `gradients()` adds ops to the graph to output the derivatives of `ys` with\n respect to `xs`. It returns a list of `Tensor` of length `len(xs)` where\n each tensor is the `sum(dy/dx)` for y in `ys` and for x in `xs`.\n\n `grad_ys` is a list of tensors of the same length as `ys` that holds\n the initial gradients for each y in `ys`. When `grad_ys` is None,\n we fill in a tensor of '1's of the shape of y for each y in `ys`. A\n user can provide their own initial `grad_ys` to compute the\n derivatives using a different initial gradient for each y (e.g., if\n one wanted to weight the gradient differently for each value in\n each y).\n\n `stop_gradients` is a `Tensor` or a list of tensors to be considered constant\n with respect to all `xs`. These tensors will not be backpropagated through,\n as though they had been explicitly disconnected using `stop_gradient`. Among\n other things, this allows computation of partial derivatives as opposed to\n total derivatives. For example:\n\n >>> @tf.function\n ... def example():\n ... a = tf.constant(0.)\n ... b = 2 * a\n ... return tf.gradients(a + b, [a, b], stop_gradients=[a, b])\n >>> example()\n [tf.IndexedSlices.',!1,"Type specification for a `tf.IndexedSlices`."],["tf.init_scope","description: A context manager that lifts ops out of control-flow scopes and function-building graphs.",!1,`A context manager that lifts ops out of control-flow scopes and function-building graphs.
+
+ There is often a need to lift variable initialization ops out of control-flow
+ scopes, function-building graphs, and gradient tapes. Entering an
+ \`init_scope\` is a mechanism for satisfying these desiderata. In particular,
+ entering an \`init_scope\` has three effects:
+
+ (1) All control dependencies are cleared the moment the scope is entered;
+ this is equivalent to entering the context manager returned from
+ \`control_dependencies(None)\`, which has the side-effect of exiting
+ control-flow scopes like \`tf.cond\` and \`tf.while_loop\`.
+
+ (2) All operations that are created while the scope is active are lifted
+ into the lowest context on the \`context_stack\` that is not building a
+ graph function. Here, a context is defined as either a graph or an eager
+ context. Every context switch, i.e., every installation of a graph as
+ the default graph and every switch into eager mode, is logged in a
+ thread-local stack called \`context_switches\`; the log entry for a
+ context switch is popped from the stack when the context is exited.
+ Entering an \`init_scope\` is equivalent to crawling up
+ \`context_switches\`, finding the first context that is not building a
+ graph function, and entering it. A caveat is that if graph mode is
+ enabled but the default graph stack is empty, then entering an
+ \`init_scope\` will simply install a fresh graph as the default one.
+
+ (3) The gradient tape is paused while the scope is active.
+
+ When eager execution is enabled, code inside an init_scope block runs with
+ eager execution enabled even when tracing a \`tf.function\`. For example:
+
+ \`\`\`python
+ tf.compat.v1.enable_eager_execution()
+
+ @tf.function
+ def func():
+ # A function constructs TensorFlow graphs,
+ # it does not execute eagerly.
+ assert not tf.executing_eagerly()
+ with tf.init_scope():
+ # Initialization runs with eager execution enabled
+ assert tf.executing_eagerly()
+ \`\`\`
+
+ Raises:
+ RuntimeError: if graph state is incompatible with this initialization.
+ `],["tf.inside_function",'description: Indicates whether the caller code is executing inside a tf.function.',!1,`Indicates whether the caller code is executing inside a \`tf.function\`.
+
+ Returns:
+ Boolean, True if the caller code is executing inside a \`tf.function\`
+ rather than eagerly.
+
+ Example:
+
+ >>> tf.inside_function()
+ False
+ >>> @tf.function
+ ... def f():
+ ... print(tf.inside_function())
+ >>> f()
+ True
+ `],["tf.io","description: Public API for tf.io namespace.",!0,`Public API for tf.io namespace.
+`],["tf.is_tensor","description: Checks whether x is a TF-native type that can be passed to many TF ops.",!1,"Checks whether `x` is a TF-native type that can be passed to many TF ops.\n\n Use `is_tensor` to differentiate types that can ingested by TensorFlow ops\n without any conversion (e.g., `tf.Tensor`, `tf.SparseTensor`, and\n `tf.RaggedTensor`) from types that need to be converted into tensors before\n they are ingested (e.g., numpy `ndarray` and Python scalars).\n\n For example, in the following code block:\n\n ```python\n if not tf.is_tensor(t):\n t = tf.convert_to_tensor(t)\n return t.shape, t.dtype\n ```\n\n we check to make sure that `t` is a tensor (and convert it if not) before\n accessing its `shape` and `dtype`. (But note that not all TensorFlow native\n types have shapes or dtypes; `tf.data.Dataset` is an example of a TensorFlow\n native type that has neither shape nor dtype.)\n\n Args:\n x: A python object to check.\n\n Returns:\n `True` if `x` is a TensorFlow-native type.\n "],["tf.keras","description: Implementation of the Keras API, the high-level API of TensorFlow.",!0,`Implementation of the Keras API, the high-level API of TensorFlow.
+
+Detailed documentation and user guides are available at
+[keras.io](https://keras.io).
+
+`],["tf.linalg","description: Operations for linear algebra.",!0,`Operations for linear algebra.
+`],["tf.linspace","description: Generates evenly-spaced values in an interval along a given axis.",!1,'Generates evenly-spaced values in an interval along a given axis.\n\n A sequence of `num` evenly-spaced values are generated beginning at `start`\n along a given `axis`.\n If `num > 1`, the values in the sequence increase by\n `(stop - start) / (num - 1)`, so that the last one is exactly `stop`.\n If `num <= 0`, `ValueError` is raised.\n\n Matches\n [np.linspace](https://docs.scipy.org/doc/numpy/reference/generated/numpy.linspace.html)\'s\n behaviour\n except when `num == 0`.\n\n For example:\n\n ```\n tf.linspace(10.0, 12.0, 3, name="linspace") => [ 10.0 11.0 12.0]\n ```\n\n `Start` and `stop` can be tensors of arbitrary size:\n\n >>> tf.linspace([0., 5.], [10., 40.], 5, axis=0)\n tf.experimental.Optional.',!1,`Type specification for \`tf.experimental.Optional\`.
+
+ For instance, \`tf.OptionalSpec\` can be used to define a tf.function that takes
+ \`tf.experimental.Optional\` as an input argument:
+
+ >>> @tf.function(input_signature=[tf.OptionalSpec(
+ ... tf.TensorSpec(shape=(), dtype=tf.int32, name=None))])
+ ... def maybe_square(optional):
+ ... if optional.has_value():
+ ... x = optional.get_value()
+ ... return x * x
+ ... return -1
+ >>> optional = tf.experimental.Optional.from_value(5)
+ >>> print(maybe_square(optional))
+ tf.Tensor(25, shape=(), dtype=int32)
+
+ Attributes:
+ element_spec: A (nested) structure of \`TypeSpec\` objects that represents the
+ type specification of the optional element.
+ `],["tf.pad","description: Pads a tensor.",!1,'Pads a tensor.\n\n This operation pads a `tensor` according to the `paddings` you specify.\n `paddings` is an integer tensor with shape `[n, 2]`, where n is the rank of\n `tensor`. For each dimension D of `input`, `paddings[D, 0]` indicates how\n many values to add before the contents of `tensor` in that dimension, and\n `paddings[D, 1]` indicates how many values to add after the contents of\n `tensor` in that dimension. If `mode` is "REFLECT" then both `paddings[D, 0]`\n and `paddings[D, 1]` must be no greater than `tensor.dim_size(D) - 1`. If\n `mode` is "SYMMETRIC" then both `paddings[D, 0]` and `paddings[D, 1]` must be\n no greater than `tensor.dim_size(D)`.\n\n The padded size of each dimension D of the output is:\n\n `paddings[D, 0] + tensor.dim_size(D) + paddings[D, 1]`\n\n For example:\n\n ```python\n t = tf.constant([[1, 2, 3], [4, 5, 6]])\n paddings = tf.constant([[1, 1,], [2, 2]])\n # \'constant_values\' is 0.\n # rank of \'t\' is 2.\n tf.pad(t, paddings, "CONSTANT") # [[0, 0, 0, 0, 0, 0, 0],\n # [0, 0, 1, 2, 3, 0, 0],\n # [0, 0, 4, 5, 6, 0, 0],\n # [0, 0, 0, 0, 0, 0, 0]]\n\n tf.pad(t, paddings, "REFLECT") # [[6, 5, 4, 5, 6, 5, 4],\n # [3, 2, 1, 2, 3, 2, 1],\n # [6, 5, 4, 5, 6, 5, 4],\n # [3, 2, 1, 2, 3, 2, 1]]\n\n tf.pad(t, paddings, "SYMMETRIC") # [[2, 1, 1, 2, 3, 3, 2],\n # [2, 1, 1, 2, 3, 3, 2],\n # [5, 4, 4, 5, 6, 6, 5],\n # [5, 4, 4, 5, 6, 6, 5]]\n ```\n\n Args:\n tensor: A `Tensor`.\n paddings: A `Tensor` of type `int32`.\n mode: One of "CONSTANT", "REFLECT", or "SYMMETRIC" (case-insensitive)\n constant_values: In "CONSTANT" mode, the scalar pad value to use. Must be\n same type as `tensor`.\n name: A name for the operation (optional).\n\n Returns:\n A `Tensor`. Has the same type as `tensor`.\n\n Raises:\n ValueError: When mode is not one of "CONSTANT", "REFLECT", or "SYMMETRIC".\n '],["tf.parallel_stack","description: Stacks a list of rank-R tensors into one rank-(R+1) tensor in parallel.",!1,`Stacks a list of rank-\`R\` tensors into one rank-\`(R+1)\` tensor in parallel.
+
+ Requires that the shape of inputs be known at graph construction time.
+
+ Packs the list of tensors in \`values\` into a tensor with rank one higher than
+ each tensor in \`values\`, by packing them along the first dimension.
+ Given a list of length \`N\` of tensors of shape \`(A, B, C)\`; the \`output\`
+ tensor will have the shape \`(N, A, B, C)\`.
+
+ For example:
+
+ \`\`\`python
+ x = tf.constant([1, 4])
+ y = tf.constant([2, 5])
+ z = tf.constant([3, 6])
+ tf.parallel_stack([x, y, z]) # [[1, 4], [2, 5], [3, 6]]
+ \`\`\`
+
+ The difference between \`stack\` and \`parallel_stack\` is that \`stack\` requires
+ all the inputs be computed before the operation will begin but doesn't require
+ that the input shapes be known during graph construction.
+
+ \`parallel_stack\` will copy pieces of the input into the output as they become
+ available, in some situations this can provide a performance benefit.
+
+ Unlike \`stack\`, \`parallel_stack\` does NOT support backpropagation.
+
+ This is the opposite of unstack. The numpy equivalent is
+
+ tf.parallel_stack([x, y, z]) = np.asarray([x, y, z])
+
+ @compatibility(eager)
+ parallel_stack is not compatible with eager execution.
+ @end_compatibility
+
+ Args:
+ values: A list of \`Tensor\` objects with the same shape and type.
+ name: A name for this operation (optional).
+
+ Returns:
+ output: A stacked \`Tensor\` with the same type as \`values\`.
+
+ Raises:
+ RuntimeError: if executed in eager mode.
+ `],["tf.print","description: Print the specified inputs.",!1,`Print the specified inputs.
+
+ A TensorFlow operator that prints the specified inputs to a desired
+ output stream or logging level. The inputs may be dense or sparse Tensors,
+ primitive python objects, data structures that contain tensors, and printable
+ Python objects. Printed tensors will recursively show the first and last
+ elements of each dimension to summarize.
+
+ Example:
+ Single-input usage:
+
+ \`\`\`python
+ tensor = tf.range(10)
+ tf.print(tensor, output_stream=sys.stderr)
+ \`\`\`
+
+ (This prints "[0 1 2 ... 7 8 9]" to sys.stderr)
+
+ Multi-input usage:
+
+ \`\`\`python
+ tensor = tf.range(10)
+ tf.print("tensors:", tensor, {2: tensor * 2}, output_stream=sys.stdout)
+ \`\`\`
+
+ (This prints "tensors: [0 1 2 ... 7 8 9] {2: [0 2 4 ... 14 16 18]}" to
+ sys.stdout)
+
+ Changing the input separator:
+ \`\`\`python
+ tensor_a = tf.range(2)
+ tensor_b = tensor_a * 2
+ tf.print(tensor_a, tensor_b, output_stream=sys.stderr, sep=',')
+ \`\`\`
+
+ (This prints "[0 1],[0 2]" to sys.stderr)
+
+ Usage in a \`tf.function\`:
+
+ \`\`\`python
+ @tf.function
+ def f():
+ tensor = tf.range(10)
+ tf.print(tensor, output_stream=sys.stderr)
+ return tensor
+
+ range_tensor = f()
+ \`\`\`
+
+ (This prints "[0 1 2 ... 7 8 9]" to sys.stderr)
+
+ *Compatibility usage in TF 1.x graphs*:
+
+ In graphs manually created outside of \`tf.function\`, this method returns
+ the created TF operator that prints the data. To make sure the
+ operator runs, users need to pass the produced op to
+ \`tf.compat.v1.Session\`'s run method, or to use the op as a control
+ dependency for executed ops by specifying
+ \`with tf.compat.v1.control_dependencies([print_op])\`.
+
+ \`\`\`python
+ tf.compat.v1.disable_v2_behavior() # for TF1 compatibility only
+
+ sess = tf.compat.v1.Session()
+ with sess.as_default():
+ tensor = tf.range(10)
+ print_op = tf.print("tensors:", tensor, {2: tensor * 2},
+ output_stream=sys.stdout)
+ with tf.control_dependencies([print_op]):
+ tripled_tensor = tensor * 3
+
+ sess.run(tripled_tensor)
+ \`\`\`
+
+ (This prints "tensors: [0 1 2 ... 7 8 9] {2: [0 2 4 ... 14 16 18]}" to
+ sys.stdout)
+
+ Note: In Jupyter notebooks and colabs, \`tf.print\` prints to the notebook
+ cell outputs. It will not write to the notebook kernel's console logs.
+
+ Args:
+ *inputs: Positional arguments that are the inputs to print. Inputs in the
+ printed output will be separated by spaces. Inputs may be python
+ primitives, tensors, data structures such as dicts and lists that may
+ contain tensors (with the data structures possibly nested in arbitrary
+ ways), and printable python objects.
+ output_stream: The output stream, logging level, or file to print to.
+ Defaults to sys.stderr, but sys.stdout, tf.compat.v1.logging.info,
+ tf.compat.v1.logging.warning, tf.compat.v1.logging.error,
+ absl.logging.info, absl.logging.warning and absl.logging.error are also
+ supported. To print to a file, pass a string started with "file://"
+ followed by the file path, e.g., "file:///tmp/foo.out".
+ summarize: The first and last \`summarize\` elements within each dimension are
+ recursively printed per Tensor. If None, then the first 3 and last 3
+ elements of each dimension are printed for each tensor. If set to -1, it
+ will print all elements of every tensor.
+ sep: The string to use to separate the inputs. Defaults to " ".
+ end: End character that is appended at the end the printed string. Defaults
+ to the newline character.
+ name: A name for the operation (optional).
+
+ Returns:
+ None when executing eagerly. During graph tracing this returns
+ a TF operator that prints the specified inputs in the specified output
+ stream or logging level. This operator will be automatically executed
+ except inside of \`tf.compat.v1\` graphs and sessions.
+
+ Raises:
+ ValueError: If an unsupported output stream is specified.
+ `],["tf.profiler","description: Public API for tf.profiler namespace.",!0,`Public API for tf.profiler namespace.
+`],["tf.py_function","description: Wraps a python function into a TensorFlow op that executes it eagerly.",!1,"Wraps a python function into a TensorFlow op that executes it eagerly.\n\n This function allows expressing computations in a TensorFlow graph as\n Python functions. In particular, it wraps a Python function `func`\n in a once-differentiable TensorFlow operation that executes it with eager\n execution enabled. As a consequence, `tf.py_function` makes it\n possible to express control flow using Python constructs (`if`, `while`,\n `for`, etc.), instead of TensorFlow control flow constructs (`tf.cond`,\n `tf.while_loop`). For example, you might use `tf.py_function` to\n implement the log huber function:\n\n ```python\n def log_huber(x, m):\n if tf.abs(x) <= m:\n return x**2\n else:\n return m**2 * (1 - 2 * tf.math.log(m) + tf.math.log(x**2))\n\n x = tf.constant(1.0)\n m = tf.constant(2.0)\n\n with tf.GradientTape() as t:\n t.watch([x, m])\n y = tf.py_function(func=log_huber, inp=[x, m], Tout=tf.float32)\n\n dy_dx = t.gradient(y, x)\n assert dy_dx.numpy() == 2.0\n ```\n\n You can also use `tf.py_function` to debug your models at runtime\n using Python tools, i.e., you can isolate portions of your code that\n you want to debug, wrap them in Python functions and insert `pdb` tracepoints\n or print statements as desired, and wrap those functions in\n `tf.py_function`.\n\n For more information on eager execution, see the\n [Eager guide](https://tensorflow.org/guide/eager).\n\n `tf.py_function` is similar in spirit to `tf.compat.v1.py_func`, but unlike\n the latter, the former lets you use TensorFlow operations in the wrapped\n Python function. In particular, while `tf.compat.v1.py_func` only runs on CPUs\n and wraps functions that take NumPy arrays as inputs and return NumPy arrays\n as outputs, `tf.py_function` can be placed on GPUs and wraps functions\n that take Tensors as inputs, execute TensorFlow operations in their bodies,\n and return Tensors as outputs.\n\n Note: We recommend to avoid using `tf.py_function` outside of prototyping\n and experimentation due to the following known limitations:\n\n * Calling `tf.py_function` will acquire the Python Global Interpreter Lock\n (GIL) that allows only one thread to run at any point in time. This will\n preclude efficient parallelization and distribution of the execution of the\n program.\n\n * The body of the function (i.e. `func`) will not be serialized in a\n `GraphDef`. Therefore, you should not use this function if you need to\n serialize your model and restore it in a different environment.\n\n * The operation must run in the same address space as the Python program\n that calls `tf.py_function()`. If you are using distributed\n TensorFlow, you must run a `tf.distribute.Server` in the same process as the\n program that calls `tf.py_function()` and you must pin the created\n operation to a device in that server (e.g. using `with tf.device():`).\n\n * Currently `tf.py_function` is not compatible with XLA. Calling\n `tf.py_function` inside `tf.function(jit_comiple=True)` will raise an\n error.\n\n Args:\n func: A Python function that accepts `inp` as arguments, and returns a\n value (or list of values) whose type is described by `Tout`.\n\n inp: Input arguments for `func`. A list whose elements are `Tensor`s or\n `CompositeTensors` (such as `tf.RaggedTensor`); or a single `Tensor` or\n `CompositeTensor`.\n\n Tout: The type(s) of the value(s) returned by `func`. One of the\n following.\n\n * If `func` returns a `Tensor` (or a value that can be converted to a\n Tensor): the `tf.DType` for that value.\n * If `func` returns a `CompositeTensor`: The `tf.TypeSpec` for that value.\n * If `func` returns `None`: the empty list (`[]`).\n * If `func` returns a list of `Tensor` and `CompositeTensor` values:\n a corresponding list of `tf.DType`s and `tf.TypeSpec`s for each value.\n\n name: A name for the operation (optional).\n\n Returns:\n The value(s) computed by `func`: a `Tensor`, `CompositeTensor`, or list of\n `Tensor` and `CompositeTensor`; or an empty list if `func` returns `None`.\n "],["tf.quantization","description: Public API for tf.quantization namespace.",!0,`Public API for tf.quantization namespace.
+`],["tf.queue","description: Public API for tf.queue namespace.",!0,`Public API for tf.queue namespace.
+`],["tf.ragged","description: Ragged Tensors.",!0,"Ragged Tensors.\n\nThis package defines ops for manipulating ragged tensors (`tf.RaggedTensor`),\nwhich are tensors with non-uniform shapes. In particular, each `RaggedTensor`\nhas one or more *ragged dimensions*, which are dimensions whose slices may have\ndifferent lengths. For example, the inner (column) dimension of\n`rt=[[3, 1, 4, 1], [], [5, 9, 2], [6], []]` is ragged, since the column slices\n(`rt[0, :]`, ..., `rt[4, :]`) have different lengths. For a more detailed\ndescription of ragged tensors, see the `tf.RaggedTensor` class documentation\nand the [Ragged Tensor Guide](/guide/ragged_tensor).\n\n\n### Additional ops that support `RaggedTensor`\n\nArguments that accept `RaggedTensor`s are marked in **bold**.\n\n* `tf.__operators__.eq`(**self**, **other**)\n* `tf.__operators__.ne`(**self**, **other**)\n* `tf.bitcast`(**input**, type, name=`None`)\n* `tf.bitwise.bitwise_and`(**x**, **y**, name=`None`)\n* `tf.bitwise.bitwise_or`(**x**, **y**, name=`None`)\n* `tf.bitwise.bitwise_xor`(**x**, **y**, name=`None`)\n* `tf.bitwise.invert`(**x**, name=`None`)\n* `tf.bitwise.left_shift`(**x**, **y**, name=`None`)\n* `tf.bitwise.right_shift`(**x**, **y**, name=`None`)\n* `tf.broadcast_to`(**input**, **shape**, name=`None`)\n* `tf.cast`(**x**, dtype, name=`None`)\n* `tf.clip_by_value`(**t**, clip_value_min, clip_value_max, name=`None`)\n* `tf.concat`(**values**, axis, name=`'concat'`)\n* `tf.debugging.check_numerics`(**tensor**, message, name=`None`)\n* `tf.dtypes.complex`(**real**, **imag**, name=`None`)\n* `tf.dtypes.saturate_cast`(**value**, dtype, name=`None`)\n* `tf.dynamic_partition`(**data**, **partitions**, num_partitions, name=`None`)\n* `tf.expand_dims`(**input**, axis, name=`None`)\n* `tf.gather_nd`(**params**, **indices**, batch_dims=`0`, name=`None`)\n* `tf.gather`(**params**, **indices**, validate_indices=`None`, axis=`None`, batch_dims=`0`, name=`None`)\n* `tf.image.adjust_brightness`(**image**, delta)\n* `tf.image.adjust_gamma`(**image**, gamma=`1`, gain=`1`)\n* `tf.image.convert_image_dtype`(**image**, dtype, saturate=`False`, name=`None`)\n* `tf.image.random_brightness`(**image**, max_delta, seed=`None`)\n* `tf.image.resize`(**images**, size, method=`'bilinear'`, preserve_aspect_ratio=`False`, antialias=`False`, name=`None`)\n* `tf.image.stateless_random_brightness`(**image**, max_delta, seed)\n* `tf.io.decode_base64`(**input**, name=`None`)\n* `tf.io.decode_compressed`(**bytes**, compression_type=`''`, name=`None`)\n* `tf.io.encode_base64`(**input**, pad=`False`, name=`None`)\n* `tf.linalg.matmul`(**a**, **b**, transpose_a=`False`, transpose_b=`False`, adjoint_a=`False`, adjoint_b=`False`, a_is_sparse=`False`, b_is_sparse=`False`, output_type=`None`, name=`None`)\n* `tf.math.abs`(**x**, name=`None`)\n* `tf.math.acos`(**x**, name=`None`)\n* `tf.math.acosh`(**x**, name=`None`)\n* `tf.math.add_n`(**inputs**, name=`None`)\n* `tf.math.add`(**x**, **y**, name=`None`)\n* `tf.math.angle`(**input**, name=`None`)\n* `tf.math.asin`(**x**, name=`None`)\n* `tf.math.asinh`(**x**, name=`None`)\n* `tf.math.atan2`(**y**, **x**, name=`None`)\n* `tf.math.atan`(**x**, name=`None`)\n* `tf.math.atanh`(**x**, name=`None`)\n* `tf.math.bessel_i0`(**x**, name=`None`)\n* `tf.math.bessel_i0e`(**x**, name=`None`)\n* `tf.math.bessel_i1`(**x**, name=`None`)\n* `tf.math.bessel_i1e`(**x**, name=`None`)\n* `tf.math.ceil`(**x**, name=`None`)\n* `tf.math.conj`(**x**, name=`None`)\n* `tf.math.cos`(**x**, name=`None`)\n* `tf.math.cosh`(**x**, name=`None`)\n* `tf.math.digamma`(**x**, name=`None`)\n* `tf.math.divide_no_nan`(**x**, **y**, name=`None`)\n* `tf.math.divide`(**x**, **y**, name=`None`)\n* `tf.math.equal`(**x**, **y**, name=`None`)\n* `tf.math.erf`(**x**, name=`None`)\n* `tf.math.erfc`(**x**, name=`None`)\n* `tf.math.erfcinv`(**x**, name=`None`)\n* `tf.math.erfinv`(**x**, name=`None`)\n* `tf.math.exp`(**x**, name=`None`)\n* `tf.math.expm1`(**x**, name=`None`)\n* `tf.math.floor`(**x**, name=`None`)\n* `tf.math.floordiv`(**x**, **y**, name=`None`)\n* `tf.math.floormod`(**x**, **y**, name=`None`)\n* `tf.math.greater_equal`(**x**, **y**, name=`None`)\n* `tf.math.greater`(**x**, **y**, name=`None`)\n* `tf.math.imag`(**input**, name=`None`)\n* `tf.math.is_finite`(**x**, name=`None`)\n* `tf.math.is_inf`(**x**, name=`None`)\n* `tf.math.is_nan`(**x**, name=`None`)\n* `tf.math.less_equal`(**x**, **y**, name=`None`)\n* `tf.math.less`(**x**, **y**, name=`None`)\n* `tf.math.lgamma`(**x**, name=`None`)\n* `tf.math.log1p`(**x**, name=`None`)\n* `tf.math.log_sigmoid`(**x**, name=`None`)\n* `tf.math.log`(**x**, name=`None`)\n* `tf.math.logical_and`(**x**, **y**, name=`None`)\n* `tf.math.logical_not`(**x**, name=`None`)\n* `tf.math.logical_or`(**x**, **y**, name=`None`)\n* `tf.math.logical_xor`(**x**, **y**, name=`'LogicalXor'`)\n* `tf.math.maximum`(**x**, **y**, name=`None`)\n* `tf.math.minimum`(**x**, **y**, name=`None`)\n* `tf.math.multiply_no_nan`(**x**, **y**, name=`None`)\n* `tf.math.multiply`(**x**, **y**, name=`None`)\n* `tf.math.ndtri`(**x**, name=`None`)\n* `tf.math.negative`(**x**, name=`None`)\n* `tf.math.nextafter`(**x1**, x2, name=`None`)\n* `tf.math.not_equal`(**x**, **y**, name=`None`)\n* `tf.math.pow`(**x**, **y**, name=`None`)\n* `tf.math.real`(**input**, name=`None`)\n* `tf.math.reciprocal_no_nan`(**x**, name=`None`)\n* `tf.math.reciprocal`(**x**, name=`None`)\n* `tf.math.reduce_all`(**input_tensor**, axis=`None`, keepdims=`False`, name=`None`)\n* `tf.math.reduce_any`(**input_tensor**, axis=`None`, keepdims=`False`, name=`None`)\n* `tf.math.reduce_max`(**input_tensor**, axis=`None`, keepdims=`False`, name=`None`)\n* `tf.math.reduce_mean`(**input_tensor**, axis=`None`, keepdims=`False`, name=`None`)\n* `tf.math.reduce_min`(**input_tensor**, axis=`None`, keepdims=`False`, name=`None`)\n* `tf.math.reduce_prod`(**input_tensor**, axis=`None`, keepdims=`False`, name=`None`)\n* `tf.math.reduce_std`(**input_tensor**, axis=`None`, keepdims=`False`, name=`None`)\n* `tf.math.reduce_sum`(**input_tensor**, axis=`None`, keepdims=`False`, name=`None`)\n* `tf.math.reduce_variance`(**input_tensor**, axis=`None`, keepdims=`False`, name=`None`)\n* `tf.math.rint`(**x**, name=`None`)\n* `tf.math.round`(**x**, name=`None`)\n* `tf.math.rsqrt`(**x**, name=`None`)\n* `tf.math.scalar_mul`(**scalar**, **x**, name=`None`)\n* `tf.math.sigmoid`(**x**, name=`None`)\n* `tf.math.sign`(**x**, name=`None`)\n* `tf.math.sin`(**x**, name=`None`)\n* `tf.math.sinh`(**x**, name=`None`)\n* `tf.math.softplus`(**features**, name=`None`)\n* `tf.math.special.bessel_j0`(**x**, name=`None`)\n* `tf.math.special.bessel_j1`(**x**, name=`None`)\n* `tf.math.special.bessel_k0`(**x**, name=`None`)\n* `tf.math.special.bessel_k0e`(**x**, name=`None`)\n* `tf.math.special.bessel_k1`(**x**, name=`None`)\n* `tf.math.special.bessel_k1e`(**x**, name=`None`)\n* `tf.math.special.bessel_y0`(**x**, name=`None`)\n* `tf.math.special.bessel_y1`(**x**, name=`None`)\n* `tf.math.special.dawsn`(**x**, name=`None`)\n* `tf.math.special.expint`(**x**, name=`None`)\n* `tf.math.special.fresnel_cos`(**x**, name=`None`)\n* `tf.math.special.fresnel_sin`(**x**, name=`None`)\n* `tf.math.special.spence`(**x**, name=`None`)\n* `tf.math.sqrt`(**x**, name=`None`)\n* `tf.math.square`(**x**, name=`None`)\n* `tf.math.squared_difference`(**x**, **y**, name=`None`)\n* `tf.math.subtract`(**x**, **y**, name=`None`)\n* `tf.math.tan`(**x**, name=`None`)\n* `tf.math.tanh`(**x**, name=`None`)\n* `tf.math.truediv`(**x**, **y**, name=`None`)\n* `tf.math.unsorted_segment_max`(**data**, **segment_ids**, num_segments, name=`None`)\n* `tf.math.unsorted_segment_mean`(**data**, **segment_ids**, num_segments, name=`None`)\n* `tf.math.unsorted_segment_min`(**data**, **segment_ids**, num_segments, name=`None`)\n* `tf.math.unsorted_segment_prod`(**data**, **segment_ids**, num_segments, name=`None`)\n* `tf.math.unsorted_segment_sqrt_n`(**data**, **segment_ids**, num_segments, name=`None`)\n* `tf.math.unsorted_segment_sum`(**data**, **segment_ids**, num_segments, name=`None`)\n* `tf.math.xdivy`(**x**, **y**, name=`None`)\n* `tf.math.xlog1py`(**x**, **y**, name=`None`)\n* `tf.math.xlogy`(**x**, **y**, name=`None`)\n* `tf.math.zeta`(**x**, **q**, name=`None`)\n* `tf.nn.dropout`(**x**, rate, noise_shape=`None`, seed=`None`, name=`None`)\n* `tf.nn.elu`(**features**, name=`None`)\n* `tf.nn.gelu`(**features**, approximate=`False`, name=`None`)\n* `tf.nn.leaky_relu`(**features**, alpha=`0.2`, name=`None`)\n* `tf.nn.relu6`(**features**, name=`None`)\n* `tf.nn.relu`(**features**, name=`None`)\n* `tf.nn.selu`(**features**, name=`None`)\n* `tf.nn.sigmoid_cross_entropy_with_logits`(**labels**=`None`, **logits**=`None`, name=`None`)\n* `tf.nn.silu`(**features**, beta=`1.0`)\n* `tf.nn.softmax`(**logits**, axis=`None`, name=`None`)\n* `tf.nn.softsign`(**features**, name=`None`)\n* `tf.one_hot`(**indices**, depth, on_value=`None`, off_value=`None`, axis=`None`, dtype=`None`, name=`None`)\n* `tf.ones_like`(**input**, dtype=`None`, name=`None`)\n* `tf.print`(***inputs**, **kwargs)\n* `tf.rank`(**input**, name=`None`)\n* `tf.realdiv`(**x**, **y**, name=`None`)\n* `tf.reshape`(**tensor**, **shape**, name=`None`)\n* `tf.reverse`(**tensor**, axis, name=`None`)\n* `tf.size`(**input**, out_type=`tf.int32`, name=`None`)\n* `tf.split`(**value**, num_or_size_splits, axis=`0`, num=`None`, name=`'split'`)\n* `tf.squeeze`(**input**, axis=`None`, name=`None`)\n* `tf.stack`(**values**, axis=`0`, name=`'stack'`)\n* `tf.strings.as_string`(**input**, precision=`-1`, scientific=`False`, shortest=`False`, width=`-1`, fill=`''`, name=`None`)\n* `tf.strings.format`(**template**, **inputs**, placeholder=`'{}'`, summarize=`3`, name=`None`)\n* `tf.strings.join`(**inputs**, separator=`''`, name=`None`)\n* `tf.strings.length`(**input**, unit=`'BYTE'`, name=`None`)\n* `tf.strings.lower`(**input**, encoding=`''`, name=`None`)\n* `tf.strings.reduce_join`(**inputs**, axis=`None`, keepdims=`False`, separator=`''`, name=`None`)\n* `tf.strings.regex_full_match`(**input**, pattern, name=`None`)\n* `tf.strings.regex_replace`(**input**, pattern, rewrite, replace_global=`True`, name=`None`)\n* `tf.strings.strip`(**input**, name=`None`)\n* `tf.strings.substr`(**input**, pos, len, unit=`'BYTE'`, name=`None`)\n* `tf.strings.to_hash_bucket_fast`(**input**, num_buckets, name=`None`)\n* `tf.strings.to_hash_bucket_strong`(**input**, num_buckets, key, name=`None`)\n* `tf.strings.to_hash_bucket`(**input**, num_buckets, name=`None`)\n* `tf.strings.to_number`(**input**, out_type=`tf.float32`, name=`None`)\n* `tf.strings.unicode_script`(**input**, name=`None`)\n* `tf.strings.unicode_transcode`(**input**, input_encoding, output_encoding, errors=`'replace'`, replacement_char=`65533`, replace_control_characters=`False`, name=`None`)\n* `tf.strings.upper`(**input**, encoding=`''`, name=`None`)\n* `tf.tile`(**input**, multiples, name=`None`)\n* `tf.truncatediv`(**x**, **y**, name=`None`)\n* `tf.truncatemod`(**x**, **y**, name=`None`)\n* `tf.where`(**condition**, **x**=`None`, **y**=`None`, name=`None`)\n* `tf.zeros_like`(**input**, dtype=`None`, name=`None`)n\n"],["tf.RaggedTensor","description: Represents a ragged tensor.",!1,`Represents a ragged tensor.
+
+ A \`RaggedTensor\` is a tensor with one or more *ragged dimensions*, which are
+ dimensions whose slices may have different lengths. For example, the inner
+ (column) dimension of \`rt=[[3, 1, 4, 1], [], [5, 9, 2], [6], []]\` is ragged,
+ since the column slices (\`rt[0, :]\`, ..., \`rt[4, :]\`) have different lengths.
+ Dimensions whose slices all have the same length are called *uniform
+ dimensions*. The outermost dimension of a \`RaggedTensor\` is always uniform,
+ since it consists of a single slice (and so there is no possibility for
+ differing slice lengths).
+
+ The total number of dimensions in a \`RaggedTensor\` is called its *rank*,
+ and the number of ragged dimensions in a \`RaggedTensor\` is called its
+ *ragged-rank*. A \`RaggedTensor\`'s ragged-rank is fixed at graph creation
+ time: it can't depend on the runtime values of \`Tensor\`s, and can't vary
+ dynamically for different session runs.
+
+ Note that the \`__init__\` constructor is private. Please use one of the
+ following methods to construct a \`RaggedTensor\`:
+
+ * \`tf.RaggedTensor.from_row_lengths\`
+ * \`tf.RaggedTensor.from_value_rowids\`
+ * \`tf.RaggedTensor.from_row_splits\`
+ * \`tf.RaggedTensor.from_row_starts\`
+ * \`tf.RaggedTensor.from_row_limits\`
+ * \`tf.RaggedTensor.from_nested_row_splits\`
+ * \`tf.RaggedTensor.from_nested_row_lengths\`
+ * \`tf.RaggedTensor.from_nested_value_rowids\`
+
+ ### Potentially Ragged Tensors
+
+ Many ops support both \`Tensor\`s and \`RaggedTensor\`s
+ (see [tf.ragged](https://www.tensorflow.org/api_docs/python/tf/ragged) for a
+ full listing). The term "potentially ragged tensor" may be used to refer to a
+ tensor that might be either a \`Tensor\` or a \`RaggedTensor\`. The ragged-rank
+ of a \`Tensor\` is zero.
+
+ ### Documenting RaggedTensor Shapes
+
+ When documenting the shape of a RaggedTensor, ragged dimensions can be
+ indicated by enclosing them in parentheses. For example, the shape of
+ a 3-D \`RaggedTensor\` that stores the fixed-size word embedding for each
+ word in a sentence, for each sentence in a batch, could be written as
+ \`[num_sentences, (num_words), embedding_size]\`. The parentheses around
+ \`(num_words)\` indicate that dimension is ragged, and that the length
+ of each element list in that dimension may vary for each item.
+
+ ### Component Tensors
+
+ Internally, a \`RaggedTensor\` consists of a concatenated list of values that
+ are partitioned into variable-length rows. In particular, each \`RaggedTensor\`
+ consists of:
+
+ * A \`values\` tensor, which concatenates the variable-length rows into a
+ flattened list. For example, the \`values\` tensor for
+ \`[[3, 1, 4, 1], [], [5, 9, 2], [6], []]\` is \`[3, 1, 4, 1, 5, 9, 2, 6]\`.
+
+ * A \`row_splits\` vector, which indicates how those flattened values are
+ divided into rows. In particular, the values for row \`rt[i]\` are stored
+ in the slice \`rt.values[rt.row_splits[i]:rt.row_splits[i+1]]\`.
+
+ Example:
+
+ >>> print(tf.RaggedTensor.from_row_splits(
+ ... values=[3, 1, 4, 1, 5, 9, 2, 6],
+ ... row_splits=[0, 4, 4, 7, 8, 8]))
+ tf.RaggedTensor.',!1,"Type specification for a `tf.RaggedTensor`."],["tf.random","description: Public API for tf.random namespace.",!0,`Public API for tf.random namespace.
+`],["tf.random_index_shuffle","description: Outputs the position of value in a permutation of [0, ..., max_index].",!1,"Outputs the position of `value` in a permutation of [0, ..., max_index].\n\n Output values are a bijection of the `index` for any combination and `seed` and `max_index`.\n\n If multiple inputs are vectors (matrix in case of seed) then the size of the\n first dimension must match.\n\n The outputs are deterministic.\n\n Args:\n index: A `Tensor`. Must be one of the following types: `int32`, `uint32`, `int64`, `uint64`.\n A scalar tensor or a vector of dtype `dtype`. The index (or indices) to be shuffled. Must be within [0, max_index].\n seed: A `Tensor`. Must be one of the following types: `int32`, `uint32`, `int64`, `uint64`.\n A tensor of dtype `Tseed` and shape [3] or [n, 3]. The random seed.\n max_index: A `Tensor`. Must have the same type as `index`.\n A scalar tensor or vector of dtype `dtype`. The upper bound(s) of the interval (inclusive).\n name: A name for the operation (optional).\n\n Returns:\n A `Tensor`. Has the same type as `index`.\n "],["tf.random_normal_initializer","description: Initializer that generates tensors with a normal distribution.",!1,`Initializer that generates tensors with a normal distribution.
+
+ Initializers allow you to pre-specify an initialization strategy, encoded in
+ the Initializer object, without knowing the shape and dtype of the variable
+ being initialized.
+
+ Examples:
+
+ >>> def make_variables(k, initializer):
+ ... return (tf.Variable(initializer(shape=[k], dtype=tf.float32)),
+ ... tf.Variable(initializer(shape=[k, k], dtype=tf.float32)))
+ >>> v1, v2 = make_variables(3,
+ ... tf.random_normal_initializer(mean=1., stddev=2.))
+ >>> v1
+
+
+ tf.sparse.SparseTensor.',!1,"Type specification for a `tf.sparse.SparseTensor`."],["tf.split","description: Splits a tensor value into a list of sub tensors.",!1,"Splits a tensor `value` into a list of sub tensors.\n\n See also `tf.unstack`.\n\n If `num_or_size_splits` is an `int`, then it splits `value` along the\n dimension `axis` into `num_or_size_splits` smaller tensors. This requires that\n `value.shape[axis]` is divisible by `num_or_size_splits`.\n\n If `num_or_size_splits` is a 1-D Tensor (or list), then `value` is split into\n `len(num_or_size_splits)` elements. The shape of the `i`-th\n element has the same size as the `value` except along dimension `axis` where\n the size is `num_or_size_splits[i]`.\n\n For example:\n\n >>> x = tf.Variable(tf.random.uniform([5, 30], -1, 1))\n >>>\n >>> # Split `x` into 3 tensors along dimension 1\n >>> s0, s1, s2 = tf.split(x, num_or_size_splits=3, axis=1)\n >>> tf.shape(s0).numpy()\n array([ 5, 10], dtype=int32)\n >>>\n >>> # Split `x` into 3 tensors with sizes [4, 15, 11] along dimension 1\n >>> split0, split1, split2 = tf.split(x, [4, 15, 11], 1)\n >>> tf.shape(split0).numpy()\n array([5, 4], dtype=int32)\n >>> tf.shape(split1).numpy()\n array([ 5, 15], dtype=int32)\n >>> tf.shape(split2).numpy()\n array([ 5, 11], dtype=int32)\n\n Args:\n value: The `Tensor` to split.\n num_or_size_splits: Either an `int` indicating the number of splits\n along `axis` or a 1-D integer `Tensor` or Python list containing the sizes\n of each output tensor along `axis`. If an `int`, then it must evenly\n divide `value.shape[axis]`; otherwise the sum of sizes along the split\n axis must match that of the `value`.\n axis: An `int` or scalar `int32` `Tensor`. The dimension along which\n to split. Must be in the range `[-rank(value), rank(value))`. Defaults to\n 0.\n num: Optional, an `int`, used to specify the number of outputs when it\n cannot be inferred from the shape of `size_splits`.\n name: A name for the operation (optional).\n\n Returns:\n if `num_or_size_splits` is an `int` returns a list of\n `num_or_size_splits` `Tensor` objects; if `num_or_size_splits` is a 1-D\n list or 1-D `Tensor` returns `num_or_size_splits.get_shape[0]`\n `Tensor` objects resulting from splitting `value`.\n\n Raises:\n ValueError: If `num` is unspecified and cannot be inferred.\n ValueError: If `num_or_size_splits` is a scalar `Tensor`.\n "],["tf.squeeze","description: Removes dimensions of size 1 from the shape of a tensor.",!1,"Removes dimensions of size 1 from the shape of a tensor.\n\n Given a tensor `input`, this operation returns a tensor of the same type with\n all dimensions of size 1 removed. If you don't want to remove all size 1\n dimensions, you can remove specific size 1 dimensions by specifying\n `axis`.\n\n For example:\n\n ```python\n # 't' is a tensor of shape [1, 2, 1, 3, 1, 1]\n tf.shape(tf.squeeze(t)) # [2, 3]\n ```\n\n Or, to remove specific size 1 dimensions:\n\n ```python\n # 't' is a tensor of shape [1, 2, 1, 3, 1, 1]\n tf.shape(tf.squeeze(t, [2, 4])) # [1, 2, 3, 1]\n ```\n\n Unlike the older op `tf.compat.v1.squeeze`, this op does not accept a\n deprecated `squeeze_dims` argument.\n\n Note: if `input` is a `tf.RaggedTensor`, then this operation takes `O(N)`\n time, where `N` is the number of elements in the squeezed dimensions.\n\n Args:\n input: A `Tensor`. The `input` to squeeze.\n axis: An optional list of `ints`. Defaults to `[]`. If specified, only\n squeezes the dimensions listed. The dimension index starts at 0. It is an\n error to squeeze a dimension that is not 1. Must be in the range\n `[-rank(input), rank(input))`. Must be specified if `input` is a\n `RaggedTensor`.\n name: A name for the operation (optional).\n\n Returns:\n A `Tensor`. Has the same type as `input`.\n Contains the same data as `input`, but has one or more dimensions of\n size 1 removed.\n\n Raises:\n ValueError: The input cannot be converted to a tensor, or the specified\n axis cannot be squeezed.\n "],["tf.stack","description: Stacks a list of rank-R tensors into one rank-(R+1) tensor.",!1,"Stacks a list of rank-`R` tensors into one rank-`(R+1)` tensor.\n\n See also `tf.concat`, `tf.tile`, `tf.repeat`.\n\n Packs the list of tensors in `values` into a tensor with rank one higher than\n each tensor in `values`, by packing them along the `axis` dimension.\n Given a list of length `N` of tensors of shape `(A, B, C)`;\n\n if `axis == 0` then the `output` tensor will have the shape `(N, A, B, C)`.\n if `axis == 1` then the `output` tensor will have the shape `(A, N, B, C)`.\n Etc.\n\n For example:\n\n >>> x = tf.constant([1, 4])\n >>> y = tf.constant([2, 5])\n >>> z = tf.constant([3, 6])\n >>> tf.stack([x, y, z])\n tf.Tensor represents a multidimensional array of elements.',!1,`A \`tf.Tensor\` represents a multidimensional array of elements.
+
+ All elements are of a single known data type.
+
+ When writing a TensorFlow program, the main object that is
+ manipulated and passed around is the \`tf.Tensor\`.
+
+ A \`tf.Tensor\` has the following properties:
+
+ * a single data type (float32, int32, or string, for example)
+ * a shape
+
+ TensorFlow supports eager execution and graph execution. In eager
+ execution, operations are evaluated immediately. In graph
+ execution, a computational graph is constructed for later
+ evaluation.
+
+ TensorFlow defaults to eager execution. In the example below, the
+ matrix multiplication results are calculated immediately.
+
+ >>> # Compute some values using a Tensor
+ >>> c = tf.constant([[1.0, 2.0], [3.0, 4.0]])
+ >>> d = tf.constant([[1.0, 1.0], [0.0, 1.0]])
+ >>> e = tf.matmul(c, d)
+ >>> print(e)
+ tf.Tensor(
+ [[1. 3.]
+ [3. 7.]], shape=(2, 2), dtype=float32)
+
+ Note that during eager execution, you may discover your \`Tensors\` are actually
+ of type \`EagerTensor\`. This is an internal detail, but it does give you
+ access to a useful function, \`numpy\`:
+
+ >>> type(e)
+ tf.TensorArray.',!1,"Type specification for a `tf.TensorArray`."],["tf.tensordot","description: Tensor contraction of a and b along specified axes and outer product.",!1,"Tensor contraction of a and b along specified axes and outer product.\n\n Tensordot (also known as tensor contraction) sums the product of elements\n from `a` and `b` over the indices specified by `axes`.\n\n This operation corresponds to `numpy.tensordot(a, b, axes)`.\n\n Example 1: When `a` and `b` are matrices (order 2), the case `axes=1`\n is equivalent to matrix multiplication.\n\n Example 2: When `a` and `b` are matrices (order 2), the case\n `axes = [[1], [0]]` is equivalent to matrix multiplication.\n\n Example 3: When `a` and `b` are matrices (order 2), the case `axes=0` gives\n the outer product, a tensor of order 4.\n\n Example 4: Suppose that \\\\(a_{ijk}\\\\) and \\\\(b_{lmn}\\\\) represent two\n tensors of order 3. Then, `contract(a, b, [[0], [2]])` is the order 4 tensor\n \\\\(c_{jklm}\\\\) whose entry\n corresponding to the indices \\\\((j,k,l,m)\\\\) is given by:\n\n \\\\( c_{jklm} = \\sum_i a_{ijk} b_{lmi} \\\\).\n\n In general, `order(c) = order(a) + order(b) - 2*len(axes[0])`.\n\n Args:\n a: `Tensor` of type `float32` or `float64`.\n b: `Tensor` with the same type as `a`.\n axes: Either a scalar `N`, or a list or an `int32` `Tensor` of shape [2, k].\n If axes is a scalar, sum over the last N axes of a and the first N axes of\n b in order. If axes is a list or `Tensor` the first and second row contain\n the set of unique integers specifying axes along which the contraction is\n computed, for `a` and `b`, respectively. The number of axes for `a` and\n `b` must be equal. If `axes=0`, computes the outer product between `a` and\n `b`.\n name: A name for the operation (optional).\n\n Returns:\n A `Tensor` with the same type as `a`.\n\n Raises:\n ValueError: If the shapes of `a`, `b`, and `axes` are incompatible.\n IndexError: If the values in axes exceed the rank of the corresponding\n tensor.\n "],["tf.TensorShape","description: Represents the shape of a Tensor.",!1,'Represents the shape of a `Tensor`.\n\n A `TensorShape` represents a possibly-partial shape specification for a\n `Tensor`. It may be one of the following:\n\n * *Fully-known shape:* has a known number of dimensions and a known size\n for each dimension. e.g. `TensorShape([16, 256])`\n * *Partially-known shape:* has a known number of dimensions, and an unknown\n size for one or more dimension. e.g. `TensorShape([None, 256])`\n * *Unknown shape:* has an unknown number of dimensions, and an unknown\n size in all dimensions. e.g. `TensorShape(None)`\n\n If a tensor is produced by an operation of type `"Foo"`, its shape\n may be inferred if there is a registered shape function for\n `"Foo"`. See [Shape\n functions](https://www.tensorflow.org/guide/create_op#shape_functions_in_c)\n for details of shape functions and how to register them. Alternatively,\n you may set the shape explicitly using `tf.Tensor.set_shape`.\n '],["tf.TensorSpec","description: Describes a tf.Tensor.",!1,`Describes a tf.Tensor.
+
+ Metadata for describing the \`tf.Tensor\` objects accepted or returned
+ by some TensorFlow APIs.
+ `],["tf.tensor_scatter_nd_add","description: Adds sparse updates to an existing tensor according to indices.",!1,`Adds sparse \`updates\` to an existing tensor according to \`indices\`.
+
+ This operation creates a new tensor by adding sparse \`updates\` to the passed
+ in \`tensor\`.
+ This operation is very similar to \`tf.compat.v1.scatter_nd_add\`, except that the
+ updates are added onto an existing tensor (as opposed to a variable). If the
+ memory for the existing tensor cannot be re-used, a copy is made and updated.
+
+ \`indices\` is an integer tensor containing indices into a new tensor of shape
+ \`tensor.shape\`. The last dimension of \`indices\` can be at most the rank of
+ \`tensor.shape\`:
+
+ \`\`\`
+ indices.shape[-1] <= tensor.shape.rank
+ \`\`\`
+
+ The last dimension of \`indices\` corresponds to indices into elements
+ (if \`indices.shape[-1] = tensor.shape.rank\`) or slices
+ (if \`indices.shape[-1] < tensor.shape.rank\`) along dimension
+ \`indices.shape[-1]\` of \`tensor.shape\`. \`updates\` is a tensor with shape
+
+ \`\`\`
+ indices.shape[:-1] + tensor.shape[indices.shape[-1]:]
+ \`\`\`
+
+ The simplest form of \`tensor_scatter_nd_add\` is to add individual elements to a
+ tensor by index. For example, say we want to add 4 elements in a rank-1
+ tensor with 8 elements.
+
+ In Python, this scatter add operation would look like this:
+
+ >>> indices = tf.constant([[4], [3], [1], [7]])
+ >>> updates = tf.constant([9, 10, 11, 12])
+ >>> tensor = tf.ones([8], dtype=tf.int32)
+ >>> updated = tf.tensor_scatter_nd_add(tensor, indices, updates)
+ >>> updated
+
+ tf.TypeSpec that represents the given value.',!1,`Returns a \`tf.TypeSpec\` that represents the given \`value\`.
+
+ Examples:
+
+ >>> tf.type_spec_from_value(tf.constant([1, 2, 3]))
+ TensorSpec(shape=(3,), dtype=tf.int32, name=None)
+ >>> tf.type_spec_from_value(np.array([4.0, 5.0], np.float64))
+ TensorSpec(shape=(2,), dtype=tf.float64, name=None)
+ >>> tf.type_spec_from_value(tf.ragged.constant([[1, 2], [3, 4, 5]]))
+ RaggedTensorSpec(TensorShape([2, None]), tf.int32, 1, tf.int64)
+
+ >>> example_input = tf.ragged.constant([[1, 2], [3]])
+ >>> @tf.function(input_signature=[tf.type_spec_from_value(example_input)])
+ ... def f(x):
+ ... return tf.reduce_sum(x, axis=1)
+
+ Args:
+ value: A value that can be accepted or returned by TensorFlow APIs. Accepted
+ types for \`value\` include \`tf.Tensor\`, any value that can be converted to
+ \`tf.Tensor\` using \`tf.convert_to_tensor\`, and any subclass of
+ \`CompositeTensor\` (such as \`tf.RaggedTensor\`).
+
+ Returns:
+ A \`TypeSpec\` that is compatible with \`value\`.
+
+ Raises:
+ TypeError: If a TypeSpec cannot be built for \`value\`, because its type
+ is not supported.
+ `],["tf.UnconnectedGradients","description: Controls how gradient computation behaves when y does not depend on x.",!1,`Controls how gradient computation behaves when y does not depend on x.
+
+ The gradient of y with respect to x can be zero in two different ways: there
+ could be no differentiable path in the graph connecting x to y (and so we can
+ statically prove that the gradient is zero) or it could be that runtime values
+ of tensors in a particular execution lead to a gradient of zero (say, if a
+ relu unit happens to not be activated). To allow you to distinguish between
+ these two cases you can choose what value gets returned for the gradient when
+ there is no path in the graph from x to y:
+
+ * \`NONE\`: Indicates that [None] will be returned if there is no path from x
+ to y
+ * \`ZERO\`: Indicates that a zero tensor will be returned in the shape of x.
+ `],["tf.unique","description: Finds unique elements in a 1-D tensor.",!1,"Finds unique elements in a 1-D tensor.\n\n This operation returns a tensor `y` containing all of the unique elements of `x`\n sorted in the same order that they occur in `x`; `x` does not need to be sorted.\n This operation also returns a tensor `idx` the same size as `x` that contains\n the index of each value of `x` in the unique output `y`. In other words:\n\n `y[idx[i]] = x[i] for i in [0, 1,...,rank(x) - 1]`\n\n Examples:\n\n ```\n # tensor 'x' is [1, 1, 2, 4, 4, 4, 7, 8, 8]\n y, idx = unique(x)\n y ==> [1, 2, 4, 7, 8]\n idx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4]\n ```\n\n ```\n # tensor 'x' is [4, 5, 1, 2, 3, 3, 4, 5]\n y, idx = unique(x)\n y ==> [4, 5, 1, 2, 3]\n idx ==> [0, 1, 2, 3, 4, 4, 0, 1]\n ```\n\n Args:\n x: A `Tensor`. 1-D.\n out_idx: An optional `tf.DType` from: `tf.int32, tf.int64`. Defaults to `tf.int32`.\n name: A name for the operation (optional).\n\n Returns:\n A tuple of `Tensor` objects (y, idx).\n\n y: A `Tensor`. Has the same type as `x`.\n idx: A `Tensor` of type `out_idx`.\n "],["tf.unique_with_counts","description: Finds unique elements in a 1-D tensor.",!1,"Finds unique elements in a 1-D tensor.\n\n This operation returns a tensor `y` containing all of the unique elements of `x`\n sorted in the same order that they occur in `x`. This operation also returns a\n tensor `idx` the same size as `x` that contains the index of each value of `x`\n in the unique output `y`. Finally, it returns a third tensor `count` that\n contains the count of each element of `y` in `x`. In other words:\n\n `y[idx[i]] = x[i] for i in [0, 1,...,rank(x) - 1]`\n\n For example:\n\n ```\n # tensor 'x' is [1, 1, 2, 4, 4, 4, 7, 8, 8]\n y, idx, count = unique_with_counts(x)\n y ==> [1, 2, 4, 7, 8]\n idx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4]\n count ==> [2, 1, 3, 1, 2]\n ```\n\n Args:\n x: A `Tensor`. 1-D.\n out_idx: An optional `tf.DType` from: `tf.int32, tf.int64`. Defaults to `tf.int32`.\n name: A name for the operation (optional).\n\n Returns:\n A tuple of `Tensor` objects (y, idx, count).\n\n y: A `Tensor`. Has the same type as `x`.\n idx: A `Tensor` of type `out_idx`.\n count: A `Tensor` of type `out_idx`.\n "],["tf.unravel_index","description: Converts an array of flat indices into a tuple of coordinate arrays.",!1,`Converts an array of flat indices into a tuple of coordinate arrays.
+
+
+ Example:
+
+ \`\`\`
+ y = tf.unravel_index(indices=[2, 5, 7], dims=[3, 3])
+ # 'dims' represent a hypothetical (3, 3) tensor of indices:
+ # [[0, 1, *2*],
+ # [3, 4, *5*],
+ # [6, *7*, 8]]
+ # For each entry from 'indices', this operation returns
+ # its coordinates (marked with '*'), such as
+ # 2 ==> (0, 2)
+ # 5 ==> (1, 2)
+ # 7 ==> (2, 1)
+ y ==> [[0, 1, 2], [2, 2, 1]]
+ \`\`\`
+
+ @compatibility(numpy)
+ Equivalent to np.unravel_index
+ @end_compatibility
+
+ Args:
+ indices: A \`Tensor\`. Must be one of the following types: \`int32\`, \`int64\`.
+ An 0-D or 1-D \`int\` Tensor whose elements are indices into the
+ flattened version of an array of dimensions dims.
+ dims: A \`Tensor\`. Must have the same type as \`indices\`.
+ An 1-D \`int\` Tensor. The shape of the array to use for unraveling
+ indices.
+ name: A name for the operation (optional).
+
+ Returns:
+ A \`Tensor\`. Has the same type as \`indices\`.
+ `],["tf.unstack","description: Unpacks the given dimension of a rank-R tensor into rank-(R-1) tensors.",!1,`Unpacks the given dimension of a rank-\`R\` tensor into rank-\`(R-1)\` tensors.
+
+ Unpacks tensors from \`value\` by chipping it along the \`axis\` dimension.
+
+ >>> x = tf.reshape(tf.range(12), (3,4))
+ >>>
+ >>> p, q, r = tf.unstack(x)
+ >>> p.shape.as_list()
+ [4]
+
+ >>> i, j, k, l = tf.unstack(x, axis=1)
+ >>> i.shape.as_list()
+ [3]
+
+ This is the opposite of stack.
+
+ >>> x = tf.stack([i, j, k, l], axis=1)
+
+ More generally if you have a tensor of shape \`(A, B, C, D)\`:
+
+ >>> A, B, C, D = [2, 3, 4, 5]
+ >>> t = tf.random.normal(shape=[A, B, C, D])
+
+ The number of tensor returned is equal to the length of the target \`axis\`:
+
+ >>> axis = 2
+ >>> items = tf.unstack(t, axis=axis)
+ >>> len(items) == t.shape[axis]
+ True
+
+ The shape of each result tensor is equal to the shape of the input tensor,
+ with the target \`axis\` removed.
+
+ >>> items[0].shape.as_list() # [A, B, D]
+ [2, 3, 5]
+
+ The value of each tensor \`items[i]\` is equal to the slice of \`input\` across
+ \`axis\` at index \`i\`:
+
+ >>> for i in range(len(items)):
+ ... slice = t[:,:,i,:]
+ ... assert tf.reduce_all(slice == items[i])
+
+ #### Python iterable unpacking
+
+ With eager execution you _can_ unstack the 0th axis of a tensor using python's
+ iterable unpacking:
+
+ >>> t = tf.constant([1,2,3])
+ >>> a,b,c = t
+
+ \`unstack\` is still necessary because Iterable unpacking doesn't work in
+ a \`@tf.function\`: Symbolic tensors are not iterable.
+
+ You need to use \`tf.unstack\` here:
+
+ >>> @tf.function
+ ... def bad(t):
+ ... a,b,c = t
+ ... return a
+ >>>
+ >>> bad(t)
+ Traceback (most recent call last):
+ ...
+ OperatorNotAllowedInGraphError: ...
+
+ >>> @tf.function
+ ... def good(t):
+ ... a,b,c = tf.unstack(t)
+ ... return a
+ >>>
+ >>> good(t).numpy()
+ 1
+
+ #### Unknown shapes
+
+ Eager tensors have concrete values, so their shape is always known.
+ Inside a \`tf.function\` the symbolic tensors may have unknown shapes.
+ If the length of \`axis\` is unknown \`tf.unstack\` will fail because it cannot
+ handle an unknown number of tensors:
+
+ >>> @tf.function(input_signature=[tf.TensorSpec([None], tf.float32)])
+ ... def bad(t):
+ ... tensors = tf.unstack(t)
+ ... return tensors[0]
+ >>>
+ >>> bad(tf.constant([1,2,3]))
+ Traceback (most recent call last):
+ ...
+ ValueError: Cannot infer argument \`num\` from shape (None,)
+
+ If you know the \`axis\` length you can pass it as the \`num\` argument. But this
+ must be a constant value.
+
+ If you actually need a variable number of tensors in a single \`tf.function\`
+ trace, you will need to use exlicit loops and a \`tf.TensorArray\` instead.
+
+ Args:
+ value: A rank \`R > 0\` \`Tensor\` to be unstacked.
+ num: An \`int\`. The length of the dimension \`axis\`. Automatically inferred if
+ \`None\` (the default).
+ axis: An \`int\`. The axis to unstack along. Defaults to the first dimension.
+ Negative values wrap around, so the valid range is \`[-R, R)\`.
+ name: A name for the operation (optional).
+
+ Returns:
+ The list of \`Tensor\` objects unstacked from \`value\`.
+
+ Raises:
+ ValueError: If \`axis\` is out of the range \`[-R, R)\`.
+ ValueError: If \`num\` is unspecified and cannot be inferred.
+ InvalidArgumentError: If \`num\` does not match the shape of \`value\`.
+ `],["tf.Variable","description: See the [variable guide](https://tensorflow.org/guide/variable).",!0,`See the [variable guide](https://tensorflow.org/guide/variable).
+
+ A variable maintains shared, persistent state manipulated by a program.
+
+ The \`Variable()\` constructor requires an initial value for the variable, which
+ can be a \`Tensor\` of any type and shape. This initial value defines the type
+ and shape of the variable. After construction, the type and shape of the
+ variable are fixed. The value can be changed using one of the assign methods.
+
+ >>> v = tf.Variable(1.)
+ >>> v.assign(2.)
+ '+(o?t:Jt(t,!0))+`
+`:""+(o?t:Jt(t,!0))+`
+`}blockquote(t){return`+${t}+`}html(t){return t}heading(t,n,o,r){if(this.options.headerIds){const a=this.options.headerPrefix+r.slug(o);return`
${t}
+`}table(t,n){return n&&(n=`${n}`),`${t}`}br(){return this.options.xhtml?"An error occurred:
"+Jt(o.message+"",!0)+"";throw o}}ht.options=ht.setOptions=function(e){return so(ht.defaults,e),b2(ht.defaults),ht};ht.getDefaults=Zb;ht.defaults=Fa;ht.use=function(...e){const t=so({},...e),n=ht.defaults.extensions||{renderers:{},childTokens:{}};let o;e.forEach(r=>{if(r.extensions&&(o=!0,r.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if(a.renderer){const l=n.renderers?n.renderers[a.name]:null;l?n.renderers[a.name]=function(...i){let s=a.renderer.apply(this,i);return s===!1&&(s=l.apply(this,i)),s}:n.renderers[a.name]=a.renderer}if(a.tokenizer){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");n[a.level]?n[a.level].unshift(a.tokenizer):n[a.level]=[a.tokenizer],a.start&&(a.level==="block"?n.startBlock?n.startBlock.push(a.start):n.startBlock=[a.start]:a.level==="inline"&&(n.startInline?n.startInline.push(a.start):n.startInline=[a.start]))}a.childTokens&&(n.childTokens[a.name]=a.childTokens)})),r.renderer){const a=ht.defaults.renderer||new Lu;for(const l in r.renderer){const i=a[l];a[l]=(...s)=>{let c=r.renderer[l].apply(a,s);return c===!1&&(c=i.apply(a,s)),c}}t.renderer=a}if(r.tokenizer){const a=ht.defaults.tokenizer||new Fu;for(const l in r.tokenizer){const i=a[l];a[l]=(...s)=>{let c=r.tokenizer[l].apply(a,s);return c===!1&&(c=i.apply(a,s)),c}}t.tokenizer=a}if(r.walkTokens){const a=ht.defaults.walkTokens;t.walkTokens=function(l){r.walkTokens.call(this,l),a&&a.call(this,l)}}o&&(t.extensions=n),ht.setOptions(t)})};ht.walkTokens=function(e,t){for(const n of e)switch(t.call(ht,n),n.type){case"table":{for(const o of n.header)ht.walkTokens(o.tokens,t);for(const o of n.rows)for(const r of o)ht.walkTokens(r.tokens,t);break}case"list":{ht.walkTokens(n.items,t);break}default:ht.defaults.extensions&&ht.defaults.extensions.childTokens&&ht.defaults.extensions.childTokens[n.type]?ht.defaults.extensions.childTokens[n.type].forEach(function(o){ht.walkTokens(n[o],t)}):n.tokens&&ht.walkTokens(n.tokens,t)}};ht.parseInline=function(e,t){if(typeof e=="undefined"||e===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof e!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");t=so({},ht.defaults,t||{}),Qb(t);try{const n=Mo.lexInline(e,t);return t.walkTokens&&ht.walkTokens(n,t.walkTokens),Po.parseInline(n,t)}catch(n){if(n.message+=` +Please report this to https://github.com/markedjs/marked.`,t.silent)return"
An error occurred:
"+Jt(n.message+"",!0)+"";throw n}};ht.Parser=Po;ht.parser=Po.parse;ht.Renderer=Lu;ht.TextRenderer=ev;ht.Lexer=Mo;ht.lexer=Mo.lex;ht.Tokenizer=Fu;ht.Slugger=tv;ht.parse=ht;Po.parse;Mo.lex;var nv=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},P2=Object.defineProperty,O2=Object.getOwnPropertyDescriptor,R2=(e,t,n,o)=>{for(var r=o>1?void 0:o?O2(t,n):t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(r=(o?l(t,n,r):l(r))||r);return o&&r&&P2(t,n,r),r};let wd=class extends Du{mounted(){XG(".api").accordion({collapsible:!0,header:".header",heightStyle:"content",active:!1})}encodeHtml(e){return e?ht(e):""}get apis(){return g2.filter(e=>e[2])}};wd=R2([Xb({components:{}})],wd);const D2=wd,ov=e=>(db("data-v-3527d162"),e=e(),ub(),e),F2={id:"Home"},L2=ov(()=>M("h2",null,"Modules",-1)),V2={class:"header clickable"},B2={class:"name"},j2=["innerHTML"],H2={class:"content"},q2=["innerHTML"],K2=ov(()=>M("h2",null,"Classes",-1));function W2(e,t,n,o,r,a){return x(),N("div",F2,[L2,(x(!0),N(De,null,ct(e.apis,l=>(x(),N("div",{class:"api",key:l[0].toString()},[M("div",V2,[M("span",B2,ve(l[0]),1),M("span",{class:"desc",innerHTML:l[1]},null,8,j2)]),M("div",H2,[M("div",{class:"md-docstring",innerHTML:e.encodeHtml(l[3])},null,8,q2)])]))),128)),K2])}var U2=nv(D2,[["render",W2],["__scopeId","data-v-3527d162"]]),Y2=Object.defineProperty,G2=Object.getOwnPropertyDescriptor,X2=(e,t,n,o)=>{for(var r=o>1?void 0:o?G2(t,n):t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(r=(o?l(t,n,r):l(r))||r);return o&&r&&Y2(t,n,r),r};let xd=class extends Du{};xd=X2([Xb({components:{}})],xd);const Z2=xd,J2=e=>(db("data-v-bdbb760e"),e=e(),ub(),e),Q2={id:"About"},e3=lt(" This is HyDEV's Template "),t3=J2(()=>M("div",null,"for Vue 3 + Typescript + Vite + Vue Router + SASS + Element Plus + Class Components",-1)),n3=[e3,t3];function o3(e,t,n,o,r,a){return x(),N("div",Q2,n3)}var r3=nv(Z2,[["render",o3],["__scopeId","data-v-bdbb760e"]]);/*! + * vue-router v4.0.15 + * (c) 2022 Eduardo San Martin Morote + * @license MIT + */const rv=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",La=e=>rv?Symbol(e):"_vr_"+e,a3=La("rvlm"),Gf=La("rvd"),Vu=La("r"),av=La("rl"),kd=La("rvl"),ia=typeof window!="undefined";function l3(e){return e.__esModule||rv&&e[Symbol.toStringTag]==="Module"}const Nt=Object.assign;function Tc(e,t){const n={};for(const o in t){const r=t[o];n[o]=Array.isArray(r)?r.map(e):e(r)}return n}const ml=()=>{},i3=/\/$/,s3=e=>e.replace(i3,"");function Cc(e,t,n="/"){let o,r={},a="",l="";const i=t.indexOf("?"),s=t.indexOf("#",i>-1?i:0);return i>-1&&(o=t.slice(0,i),a=t.slice(i+1,s>-1?s:t.length),r=e(a)),s>-1&&(o=o||t.slice(0,s),l=t.slice(s,t.length)),o=p3(o!=null?o:t,n),{fullPath:o+(a&&"?")+a+l,path:o,query:r,hash:l}}function c3(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Xf(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function d3(e,t,n){const o=t.matched.length-1,r=n.matched.length-1;return o>-1&&o===r&&xa(t.matched[o],n.matched[r])&&lv(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function xa(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function lv(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!u3(e[n],t[n]))return!1;return!0}function u3(e,t){return Array.isArray(e)?Zf(e,t):Array.isArray(t)?Zf(t,e):e===t}function Zf(e,t){return Array.isArray(t)?e.length===t.length&&e.every((n,o)=>n===t[o]):e.length===1&&e[0]===t}function p3(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),o=e.split("/");let r=n.length-1,a,l;for(a=0;a