File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -398,9 +398,13 @@ def _load_extra_decoders_once():
398398
399399def  decode_avif (input : torch .Tensor , mode : ImageReadMode  =  ImageReadMode .UNCHANGED ) ->  torch .Tensor :
400400    _load_extra_decoders_once ()
401+     if  input .dtype  !=  torch .uint8 :
402+         raise  RuntimeError (f"Input tensor must have uint8 data type, got { input .dtype }  )
401403    return  torch .ops .extra_decoders_ns .decode_avif (input , mode .value )
402404
403405
404406def  decode_heic (input : torch .Tensor , mode : ImageReadMode  =  ImageReadMode .UNCHANGED ) ->  torch .Tensor :
405407    _load_extra_decoders_once ()
408+     if  input .dtype  !=  torch .uint8 :
409+         raise  RuntimeError (f"Input tensor must have uint8 data type, got { input .dtype }  )
406410    return  torch .ops .extra_decoders_ns .decode_heic (input , mode .value )
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments