TensorNetwork
TensorNetwork copied to clipboard
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_tensor
to e.g.convert_to_backend_array
. - The type hint
Tensor
within 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.Tensor
rather than a backend array directly. (Edit: let's actually not do this)