No. Categorical crossentropy (cce) loss in TF is not equivalent to cce loss in PyTorch.
The problem is that there are multiple ways to define cce and TF and PyTorch does it differently.
I haven’t found any builtin PyTorch function that does cce in the way TF does it, but you can easily piece it together yourself:
>>> y_pred = torch.tensor([[0.05, 0.95, 0], [0.1, 0.8, 0.1]])
>>> y_true = torch.tensor([1, 2])                                                                                                                                         
>>> nn.NLLLoss()(torch.log(y_pred), y_true)                                                                                                                               
tensor(1.1769)

The labels in y_true corresponds to TF’s one-hot encoding.