The following code is from the SNLI example in Pytorch.

def forward(self, inputs):
batch_size = inputs.size()[1]
state_shape = self.config.n_cells, batch_size, self.config.d_hidden
h0 = c0 = Variable(inputs.data.new(*state_shape).zero_())
outputs, (ht, ct) = self.rnn(inputs, (h0, c0))

In the above code, why h0 and c0 is created through inputs.data.new()? What inputs.data.new() actually means? Can anyone explain this piece of code? I am not understanding why we can create the h0 and c0 variable of desired shape in a normal way?