I tried your code and it seems to work, but is unfortunately painfully slow.
I changed the optimizer to Adam and initialized the weights with xavier_uniform.
This code should give you a loss of approx. 0.204.
torch.manual_seed(2809)

class LogisticRegression(nn.Module):
    def __init__(self, input_size, num_class):
        super(LogisticRegression, self).__init__()
        self.linear = nn.Linear(input_size, num_class)
        self.initialize()
        
    def initialize(self):
        nn.init.xavier_uniform(self.linear.weight.data)
        self.linear.bias.data.zero_()

    def forward(self, x):
        out = self.linear(x)
        return F.sigmoid(out)


data = pd.read_csv('~/Downloads/ex2data1.txt', header=None)

X = Variable(torch.from_numpy(data.iloc[:, :2].as_matrix()).float())
Y = Variable(torch.from_numpy(data.iloc[:, 2].as_matrix()).float().view(-1, 1))

input_size = 2
num_class = 1
total_epoch = 250000
learning_rate = 1e-4

model = LogisticRegression(input_size, num_class)
criterion = nn.BCELoss()
optimizer = torch.optim.Adam(model.parameters(), lr=learning_rate)

loss_history = []

for epoch in range(total_epoch):
    output = model(X)
    loss = criterion(output, Y)
    optimizer.zero_grad()
    loss.backward()
    optimizer.step()

    if (epoch + 1) % 10000 == 0:
        print('Epoch: [%d/%d], Loss: %.4f' %(epoch+1, total_epoch, loss.data[0]))
    loss_history.append(loss.data[0])