Lines Matching refs:ctx

36 Attribute getTestFloatAttr(double value, MLIRContext *ctx) {  in getTestFloatAttr()  argument
37 return FloatAttr::get(FloatType::getF32(ctx), value); in getTestFloatAttr()
41 ConcreteAttrClass getTestElementsAttr(MLIRContext *ctx, ArrayRef<int64_t> shape, in getTestElementsAttr() argument
43 auto eleType = FloatType::getF32(ctx); in getTestElementsAttr()
53 ElementsAttr getTestSparseElementsAttr(MLIRContext *ctx, in getTestSparseElementsAttr() argument
55 auto eleType = FloatType::getF32(ctx); in getTestSparseElementsAttr()
62 auto indicesType = RankedTensorType::get({1, 2}, IntegerType::get(ctx, 64)); in getTestSparseElementsAttr()
70 UniformQuantizedType getTestQuantizedType(Type storageType, MLIRContext *ctx) { in getTestQuantizedType() argument
72 FloatType::getF32(ctx), /*scale=*/1.0, in getTestQuantizedType()
78 MLIRContext ctx; in TEST() local
79 ctx.getOrLoadDialect<QuantizationDialect>(); in TEST()
80 IntegerType convertedType = IntegerType::get(&ctx, 8); in TEST()
81 auto quantizedType = getTestQuantizedType(convertedType, &ctx); in TEST()
84 auto realValue = getTestFloatAttr(1.0, &ctx); in TEST()
96 MLIRContext ctx; in TEST() local
97 ctx.getOrLoadDialect<QuantizationDialect>(); in TEST()
98 IntegerType convertedType = IntegerType::get(&ctx, 8); in TEST()
99 auto quantizedType = getTestQuantizedType(convertedType, &ctx); in TEST()
102 &ctx, {1, 2}, {getTestFloatAttr(1.0, &ctx), getTestFloatAttr(2.0, &ctx)}); in TEST()
122 MLIRContext ctx; in TEST() local
123 ctx.getOrLoadDialect<QuantizationDialect>(); in TEST()
124 IntegerType convertedType = IntegerType::get(&ctx, 8); in TEST()
125 auto quantizedType = getTestQuantizedType(convertedType, &ctx); in TEST()
128 &ctx, {1, 2}, getTestFloatAttr(1.0, &ctx)); in TEST()
148 MLIRContext ctx; in TEST() local
149 ctx.getOrLoadDialect<QuantizationDialect>(); in TEST()
150 IntegerType convertedType = IntegerType::get(&ctx, 8); in TEST()
151 auto quantizedType = getTestQuantizedType(convertedType, &ctx); in TEST()
153 auto realValue = getTestSparseElementsAttr(&ctx, {1, 2}); in TEST()