Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues in printing of ttensor #355

Closed
tgkolda opened this issue Dec 12, 2024 · 2 comments
Closed

Issues in printing of ttensor #355

tgkolda opened this issue Dec 12, 2024 · 2 comments
Labels
doing Actively being worked on

Comments

@tgkolda
Copy link
Collaborator

tgkolda commented Dec 12, 2024

The printing of a ttensor has a few problems:

  1. It says it's a "Tensor" rather than a "Tucker Tensor".
  2. The core is printed in C-order rather than in terms of its frontal slices.
  3. There is a missing line break between the printing of the core and the first factor matrix, U[0].
  4. Suggest writing "core[...]=" rather than "data[...]=" when printing the core.
G41 = ttb.tensor(np.array([1,1,0,1,1,0,0,1]),(2,2,2));
U = np.array([[1, 0],[0, -1],[1, 1]]);
V = np.array([[1, -1],[1, 1],[0, 1]]);
W = np.array([[0, 1],[1, 1],[1, 0]]);
X41_tt = ttb.ttensor(G41, [U, V, W])
print(X41_tt)
Tensor of shape: (3, 3, 3)
	Core is a
	tensor of shape (2, 2, 2)
	data[0, :, :] =
	[[1 1]
	 [0 0]]
	data[1, :, :] =
	[[1 0]
	 [1 1]]	U[0] = 
		[[ 1  0]
		 [ 0 -1]
		 [ 1  1]]
	U[1] = 
		[[ 1 -1]
		 [ 1  1]
		 [ 0  1]]
	U[2] = 
		[[0 1]
		 [1 1]
		 [1 0]]
@ntjohnson1
Copy link
Collaborator

  1. Makes sense, we should fix
  2. This uses the dense tensor printing so when that's fixed we get that for free here
  3. Makes sense
  4. Hmm we can probably indent the whole core print out so it's clearer that the Core is note captures all of that

@ntjohnson1 ntjohnson1 added the doing Actively being worked on label Dec 13, 2024
@ntjohnson1
Copy link
Collaborator

Marking as closed via #353 (naming data to core should get resolved in discussion on #350)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doing Actively being worked on
Projects
None yet
Development

No branches or pull requests

2 participants