TypeError: expected Tensor as element 0 in argument 0, but got list

def custom_collate_fn(batch):
input_ids = pad_sequence([item[“input_ids”] for item in batch], batch_first=True, padding_value=tokenizer.pad_token_id)
attention_mask = pad_sequence([item[“attention_mask”] for item in batch], batch_first=True, padding_value=1) # Attention mask should be 1s
labels = pad_sequence([item[“labels”] for item in batch], batch_first=True, padding_value=tokenizer.pad_token_id)
return {“input_ids”: input_ids, “attention_mask”: attention_mask, “labels”: labels}