Added builder case for int8 tensors in the dialect (#263)
This commit is contained in:
		
							parent
							
								
									2f41c2bf5b
								
							
						
					
					
						commit
						c7b5eecc7f
					
				|  | @ -166,6 +166,15 @@ mlir::DenseElementsAttr onnxTensorProtoToDenseElmAttr( | |||
|         tensorType, llvm::makeArrayRef(arrayAttrInitializer)); | ||||
|     break; | ||||
|   } | ||||
|   case (onnx::TensorProto::INT8): { | ||||
|     const auto &arrayAttrInitializer = | ||||
|         CreateArrayAttribute<int32_t>(initializer); | ||||
|     auto elmType = builder.getIntegerType(8); | ||||
|     auto tensorType = mlir::RankedTensorType::get(tensorDims, elmType); | ||||
|     denseElmAttr = mlir::DenseElementsAttr::get( | ||||
|         tensorType, llvm::makeArrayRef(arrayAttrInitializer)); | ||||
|     break; | ||||
|   } | ||||
|   case (onnx::TensorProto::INT32): { | ||||
|     const auto &arrayAttrInitializer = | ||||
|         CreateArrayAttribute<int32_t>(initializer); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue