New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactored code and created tensorflow backend #52
Conversation
This is a big design change so I would appreciate your inputs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
network_components and ncon_interface need to be updated as well, right?
Also, I'm not sure how switching backends will be implemented, but it seems conceivable that someone could try to merge two networks created using two different backends. How do we deal with that?
def outer_product(self, tensor1: Tensor, tensor2: Tensor) -> Tensor: | ||
"""Calculate the outer product of the two given tensors.""" | ||
raise NotImplementedError( | ||
"Backend '{}' has not implemented trace.".format( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trace --> outer_product
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you tell I copy and pasted? lol
Two ways (I'm waiting on stavros building the numpy backend before trying it).
Easiest thing to do is throw an error. We can check that the backends are the same before merging, which is pretty easy. We could have a converter by changing each node's tensor by doing All 4 backends we plan on supporting right now (JAX/PyTorch/TF/numpy) allow tensors to be created by converting a |
Yes they do. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This is a big change, but I think it is for the better. (See #51 for details).
The next backend we will add will be a pure numpy implementation, then JAX, and then leave torch to the community.