tf.raw_ops.MapDefun
Stay organized with collections
Save and categorize content based on your preferences.
Maps a function on the list of tensors unpacked from arguments on dimension 0.
tf.raw_ops.MapDefun(
arguments,
captured_inputs,
output_types,
output_shapes,
f,
max_intra_op_parallelism=1,
name=None
)
The function given by f
is assumed to be stateless, and is executed
concurrently on all the slices; up to batch_size (i.e. the size of the 0th
dimension of each argument) functions will be scheduled at once.
The max_intra_op_parallelism
attr, which defaults to 1, can be used to
limit the intra op parallelism. To limit inter-op parallelism, a user can
set a private threadpool on the dataset using tf.data.Options
's
ThreadingOptions
.
Note that this op is not exposed to users directly, but is invoked in tf.data
rewrites.
Args |
arguments
|
A list of Tensor objects.
A list of tensors whose types are Targuments , corresponding to the inputs
the function should be mapped over.
|
captured_inputs
|
A list of Tensor objects.
A list of tensors whose types are Tcaptured , corresponding to the captured
inputs of the defun.
|
output_types
|
A list of tf.DTypes that has length >= 1 .
A list of types.
|
output_shapes
|
A list of shapes (each a tf.TensorShape or list of ints ) that has length >= 1 .
A list of shapes.
|
f
|
A function decorated with @Defun.
|
max_intra_op_parallelism
|
An optional int . Defaults to 1 .
|
name
|
A name for the operation (optional).
|
Returns |
A list of Tensor objects of type output_types .
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[],[],null,["# tf.raw_ops.MapDefun\n\n\u003cbr /\u003e\n\nMaps a function on the list of tensors unpacked from arguments on dimension 0.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.raw_ops.MapDefun`](https://www.tensorflow.org/api_docs/python/tf/raw_ops/MapDefun)\n\n\u003cbr /\u003e\n\n tf.raw_ops.MapDefun(\n arguments,\n captured_inputs,\n output_types,\n output_shapes,\n f,\n max_intra_op_parallelism=1,\n name=None\n )\n\nThe function given by `f` is assumed to be stateless, and is executed\nconcurrently on all the slices; up to batch_size (i.e. the size of the 0th\ndimension of each argument) functions will be scheduled at once.\n\nThe `max_intra_op_parallelism` attr, which defaults to 1, can be used to\nlimit the intra op parallelism. To limit inter-op parallelism, a user can\nset a private threadpool on the dataset using [`tf.data.Options`](../../tf/data/Options)'s\n`ThreadingOptions`.\n\nNote that this op is not exposed to users directly, but is invoked in tf.data\nrewrites.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|----------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|\n| `arguments` | A list of `Tensor` objects. A list of tensors whose types are `Targuments`, corresponding to the inputs the function should be mapped over. |\n| `captured_inputs` | A list of `Tensor` objects. A list of tensors whose types are `Tcaptured`, corresponding to the captured inputs of the defun. |\n| `output_types` | A list of `tf.DTypes` that has length `\u003e= 1`. A list of types. |\n| `output_shapes` | A list of shapes (each a [`tf.TensorShape`](../../tf/TensorShape) or list of `ints`) that has length `\u003e= 1`. A list of shapes. |\n| `f` | A function decorated with @Defun. |\n| `max_intra_op_parallelism` | An optional `int`. Defaults to `1`. |\n| `name` | A name for the operation (optional). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A list of `Tensor` objects of type `output_types`. ||\n\n\u003cbr /\u003e"]]