tfm.nlp.layers.HartleyTransformLayer
Stay organized with collections
Save and categorize content based on your preferences.
Hartley Transform layer.
tfm.nlp.layers.HartleyTransformLayer(
use_fft: bool = False, name: str = 'hartley_transform', **kwargs
)
Applies 2D Hartley Transform over final two dimensions of query inputs -
typically the sequence and hidden dimensions.
Args |
use_fft
|
Whether to use Fast Fourier Transform (True) or the Discrete
Fourier Transform (DFT) matrix (False) to compute the Hartley Transform.
See _pick_fourier_transform() for recommendations on when to use FFT or
DFT.
|
name
|
Name for layer.
|
**kwargs
|
Keyword arguments.
|
Methods
call
View source
call(
query: tf.Tensor, value: tf.Tensor, **kwargs
) -> tf.Tensor
Applies layer to query.
| Args |
query
|
Batch of input embeddings, typically of shape [batch_size,
max_seq_length, hidden_dim].
|
value
|
Unused. Included to match attention layer API.
|
**kwargs
|
Optional arguments to catch unused attention keyword arguments.
|
| Returns |
Real part of discrete Hartley Transform of query inputs with shape
[batch_size, max_seq_length, hidden_dim].
|
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."],[],[]]