Skip to content

Creating a tensor from array versus a numpy array #337

@tgkolda

Description

@tgkolda

It seems that ttb.tensor only supports creating a tensor from a numpy array. Is there any reason it cannot create a tensor directly from a Python array?

Right now, the user has to type the following:

X = ttb.tensor(np.array([8, 9, 2, 9, 6, 1, 3, 5]), (2, 2, 2));

I'm suggesting instead that the following should be possible:

X = ttb.tensor([8, 9, 2, 9, 6, 1, 3, 5], (2, 2, 2));

Also, I'm not sure where the creation is clearly documented. I sort of inferred that it had to be a numpy array, but it's not clearly stated nor is there any example where you specify a simple tensor like this one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions