coremltools icon indicating copy to clipboard operation
coremltools copied to clipboard

Implementation of basic linear algebra routines

Open GLivshits opened this issue 2 years ago • 4 comments

Hello. While trying to invert a model via your framework I've faced an absence of inverse matrix computation support (torch.inverse). I've tried to implement it by myself (via looking your code and creating my own operator via numpy), but it fails right after custom conversion: "ValueError: Cannot add const = matrixinv(x=%test, name="x")" at matmul operation which involved inverted matrix. Since there was another issue (with use of SVD) I think it would be great if raw torch and tensorflow routines would be added or a coincise method to register a custom op would be provided.

GLivshits avatar Jun 30 '22 10:06 GLivshits

We're already tracking support for PyTorch inverse in #958. Are there other PyTorch linear algebra routines you would like to see supported?

You also mentioned TensorFlow. What linear algebra methods would you like supported there?

TobyRoseman avatar Jun 30 '22 23:06 TobyRoseman

I also need SVD. My particular choice is PyTorch, but I've mentioned Tensorflow just to keep some sort of "unity" with other DL frameworks :)

GLivshits avatar Jul 01 '22 08:07 GLivshits

Ok, so you would also like support for torch.svd, is that correct?

TobyRoseman avatar Jul 01 '22 18:07 TobyRoseman

@TobyRoseman Would coremltools put torch.linalg.svd in implementation schedule? (torch.svd is deprecated by PyTorch)

heathcliffYang avatar Sep 14 '23 02:09 heathcliffYang