Big-endian saved_model byte swapping improvements
Just a quick note that the amended commit was just to fix code formatting. No further changes are pending and this PR is ready for review. Spoke too soon :(. Had to rebase to see pylint errors already on master. Ran pylint locally to check before pushing the latest changes so hopefully good this time. I think the currently failing ARM test might be due to another change mentioned here: https://github.com/tensorflow/tensorflow/pull/60388 Hi @ChromeHearts Can you please review this PR ? Thank you! @ChromeHearts, gentle ping. Could you review this PR when you have time? Hi @ChromeHearts Can you please review this PR ? Thank you! > Hi @ChromeHearts Can you please review this PR ? Thank you!

Yes, I am on it. @jonathan-albrecht-ibm Sorry taking this long.  The codes LGTM.  I have been looking for a big endianness environment to test your PR internally.  We actually no longer have such an environment readily assessable.  Could you sync your PR with the latest release and then test in your Big endian environment?  This should also clear the AMD build failure.  Thanks! TFTR @ChromeHearts! I'm rebasing the PR now. I'm running into some unrelated issues with the bazel build that I have to work through on my big-endian machine so it will take a bit of time before I can submit it but hopefully not too long.

> @jonathan-albrecht-ibm Sorry taking this long. The codes LGTM. I have been looking for a big endianness environment to test your PR internally. We actually no longer have such an environment readily assessable. Could you sync your PR with the latest release and then test in your Big endian environment? This should also clear the AMD build failure. Thanks!

 Hi @jonathan-albrecht-ibm Any update on this PR? Please. Thank you! @gbaned I should have an update soon. The build issues took longer than expected. @gbaned, @ChromeHearts I have pushed the rebased changes.

The rocm build failed with:

```
++ bazel build --config=rocm //tensorflow/tools/pip_package:build_pip_package --verbose_failures

ERROR: Config value 'rocm' is not defined in any .rc file
```

so I think its not related. Hi @jpienaar, gentle ping, please review when you have time I've not been on the team for about 2 years now, let me see who I can ping to review here. Looks like @ChromeHearts is probably the best person to review and help land here. Thanks @jpienaar . @gbaned did you want another review in addition to @ChromeHearts review which had already approved it? > Thanks @jpienaar . @gbaned did you want another review in addition to @ChromeHearts review which had already approved it?

Hi @jonathan-albrecht-ibm Sorry for the delay in response. I can't find @ChromeHearts in https://opensource.corp.google.com/github/search?q=ChromeHearts, hence I have assigned @jpienaar. 
 Hi @dellis23 Can you please review this PR ? Thank you! Hi @dellis23 Can you please review this PR ? Thank you! Hi @dellis23 Can you please review this PR ? Thank you! Hi @dellis23 Can you please review this PR ? Thank you! Thanks @jpienaar! Hi @jonathan-albrecht-ibm Can you please rebase your branch and resolve the conflicts. Thank you.  @gbaned, yes, no problem. I've rebased the PR. I pushed a commit to fix the `pylint line-too-long` lint that was failing. Hi @jonathan-albrecht-ibm Can you please rebase your branch and resolve the conflicts? Thank you! @gbaned I have rebased the PR. The only conflicts were in `tensorflow/core/util/tensor_bundle/byte_swap_tensor.cc` due to the mass rename of `OkStatus()` to `absl::OkStatus()`. There were no other upstream changes in that file. All other files rebased with no conflicts. I did not make any changes to my code or the upstream code except for the trivial rename of `OkStatus()` to `absl::OkStatus()`.

@gbaned  this is the third time I have had to rebase this PR due to conflicts with upstream changes. Please do not send it to the back of the merge queue. Each time I have completed the rebase within a few days. The only thing that is keeping this PR from being merged is that it spends so long in the merge queue that its almost inevitable that it picks up conflicts. Anything you can do to help get this PR out of that cycle would be greatly appreciated. Hi @ChromeHearts Can you please review this PR ? Thank you! TFTR @ChromeHearts!

@gbaned this PR has been approved but there is still an "awaiting review" label. Does that label need to be removed?

The `PyLint / PyLint (pull_request)` and `Presubmit - Code Check (Changed Files)` checks are failing due to a `line to long` lint in `tensorflow/lite/python/lite.py` that is not due my PR. It was from a previous unrelated commit ([3e72ed6005cb26bbadbd8ee0e95b570d2dd52bfa](https://github.com/tensorflow/tensorflow/commit/3e72ed6005cb26bbadbd8ee0e95b570d2dd52bfa)) by someone else that happens to be in the same file that is part of my PR. I am not planning on fixing it since it is unrelated to my PR but please let me know if it is blocking my PR from being merged. > TFTR @ChromeHearts!
> 
> @gbaned this PR has been approved but there is still an "awaiting review" label. Does that label need to be removed?
> 
> The `PyLint / PyLint (pull_request)` and `Presubmit - Code Check (Changed Files)` checks are failing due to a `line to long` lint in `tensorflow/lite/python/lite.py` that is not due my PR. It was from a previous unrelated commit ([3e72ed6005cb26bbadbd8ee0e95b570d2dd52bfa](https://github.com/tensorflow/tensorflow/commit/3e72ed6005cb26bbadbd8ee0e95b570d2dd52bfa)) by someone else that happens to be in the same file that is part of my PR. I am not planning on fixing it since it is unrelated to my PR but please let me know if it is blocking my PR from being merged.

Hi @jonathan-albrecht-ibm Sorry for the delay in response. I have removed the awaiting review label and nothing pending from your side. It is awaiting approval from code owners internally, it will be merged once approved. Thank you for your contribution!

Make byte swapping more consistent by always searching for nodes in both function libraries and at the top level.

Undo byte swapping after saving when it is possible that the saved_model in memory could still be used afterward.

Add byte swapping in loader_impl.py close to where loading from file happens and remove byte swapping that is no longer needed.

Add byte swapping when saving saved models in builder_impl.py.