Refactor conversion function
# What does this PR do?

This PR introduces a refactor of the conversion functions to be able to re-use with safetensors. It comes with zero change of code inside but the main takeaway is to build two functions that take a PyTorch-formatted (resp. TF-formatted) state dict and load it in a TF (resp. PyTorch) model. The state dict is just a dictionary name to tensor, and the tensor car be a NumPy array (as it was) or a torch/tf tensor (which it will be with safetensors).
_The documentation is not available anymore as the PR was closed or merged._