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 2019/12/13 19:21:01 UTC

[GitHub] [incubator-mxnet] relaxli00 opened a new issue #17062: Incomplete description generation with OpWrapperGenerator.py

relaxli00 opened a new issue #17062: Incomplete description generation with OpWrapperGenerator.py
URL: https://github.com/apache/incubator-mxnet/issues/17062
 
 
   For C++ usage, when OpWrapperGenerator.py is used to generate op.h, a bug in OpWrapperGenerator.py in will cause incomplete description in op.h.
   
   Original code in OpWrapperGenerator.py, Line 188:
   `    def WrapDescription(self, desc = ''):
           ret = []
           sentences = desc.split('.')
           lines = desc.split('\n')
           for line in lines:
             line = line.strip()
             if len(line) <= 80:
               ret.append(line.strip())
             else:
               while len(line) > 80:
                 pos = line.rfind(' ', 0, 80)+1
                 if pos <= 0:
                   pos = line.find(' ')
                 if pos < 0:
                   pos = len(line)
                 ret.append(line[:pos].strip())
                 line = line[pos:]
           return ret`
   
   Before return, a line of code should be added. So that the bug can be fixed:
   `    def WrapDescription(self, desc = ''):
           ret = []
           sentences = desc.split('.')
           lines = desc.split('\n')
           for line in lines:
             line = line.strip()
             if len(line) <= 80:
               ret.append(line.strip())
             else:
               while len(line) > 80:
                 pos = line.rfind(' ', 0, 80)+1
                 if pos <= 0:
                   pos = line.find(' ')
                 if pos < 0:
                   pos = len(line)
                 ret.append(line[:pos].strip())
                 line = line[pos:]
               ret.append(line.strip())
           return ret`

----------------------------------------------------------------
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


With regards,
Apache Git Services