@@ -443,21 +443,21 @@ public static Tensor erase(Tensor img, int top, int left, int height, int width,
443
443
/// The image is expected to have […, H, W] shape, where … means an arbitrary number of leading dimensions.
444
444
/// </summary>
445
445
/// <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 )
447
447
{
448
448
var dtype = torch . is_integral ( input . dtype ) ? ScalarType . Float32 : input . dtype ;
449
449
450
450
if ( kernelSize . Count == 1 ) {
451
451
kernelSize = new long [ ] { kernelSize [ 0 ] , kernelSize [ 0 ] } ;
452
452
}
453
453
454
- if ( sigma == null || sigma . Length == 0 )
454
+ if ( sigma == null || sigma . Count == 0 )
455
455
{
456
456
sigma = new float [ ] {
457
457
0.3f * ( ( kernelSize [ 0 ] - 1 ) * 0.5f - 1 ) + 0.8f ,
458
458
0.3f * ( ( kernelSize [ 1 ] - 1 ) * 0.5f - 1 ) + 0.8f ,
459
459
} ;
460
- } else if ( sigma . Length == 1 ) {
460
+ } else if ( sigma . Count == 1 ) {
461
461
sigma = new float [ ] {
462
462
sigma [ 0 ] ,
463
463
sigma [ 0 ] ,
@@ -892,7 +892,7 @@ private static Tensor GetGaussianKernel1d(long size, float sigma)
892
892
return pdf / sum ;
893
893
}
894
894
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 )
896
896
{
897
897
using var tX1 = GetGaussianKernel1d ( kernelSize [ 0 ] , sigma [ 0 ] ) ;
898
898
using var tX2 = tX1 . to ( dtype , device ) ;
0 commit comments