Got it, used “get_spatial_maps_and_gradients” function instead of “spatial_map_and_gradient_function”.