Support real and imag at the backend level
Hi @alewis, Any ideas on how to tackle this?
For every backend except PyTorch, I think .real and .imag are harmless when applied to real input, so in those cases we can just wrap the relevant function. PyTorch will require some special handling. I guess a simple try / except would work?
On Thu, Oct 1, 2020 at 1:03 PM Ahmed Karaman [email protected] wrote:
Hi @alewis https://github.com/alewis, Any ideas on how to tackle this?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/google/TensorNetwork/issues/841#issuecomment-702271385, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAINHBS7YWOUO7H6JCJ7CHTSISY5TANCNFSM4R4PC7TA .
Hey, Is this issue still still open?
Yep, this one is, though I don't know whether @ahmedkrmn is working on it?
@MikeMerz, feel free to work on it if you want to. I've been busy lately so I still haven't started.
@ahmedkrmn Thanks mate. @alewis Just a thought: 1)For numpy and tensorflow backends, it's possible to just to call numpy and tensor's .real and .imag? as the input is of the same type.
Yes, that should work in all cases except PyTorch and Symmetric. For PyTorch you'll need to do some additional type checking because calling . real and .imag throws an error for non complex input in that case.
On Sat, Oct 10, 2020, 12:26 MikeMerz [email protected] wrote:
@ahmedkrmn https://github.com/ahmedkrmn Thanks mate. Just a though: 1)For numpy and tensorflow backends, it's possible to just to call numpy and tensor's .real and .imag? as the input is of the same type.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/google/TensorNetwork/issues/841#issuecomment-706574826, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAINHBTSARWHKVUX6PP6W6TSKCDMNANCNFSM4R4PC7TA .
@alewis For PyTorch, is it better to raise an excpetion if the input is not complex or treat it as 0j?
I think the latter, yeah.
On Sat, Oct 10, 2020, 13:22 MikeMerz [email protected] wrote:
For PyTorch, is it better to raise an excpetion if the input is not complex or treat it as 0j?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/google/TensorNetwork/issues/841#issuecomment-706583344, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAINHBTRMYYG76K67CQM4JLSKCJ65ANCNFSM4R4PC7TA .
@alewis Hey, I unintentionally pushed the changes of this Issue to the ones_like and zero_like Pull request
Hmm, do you think you can revert it and split them up?
On Sun, Oct 11, 2020, 13:39 MikeMerz [email protected] wrote:
@alewis https://github.com/alewis Hey, I unintentionally pushed the changes of this Issue to the ones_like and zero_like Pull request
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/google/TensorNetwork/issues/841#issuecomment-706740113, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAINHBV34EXQEYSG6AXYDFLSKHUWTANCNFSM4R4PC7TA .
@alewis after much tries, I re-uploaded the changes for the ones_like & zero_like issue , had to close the last request
Heyy @MikeMerz , @alewis I am a new contributor can i take up thi s?? and can someone provide little heads-up or description about this issue??