Skip to content

LodExtend Operator #5000

@Superjomn

Description

@Superjomn

According to the design of sequence decoder,
a LodExtend Operator is needed to link the previous state to the current state of RNN/sequence decoder.

It functions like

  • inputs
    • source : LoDTensor
    • target, the lod to fit, LoDTensor
  • outputs
    • the expanded source that has the same LoD with target

Some real examples:

  • source: a 1-level LoDTensor with 2 sequences
    • LoD: [0, 3, 5]
    • data: [0, 1, 2, 3, 4, 5]
  • target: a 1-level LoDTensor with 5 sequences
    • LoD: [0, 2, 3, 5, 6, 6, 8]
  • output:
    • LoD same with target
    • data: [0, 0, 1, 2, 2, 3, 5, 5]

The function LodExpand in another PR can be used.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions