-
Notifications
You must be signed in to change notification settings - Fork 16
Description
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.