// RUN: mlir-opt -allow-unregistered-dialect %s -split-input-file | FileCheck %s // ----- // All per-layer params specified: // [signed] storageType, storageTypeMin, storageTypeMax, expressedType, scale, zeroPoint // CHECK: !quant.uniform:f32, 9.987200e-01:127> !qalias = type !quant.uniform:f32, 0.99872:127> func @parse() -> !qalias { %0 = "foo"() : () -> !qalias return %0 : !qalias } // ----- // Trailing whitespace. // CHECK: !quant.uniform:f32, 9.987200e-01:127> !qalias = type !quant.uniform:f32, 0.99872:127 > func @parse() -> !qalias { %0 = "foo"() : () -> !qalias return %0 : !qalias } // ----- // Required per-layer params specified: // [unsigned] storageType, expressedType, scale // CHECK: !quant.uniform !qalias = type !quant.uniform func @parse() -> !qalias { %0 = "foo"() : () -> !qalias return %0 : !qalias } // ----- // Exponential scale (-) // CHECK: !quant.uniform !qalias = type !quant.uniform func @parse() -> !qalias { %0 = "foo"() : () -> !qalias return %0 : !qalias } // ----- // Exponential scale (+) // CHECK: !quant.uniform !qalias = type !quant.uniform func @parse() -> !qalias { %0 = "foo"() : () -> !qalias return %0 : !qalias } // ----- // Storage type: i16 // CHECK: !quant.uniform !qalias = type !quant.uniform func @parse() -> !qalias { %0 = "foo"() : () -> !qalias return %0 : !qalias } // ----- // Storage type: u16 // CHECK: !quant.uniform !qalias = type !quant.uniform func @parse() -> !qalias { %0 = "foo"() : () -> !qalias return %0 : !qalias } // ----- // Storage type: i32 // CHECK: !quant.uniform !qalias = type !quant.uniform func @parse() -> !qalias { %0 = "foo"() : () -> !qalias return %0 : !qalias } // ----- // Storage type: u32 // CHECK: !quant.uniform !qalias = type !quant.uniform func @parse() -> !qalias { %0 = "foo"() : () -> !qalias return %0 : !qalias } // ----- // Expressed type: f32 // CHECK: !quant.uniform !qalias = type !quant.uniform func @parse() -> !qalias { %0 = "foo"() : () -> !qalias return %0 : !qalias } // ----- // Expressed type: f16 // CHECK: !quant.uniform !qalias = type !quant.uniform func @parse() -> !qalias { %0 = "foo"() : () -> !qalias return %0 : !qalias } // ----- // Expressed type: f64 // CHECK: !quant.uniform !qalias = type !quant.uniform func @parse() -> !qalias { %0 = "foo"() : () -> !qalias return %0 : !qalias } // ----- // Expressed type: bf16 // CHECK: !quant.uniform !qalias = type !quant.uniform func @parse() -> !qalias { %0 = "foo"() : () -> !qalias return %0 : !qalias } // ----- // Per-axis scales and zero points (affine) // CHECK: !quant.uniform !qalias = type !quant.uniform func @parse() -> !qalias { %0 = "foo"() : () -> !qalias return %0 : !qalias } // ----- // Per-axis scales and no zero points (fixedpoint) // CHECK: !quant.uniform !qalias = type !quant.uniform func @parse() -> !qalias { %0 = "foo"() : () -> !qalias return %0 : !qalias } // ----- // Per-axis scales and zero points (mixed affine and fixedpoint) // CHECK: !quant.uniform !qalias = type !quant.uniform func @parse() -> !qalias { %0 = "foo"() : () -> !qalias return %0 : !qalias }