Move towards consistent use of the term Tensor
Right now there's a bit of a confusing situation going on where the term Tensor refers both to the type of a given backend array (the old use) and to tn.Tensor itself. Since this is confusing for new developers I recommend we change the former use to something more descriptive, e.g. "backend array". Using that name (subject to discussion) as a placeholder, I would recommend the following:
- Change
convert_to_tensorto e.g.convert_to_backend_array. - The type hint
Tensorwithin the backend files should be changed to e.g.BackendArray. Ideally we'd also do something a bit more specific than justBackendArray = Any, though I understand this might be hard given how our build works.
Those are the important things, I think, but in addition:
- We might consider changing Node so that it wraps
tn.Tensorrather than a backend array directly. (Edit: let's actually not do this)
- The type hint
Tensorwithin the backend files should be changed to e.g.BackendArray. Ideally we'd also do something a bit more specific than justBackendArray = Any, though I understand this might be hard given how our build works.
The type hint also appears at other places, not just in the backend files. Those need to be changed as well.
- We might consider changing Node so that it wraps
tn.Tensorrather than a backend array directly.
I'd rather not add this dependency into Node. It doesn't by us a lot, but makes code maintenance potentially a lot harder.
Alright, let's junk the Node thing then.