Skip to content

Indexing a mapped tensor after permutation #20

@rpina61

Description

@rpina61

Hi,

First off, fantastic utility and much appreciated. Makes handling my 5-10GB data sets so much easier than the rather clunky and slow Matlab native memmapfile. I am using the MappedTensor version from Matlab File Exchange. I have a particular use case wherein I permute my tensor, and then attempt to populate with some values. Simple example:

mt = MappedTensor(100,200,10);
mt = permute(mt,[3,1,2]);
[nr,nc,nf] = size(mt);
mt(:,:,1) = randn(nr,nc);

This gives the following error ...

Error using mapped_tensor_shim
*** mapped_tensor_shim: In an assignment A(I) = B, the number of elements in B and I must be the
same.

Error in MappedTensor>mt_write_data (line 1837)
hShimFunc('write_chunks', hDataFile, mnFileChunkIndices, vnUniqueDataIndices, vnDataSize, strClass, nHeaderBytes, cast(tData, strClass), double(bBigEndian));

Error in indexing (line 598)
mt_write_data(mtVar.hShimFunc, mtVar.hRealContent, S, mtVar.vnOriginalSize, mtVar.strStorageClass, mtVar.nHeaderBytes, tfData, mtVar.bBigEndian, mtVar.hRepSumFunc, mtVar.hChunkLengthFunc);

Should I be accessing the permuted tensor differently? Any help would be appreciated.

Cheers,

Robert

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions