You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/01/17 23:30:28 UTC

[GitHub] pracheer commented on a change in pull request #9460: Data-iterator tutorial made python3 compatible.

pracheer commented on a change in pull request #9460: Data-iterator tutorial made python3 compatible.
URL: https://github.com/apache/incubator-mxnet/pull/9460#discussion_r162209981
 
 

 ##########
 File path: docs/tutorials/basic/data.md
 ##########
 @@ -180,6 +184,30 @@ mod = mx.mod.Module(symbol=net)
 mod.fit(data_iter, num_epoch=5)
 ```
 
+A note on python 3 usage: Lot of the methods in mxnet use string for python2 and bytes for python3. 
+In order to keep this tutorial readable, we are going to define a utility function that converts
+string to bytes in python 3 environment
+
+```python
+def str_or_bytes(str):
 
 Review comment:
   If I understand it correctly, the output of py_str is a _string_ and input can be either a _string_ or _bytes_. What we are looking for here is the other way around with input always a string but output can either be a string or bytes. 
   
   We can optionally add a similar function to the base.py to get this kind of job done. Let me know your thoughts.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services