DylanMuir/MappedTensor

a=cast(a) could be implemented with strClass

marcsous opened this issue · 1 comments

When casting the entire MappedTensor, it seems it could be a trivial operation by just returning the header with the strClass changed. Then there would be no need to being the array into memory, as it does currently.

>> a=MappedTensor(100);
>> b=single(a);
Warning: --- MappedTensor: Warning: This command will allocate memory for the
entire tensor! 
> In MappedTensor.MappedTensor>MappedTensor.cast at 1368
  In MappedTensor.MappedTensor>MappedTensor.single at 1352 

That's a good point. I interpreted those "cast" commands as really casting the entire object to whatever class. I pushed the change.