Thanks ,your reply is helpful .Before moving to numpy- then tensor.
I need little help more please.
this is how is combined all .mat structure in one mat.See so you can get idea for my problem.
% % Making single mat file for all images detail
% for i=1:3064                     
%     fname = strcat('data/figshareBrainTumorDataPublic/',num2str(i),'.mat')
%     load(fname)
%     label(i) = cjdata.label;
%     PID(i) = {cjdata.PID};
%     if (size(cjdata.image,1) ~= 512) 
%         image(i,:,:) = imresize(cjdata.image, [512, 512]);
%         tumorMask(i,:,:) = imresize(cjdata.tumorMask, [512, 512]);
%     else
%         image(i,:,:) = cjdata.image;
%         tumorMask(i,:,:) = cjdata.tumorMask;
%     end
%     clear cjdata fname
% end
% save('data/figshareBrainTumorDataPublicNewSingle/data.mat', 'label', 'PID', 'image', 'tumorMask');

The code in Python so far is :
import scipy.io as io
fname='./data.mat'
data= io.loadmat(fname)
fname=data['label','PID','image','tumorBorder','tumorMask'] 

‘image’ has all 3064 images.How can I access one image from it :fname=data[‘image’]   or selective images.like 4 image.Thankyou for helping me
Please suggest best way to make the data ready for pytorch CNN.I m beginner at this.