I am about to submit a paper in which one of the algorithms I used is heavily based on the code available on one of the TensowFlow tutorials. In fact, I mostly copied the code from the page and made the necessary modifications for my specific case. I did cite, in the paper, both TensorFlow and the page, and disclosed that the neural net architecture I was using was based on the one on the page. The licensing terms of the code (Apache 2.0) mention that the user is free to build upon the code and redistribute it.
I am not in CS, and am applying the model to a specific problem in my field. However, in copying the code (which I believe will not be disclosed) I am afraid I might be doing academic misconduct. However, on the other hand, if that was the case, using open-source libraries would also be frowned upon, given that the user is essentially copying code.
Will I be committing academic misconduct or anything that is ethically frowned upon in academia by submitting results parts of which were based on copied code?
PS: In response to a comment, I cited TensorFlow and the webpage in the paper, which will be published if accepted, but the code itself (which was heavily based on the code available in the webpage) won't be posted anywhere (as far as I know).