@@ -602,8 +602,8 @@ def create_rotate(
602
602
return _create_rotate (
603
603
spatial_dims = spatial_dims ,
604
604
radians = radians ,
605
- sin_func = lambda th : torch .sin (torch .as_tensor (th )),
606
- cos_func = lambda th : torch .cos (torch .as_tensor (th )),
605
+ sin_func = lambda th : torch .sin (torch .as_tensor (th , dtype = torch . float32 )),
606
+ cos_func = lambda th : torch .cos (torch .as_tensor (th , dtype = torch . float32 )),
607
607
array_func = torch .as_tensor ,
608
608
)
609
609
raise ValueError ("backend {} is not supported" .format (backend ))
@@ -676,7 +676,6 @@ def create_shear(
676
676
677
677
"""
678
678
if look_up_option (backend , TransformBackends ) == TransformBackends .NUMPY :
679
- array_func = np .array
680
679
return _create_shear (spatial_dims = spatial_dims , coefs = coefs , array_func = np .array )
681
680
if look_up_option (backend , TransformBackends ) == TransformBackends .TORCH :
682
681
return _create_shear (spatial_dims = spatial_dims , coefs = coefs , array_func = torch .as_tensor )
@@ -759,7 +758,7 @@ def _create_translate(
759
758
affine = eye_func (spatial_dims + 1 )
760
759
for i , a in enumerate (shift [:spatial_dims ]):
761
760
affine [i , spatial_dims ] = a
762
- return array_func (affine )
761
+ return array_func (affine ) # type: ignore
763
762
764
763
765
764
def generate_spatial_bounding_box (
0 commit comments