Implement a function to check TensorNetwork consitency.
To detect present internal errors we should check at various points that a TensorNetwork is in a consistent state.
To detect present internal errors we should check at various points that a TensorNetwork is in a consistent state.