reverendbedford / neml2

GPU enabled material modeling and inference library
Other
10 stars 9 forks source link

Improve Python API for converting between NEML2 tensors and PyTorch tensor #130

Closed hugary1995 closed 3 months ago

hugary1995 commented 7 months ago

The current API isn't the most ideal because we require one or two .tensor() calls to convert from neml2.tensors.LabeledTensor or neml2.tensors.BatchTensor to torch.Tensor. We should think about ways of allowing implicit conversion.