@@ -443,21 +443,21 @@ public static Tensor erase(Tensor img, int top, int left, int height, int width,
443443 /// The image is expected to have […, H, W] shape, where … means an arbitrary number of leading dimensions.
444444 /// </summary>
445445 /// <returns></returns>
446- public static Tensor gaussian_blur ( Tensor input , IList < long > kernelSize , ReadOnlySpan < float > sigma )
446+ public static Tensor gaussian_blur ( Tensor input , IList < long > kernelSize , IList < float > sigma )
447447 {
448448 var dtype = torch . is_integral ( input . dtype ) ? ScalarType . Float32 : input . dtype ;
449449
450450 if ( kernelSize . Count == 1 ) {
451451 kernelSize = new long [ ] { kernelSize [ 0 ] , kernelSize [ 0 ] } ;
452452 }
453453
454- if ( sigma == null || sigma . Length == 0 )
454+ if ( sigma == null || sigma . Count == 0 )
455455 {
456456 sigma = new float [ ] {
457457 0.3f * ( ( kernelSize [ 0 ] - 1 ) * 0.5f - 1 ) + 0.8f ,
458458 0.3f * ( ( kernelSize [ 1 ] - 1 ) * 0.5f - 1 ) + 0.8f ,
459459 } ;
460- } else if ( sigma . Length == 1 ) {
460+ } else if ( sigma . Count == 1 ) {
461461 sigma = new float [ ] {
462462 sigma [ 0 ] ,
463463 sigma [ 0 ] ,
@@ -892,7 +892,7 @@ private static Tensor GetGaussianKernel1d(long size, float sigma)
892892 return pdf / sum ;
893893 }
894894
895- private static Tensor GetGaussianKernel2d ( IList < long > kernelSize , ReadOnlySpan < float > sigma , ScalarType dtype , torch . Device device )
895+ private static Tensor GetGaussianKernel2d ( IList < long > kernelSize , IList < float > sigma , ScalarType dtype , torch . Device device )
896896 {
897897 using var tX1 = GetGaussianKernel1d ( kernelSize [ 0 ] , sigma [ 0 ] ) ;
898898 using var tX2 = tX1 . to ( dtype , device ) ;
0 commit comments