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

Do we want to support tensors with boolean values? #270

Open
dmdunla opened this issue Sep 28, 2023 · 0 comments
Open

Do we want to support tensors with boolean values? #270

dmdunla opened this issue Sep 28, 2023 · 0 comments
Labels
enhancement New feature or request question Further information is requested
Milestone

Comments

@dmdunla
Copy link
Collaborator

dmdunla commented Sep 28, 2023

This is a change from MATLAB TTB, where boolean tensors are represented using values of 1 (true) and 0 (false), rather that as true boolean tensors:

>> T = tensor([1,2,3,4],[2,2]);
>> T > T
ans is a tensor of size 2 x 2
	ans(:,:) = 
	   0   0
	   0   0

And here is the corresponding pyttb code:

>>> T = ttb.tensor(np.array([1,2,3,4]),(2,2))
>>> T > T
tensor of shape (2, 2)
data[:, :] =
[[False False]
 [False False]]

We currently do not explicitly manage dtypes of tensors in array (analogous to numpy), although we use numpy arrays for much of the underlying data in pyttb tensors, so we inherit some of that functionality.

If we want to support this, this would require revisiting constructors and methods that involve boolean values.

Suggestion: push this to post-2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant