Refactoring code for better performance and code quality #280
Refactoring code for better performance and code quality #280maldil wants to merge 3 commits intotensorflow:masterfrom
Conversation
|
|
||
| import math | ||
|
|
||
| import numpy as np |
There was a problem hiding this comment.
Note that this is a library based on tensorflow, so all of the math operations done below are deferred by constructing the tensorflow graph, and should not be using numpy.
There are tensorflow alternatives for these operations though.
Were you able to run the tests in this repo to make sure that they don't break with the change?
There was a problem hiding this comment.
Thank you for your response. I'm new to this repository. Before adding the new import, I checked to see if this repo makes use of numpy APIs (https://github.com/tensorflow/transform/search?q=numpy). After confirming that , I automatically analyzed the code to identify any missed chances to use the APIs. Please close the PR if this script is not intended to use numpy APIs. Regarding test. No I did not. Now I'm trying to run the test. However, I am having difficulty locating the test scripts. Any assistance is much appreciated.
Hi
Thank you very much for your excellent work in tensorflow/transform
I am a graduate student at the University of Colorado, studying the best practices of evolving ML codes. From our research, one of the most common evolution best practice in ML code is the migration of loop-based computations, since it improves performance and code quality. We made the following changes in tensorflow/transform, which remove the FOR loop and use NumPy APIs and List Comp. I carefully checked the modification to ensure that it does not break the code. I will gladly contribute. Please help me to merge this.