Unable to learn by network this type of data
input_data  = [x for x in range(1, 4000)]
label_data  = [((d**3)) for d in input_data] # using power

But, This data learns quickly by the same network
input_data = [x for x in range(1, 4000)]
label_data = [((d*3)) for d in input_data] # using simple multiplication

My code is:
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data.dataloader as dataloader

import matplotlib.pyplot as plt

# network
class Network(nn.Module):
    def __init__(self):
        super(Network, self).__init__()
        self.fc1 = nn.Linear(in_features=1, out_features=50, bias=True)
        self.fc2 = nn.Linear(in_features=50, out_features=1, bias=True)
    
    def forward(self, x):
        x = F.relu(self.fc1(x))
        x = self.fc2(x)
        return x
        
net = Network()

class MyData(torch.utils.data.Dataset):
    def __init__(self, data_input, data_output):
        self.data_input = data_input
        self.data_output = data_output
        
    def __len__(self):
        return len(self.data_input)
    
    def __getitem__(self, idx):
        return {
            'x':torch.tensor([self.data_input[idx]], dtype=torch.float32), 
            'y':torch.tensor([self.data_output[idx]], dtype= torch.float32)
        }

optimizer = torch.optim.Adam(net.parameters(), lr=0.01)

input_data = [x for x in range(1, 4000)]
# label_data = [((d*3)) for d in input_data] # simple multiplication
label_data  = [((d**3)) for d in input_data]  # using power

batch_size = 100
data = torch.utils.data.DataLoader(dataset=MyData(input_data, label_data), shuffle=True, batch_size=batch_size)
criterion = nn.MSELoss()
x_data, y_data = list(),list()

for e in range(600):
    total_loss = 0
    for i, value in enumerate(data):   
        prediction = net(value['x'])
        loss = criterion(prediction, value['y'])
        total_loss+= loss.item()/batch_size
        optimizer.zero_grad()
        loss.backward()
        optimizer.step()
        
    y_data.append(total_loss/i+1)
    x_data.append(e)
        

net(torch.tensor([2], dtype=torch.float32)).item()

plt.figure(figsize=(16,9))
plt.xlabel('Epoch -->', size=20)
plt.ylabel('Loss -->', size=20)
plt.xticks(size=20)
plt.yticks(size=20)
plt.title('Loss graph')

plt.plot(x_data, y_data, color='green', linewidth=2)
plt.show()

print(total_loss/i+1) # print the last loss only