Occlusion Sensitivity-Sliding window shape

I am working with a tensor shape ([1,9]) and passing it as a tuple of bath size:2.
I am unable to pass the right sliding window shape for Occlusion Model.
Can you help me to know what would be the ideal input for sliding window shape and stride?
A snippet of my Occlusion model is here:

clinical=torch.stack(tuple(clinical), dim=1) #torch.Size([2, 9])
clinical = clinical[:, :].detach().cpu().numpy()
ablator = Occlusion(model)
attr = ablator.attribute(tuple(clinical), target=ds_item[‘Class’], sliding_window_shapes=(2,9))
occ_sens = OcclusionSensitivity(nn_module=my_model, n_batch=1, stride=(2,2))
occ_map, most_probable_class = occ_sens(clinical,
b_box=[-1, -1, 2, 3, -1, -1, -1, -1])

Error message:
in _format_and_verify_sliding_window_shapes
assert len(sliding_window_shapes) == len(
AssertionError: Must provide sliding window dimensions for each input tensor.

Hi @Roshni_Pathak , it looks like the input being passed to Occlusion here - tuple(clinical) - is a tuple of 2 numpy arrays. It is expected that the input should be a torch tensor.

For the sliding window shape, if your model’s input will still be 2 separate tensors, then the sliding window shape of each should be a separate tuple with one element e.g. ((9,), (9,)). This corresponds to one sliding window of length 9, which is equivalent to occluding each of the full input tensors together.
Alternatively, if the input to the model (or wrapper forward function) would be a tensor of shape 2x9 such as the initial clinical tensor, then the sliding window shape can just be provided as (9,). The stride for Occlusion is not relevant if the sliding window covers the entire tensor, since it will not be shifted. If you would like to occlude smaller segments of the tensor, a smaller sliding window can be selected, with stride defining the shift of the window at each step. For more info regarding the Occlusion parameters, you can refer to the documentation here.