nowcasting_dataset
                                
                                
                                
                                    nowcasting_dataset copied to clipboard
                            
                            
                            
                        Use NamedTensors to name dimensions
https://pytorch.org/docs/stable/named_tensor.html
See this twitter conversation.
In particular, try extending xarray with a little "accessor" extension like dataarray.torch.to_tensor() (as suggested by Joe Hamman on Twitter!)
And see Joe's pull request, which implements xarray-to-pytorch-named-tensors.
But note that torch.stack doesn't yet support named tensors (here's a feature request)