Skip to content

Add support for constructing tensor/ktensor from data without copying #145

@etphipp

Description

@etphipp

This is an issue to discuss adding support for creating tensor and ktensor objects (and probably others) without copying the original data the object is derived from. This will improve efficiency, especially for third-party codes that are trying to integrate with pyttb (such as GenTen). I have a PR that could be submitted that implements one proposed solution by adding a copy parameter to the from_data methods of tensor and ktensor (defaulting to True to preserve existing behavior). Note also that the various functions for creating various types of tensors from data are not entirely consistent on whether the data is copied or not.

Another reasonable solution in mind, and one that I would argue is preferable, is to never explicitly copy the data in these functions, and if the user wants a copy, to call the copy method of the class instead.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdoingActively being worked on

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions