neuromorphs / NIR

Neuromorphic Intermediate Representation reference implementation
https://neuroir.org/docs
BSD 3-Clause "New" or "Revised" License
69 stars 10 forks source link

Bug fixes: nir.Output type inference & CubaLIF.w_in read/write #71

Closed stevenabreu7 closed 11 months ago

stevenabreu7 commented 11 months ago

~Right now, the type inference goes through but it doesn't actually change the NIR graph. This PR fixes that.~

Update: this PR fixes a weird edge case where the input_type of a nir.Output node is inferred. This currently fails because it will not update the output_type for the nir.Output node and this is used when writing the graph to a file. (hence, when writing to a file and reading again, the shape inference is essentially discarded).

Update update: I've also added an urgent fix that adds w_in to the read and write method of the CubaLIF node. This should have always been there..

matjobst commented 11 months ago

~For me the inference changed the graph already without your modifications. Did you observe the nodes not changing in a specific instance? The dataclasses are mutable unless set to frozen. That is why it is not necessary to actively write the nodes back into the graph.~

stevenabreu7 commented 11 months ago

yep I just wrote tests to check that this works, but the problem was something else. I will update the PR in a moment - sorry about the confusion