Reshaping a PyTorch tensor to 3 dimensions when it is originally 2 dimensions?
I would like to take a PyTorch tensor that I have, originally of shape torch.Size([15000, 23]) and reshape it such that it is compatible to run in spiking neural network (snnTorch is the framework I am using in PyTorch). The shape of the tensor to input into the SNN should [time x batch_size x feature_dimensions] (more information on this can be found here.
Right now, I am using the following code:
    # Create data of dimensions [time x batch_size x feature_dimensions]
    time_steps = 200
    batch_size = 1
    feature_dimensions = torch_input_tensor.size(dim = 1)
    torch_input_tensor_reshaped = torch.reshape(torch_input_tensor, (time_steps, batch_size, feature_dimensions))
    print(torch_input_tensor_reshaped.size())
    print(torch_input_tensor_reshaped)

When I run this code, I get the following error:
RuntimeError: shape '[200, 1, 23]' is invalid for input of size 345000

I may be using the wrong function to do this, but the idea is that I currently have 15000 data points, and 23 input features. I want to essentially feed in the same data point (23 features, 1 data point) 200 times (200 time steps).
In the example provided in the link, the use the following code:
spk_in = spikegen.rate_conv(torch.rand((200, 784))).unsqueeze(1)
The unsqueeze function is for the input along dim=1 to indicate 'one batch' of data.
How can I make my data shape compatible to run in an SNN?

The thing with SNNs is that they are time-varying, so if your data is time-static, then your options are either to:

pass the same sample at every time step to the network, or
convert it into a spike-train before passing it in.

You appear to be going for (2), although (1) might be easier.
During training, you would pass the same sample to the network over and over again:
for step in range(num_steps):
    cur1 = self.fc1(x)

If your input was time varying, you would have to change x to x[step] to iterate through each time step. An example of this with MNIST is given here.
If the above code doesn't help, then it'd be useful to see how you define your network. Try something like:
# Define Network
class Net(nn.Module):
    def __init__(self):
        super().__init__()

        # Initialize layers
        self.fc1 = nn.Linear(23, 100) # 23 inputs, 100 hidden neurons
        self.lif1 = snn.Leaky(beta=0.9) # randomly chose 0.9 
        self.fc2 = nn.Linear(100, num_outputs) # change num_outputs to your number of classes
        self.lif2 = snn.Leaky(beta=0.9)

    def forward(self, x):

        # Initialize hidden states at t=0
        mem1 = self.lif1.init_leaky()
        mem2 = self.lif2.init_leaky()

        # Record the final layer
        spk2_rec = []
        mem2_rec = []

        for step in range(num_steps):
            cur1 = self.fc1(x)
            spk1, mem1 = self.lif1(cur1, mem1)
            cur2 = self.fc2(spk1)
            spk2, mem2 = self.lif2(cur2, mem2)
            spk2_rec.append(spk2)
            mem2_rec.append(mem2)

        return torch.stack(spk2_rec, dim=0), torch.stack(mem2_rec, dim=0)


