tvm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-tvm] anijain2305 commented on a change in pull request #5422: [RELAY][Convert Layout] Specify additional layouts in convert layout pass
Date Wed, 06 May 2020 00:11:10 GMT

anijain2305 commented on a change in pull request #5422:
URL: https://github.com/apache/incubator-tvm/pull/5422#discussion_r420479959



##########
File path: docs/dev/convert_layout.rst
##########
@@ -218,24 +224,49 @@ Second example is for a lightly-layout sensitive operator - batch normalization.
 
 ConvertLayout pass is extremely easy to use. The pass is not a part of default relay.build
pipeline. The intended usage is to call it between the framework-to-relay parser and relay.build
module call.
 
+In order to specify the layouts to convert to, we create a mapping of heavily-layout sensitive
operators to a list of the desired layouts for that operator.
+
 .. code-block:: python
 
     # TFlite framework to Relay parser - Default layout is NHWC
     mod, params = relay.frontend.from_tflite(tflite_model,
                                              shape_dict=shape_dict,
                                              dtype_dict=dtype_dict)
 
+    # We assume our model's heavily-layout sensitive operators only consist of nn.conv2d
+    desired_layouts = {'nn.conv2d': ['NCHW']}

Review comment:
       I see. That makes sense.
   
   For this PR, I think we can start with a dict from python that is Map<String, Array<String>>
for now. We can then send a separate PR for stricter type check.
   
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message