Git Product home page Git Product logo

Comments (1)

patrick-kidger avatar patrick-kidger commented on May 3, 2024

Haha yup, this has always been on the wish-list of those doing dynamic array shape-checking.

One of the complexities here is what to do if someone writes e.g.

def f(x: f["2*dim"]) -> f["3*dim"]): ...

or worse

def f(x: f["dim+(dim**2)"]): ...

where in general we'd have to solve an arbitrary algebraic expression simply to figure out what dim is, and whether all of the arguments are consistent.

Nonetheless, as of version 0.1.0, a version of this feature is now supported!

We take a pragmatic approach, and simply mandate that all dimensions must have had a "normal" name binding by the time they occur in a symbolic expression. Typically this means that you have to use "normal" name bindings in the annotations for the arguments, but are then free to use these in arbitrary symbolic expressions in the annotation for the return type. In practice I imagine that's 99% of all use-cases for this feature any way.

from jaxtyping.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.