Assuming your input uses a shape of [batch_size, *], you could set the batch_size to 1 and pass this single sample to the model.
The rest of the code should stay the same, as the used method should not depend on the actual batch size.