Skip to content

CopyLoDOp is needed. #9171

@pkuyym

Description

@pkuyym

Sometimes we need set a LoDTensor's LoD by copying LoD from another LoDTensor. If the referred LoDTensor has more than one LoD level, the level range should be specified by attribute. If CopyLoDOp provided, we can view a common Tensor as a sequence by assigning a LoD information to it.

For example, beam_search operator requires that prev_ids, topk_indices, and topk_scores are all LoDTensor, however, LoD of topk_scores usually inherits from states, states sometimes is a common Tensor, since the init value is always Tensor. In this situation, we can copy LoD from prev_ids to topk_scores.

Metadata

Metadata

Assignees

No one assigned

    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