Skip to content

Issues in printing of ttensor #355

@tgkolda

Description

@tgkolda

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]]

Metadata

Metadata

Assignees

No one assigned

    Labels

    doingActively being worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions