Added backward compatibity for graph with no self.nInputs

A previously saved graph can have no self.nInputs.
So I added a backward compatibility for that.