Fix langref code snippet - NFC
authornmostafa <nagy.h.mostafa@intel.com>
Sat, 7 Dec 2019 00:03:16 +0000 (16:03 -0800)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Sat, 7 Dec 2019 00:03:51 +0000 (16:03 -0800)
Closes tensorflow/mlir#294

PiperOrigin-RevId: 284281172

mlir/g3doc/LangRef.md

index fa22fa5a35e46c450df78116b019bc7a5b64f802..a810330d37e6fb4bb5b6f0f0df1d25490ff9e6f2 100644 (file)
@@ -811,17 +811,25 @@ exposed to codegen but one may query the rank of an unranked memref (a special
 op will be needed for this purpose) and perform a switch and cast to a ranked
 memref as a prerequisite to codegen.
 
-Example ```mlir {.mlir} // With static ranks, we need a function for each
-possible argument type %A = alloc() : memref<16x32xf32> %B = alloc() :
-memref<16x32x64xf32> call @helper_2D(%A) : (memref<16x32xf32>)->() call
-@helper_3D(%B) : (memref<16x32x64xf32>)->()
-
-// With unknown rank, the functions can be unified under one unranked type %A =
-alloc() : memref<16x32xf32> %B = alloc() : memref<16x32x64xf32> // Remove rank
-info %A_u = memref_cast %A : memref<16x32xf32> -> memref<*xf32> %B_u =
-memref_cast %B : memref<16x32x64xf32> -> memref<*xf32> // call same function
-with dynamic ranks call @helper(%A_u) : (memref<*xf32>)->() call @helper(%B_u) :
-(memref<*xf32>)->() ```
+Example 
+```mlir {.mlir} 
+// With static ranks, we need a function for each
+// possible argument type 
+%A = alloc() : memref<16x32xf32> 
+%B = alloc() : memref<16x32x64xf32> 
+call @helper_2D(%A) : (memref<16x32xf32>)->() 
+call @helper_3D(%B) : (memref<16x32x64xf32>)->()
+
+// With unknown rank, the functions can be unified under one unranked type 
+%A = alloc() : memref<16x32xf32>
+%B = alloc() : memref<16x32x64xf32>
+// Remove rank info
+%A_u = memref_cast %A : memref<16x32xf32> -> memref<*xf32>
+%B_u = memref_cast %B : memref<16x32x64xf32> -> memref<*xf32>
+// call same function with dynamic ranks 
+call @helper(%A_u) : (memref<*xf32>)->()
+call @helper(%B_u) : (memref<*xf32>)->() 
+```
 
 The core syntax and representation of a layout specification is a
 [semi-affine map](Dialects/Affine.md#semi-affine-maps). Additionally, syntactic