网页
综合
更新时间 2026-11-15 00:14:14
StartEndPacker layer
自动蜘蛛
keras.io
正文约 684 字
Adds start and end tokens to a sequence and pads to a fixed length.
This layer is useful when tokenizing inputs for tasks like translation, where each sequence should include a start and end marker. It should be called after tokenization. The layer will first trim inputs to fit, then add start/end tokens, and finally pad, if necessary, to sequence_length.
Input data should be passed as tensors, tf.RaggedTensors, or lists. For batched input, inputs should be a list of lists or a rank two tensor. For unbatched inputs, each element should be a list or a rank one tensor.
Unbatched input (int).
Batched input (int).
Unbatched input (str).
Batched input (str).
Multiple start tokens.
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。