Skip to content

tensor.refine

← tensor dialect

Assert more precise shape and encoding information for the same tensor elements. Source and result describe the same value and ownership identity; this operation performs no conversion or copy.

Operation contract

Property Value
Semantic phase —
Traits Pure, RefinableResultTypeRefs, FactIdentity

Signature

Kind Name Type Cardinality Description
Operand source tensor required Value to refine.
Result result tensor required Same value with refined type information.

Verification constraints

  • SameElementType(source, result)
  • RanksMatch(source, result)

Examples

%refined = tensor.refine %source : tensor<[%count]xf32> -> tensor<16xf32>