File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ def _encode_tensor(
140140        # this creates a copy of the tensor 
141141        obj  =  obj .contiguous () if  not  obj .is_contiguous () else  obj 
142142        #  view the tensor as a 1D array of bytes 
143-         arr  =  obj .view ((obj .numel (),)).view (torch .uint8 ).numpy ()
143+         arr  =  obj .view ((obj .numel (),  )).view (torch .uint8 ).numpy ()
144144        if  obj .nbytes  <  self .size_threshold :
145145            data  =  msgpack .Ext (CUSTOM_TYPE_RAW_VIEW , arr .data )
146146        else :
@@ -228,7 +228,7 @@ def _decode_tensor(self, arr: Any) -> torch.Tensor:
228228        # the returned memory is non-writeable. 
229229        buffer  =  self .aux_buffers [data ] if  isinstance (data , int ) \
230230            else  bytearray (data )
231-         arr  =  np .ndarray (buffer = buffer , dtype = np .uint8 , shape = (len (buffer ),))
231+         arr  =  np .ndarray (buffer = buffer , dtype = np .uint8 , shape = (len (buffer ),  ))
232232        torch_dtype  =  getattr (torch , dtype )
233233        assert  isinstance (torch_dtype , torch .dtype )
234234        return  torch .from_numpy (arr ).view (torch_dtype ).view (shape )
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments