tfm.vision.layers.GlobalAveragePool3D
Stay organized with collections
Save and categorize content based on your preferences.
Creates a global average pooling layer with causal mode.
tfm.vision.layers.GlobalAveragePool3D(
keepdims: bool = False,
causal: bool = False,
state_prefix: Optional[str] = None,
**kwargs
)
Implements causal mode, which runs a cumulative sum (with tf.cumsum) across
frames in the time dimension, allowing the use of a stream buffer. Sums any
valid input state with the current input to allow state to accumulate over
several iterations.
Args |
keepdims
|
A bool. If True, keep the averaged dimensions.
|
causal
|
A bool of whether to run in causal mode with a cumulative sum
across frames.
|
state_prefix
|
a prefix string to identify states.
|
**kwargs
|
Additional keyword arguments to be passed to this layer.
|
Methods
call
View source
call(
inputs: tf.Tensor,
states: Optional[States] = None,
output_states: bool = False
) -> Union[tf.Tensor, Tuple[tf.Tensor, States]]
Calls the layer with the given inputs.
| Args |
inputs
|
An input tf.Tensor.
|
states
|
A dict of states such that, if any of the keys match for this
layer, will overwrite the contents of the buffer(s).
Expected keys include state_prefix + '__pool_buffer' and
state_prefix + '__pool_frame_count'.
|
output_states
|
A bool. If True, returns the output tensor and output
states. Returns just the output tensor otherwise.
|
| Returns |
An output tf.Tensor (and optionally the states if output_states=True).
If causal=True, the output tensor will have shape
[batch_size, num_frames, 1, 1, channels] if keepdims=True. We keep
the frame dimension in this case to simulate a cumulative global average
as if we are inputting one frame at a time. If causal=False, the output
is equivalent to tf_keras.layers.GlobalAveragePooling3D with shape
[batch_size, 1, 1, 1, channels] if keepdims=True (plus the optional
buffer stored in states).
|
| Raises |
ValueError
|
If using 'channels_first' data format.
|
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 2026-11-06 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-11-06 UTC."],[],[]]