Ganga:

can i take samples less than batch_size for evaluation?


Yes, the batch size specified in the DataLoader can be larger than the actual Dataset and you would get a single batch containing all samples as seen here:
class MyDataset(Dataset):
    def __init__(self):
        self.data = torch.randn(200, 1)
        
    def __getitem__(self, idx):
        x = self.data[idx]
        return x

    def __len__(self):
        return len(self.data)

dataset = MyDataset()
loader = DataLoader(dataset, batch_size=256)

for data in loader:
    print(data.shape)
> torch.Size([200, 1])