Git Product home page Git Product logo

Comments (10)

saulshanabrook avatar saulshanabrook commented on May 18, 2024

A (2, 2)
B (3, 2)
Concat A B (5, 2)

from metadsl.

saulshanabrook avatar saulshanabrook commented on May 18, 2024

Take 2 (Concat A B) (2 2)

from metadsl.

saulshanabrook avatar saulshanabrook commented on May 18, 2024

Want to remove conditional statement if we know outer shape is 2 so idx[0] will always be less than 2

def idx_fn(idx):
   if  idx[0] < 2:
       return A[idx[0], *idx[1:]]
   return B[idx[0] - 2, *idx[1:]]
idx_fn(0, 0)
idx_fn(0, 1)
idx_fun(1, 0)
idx_fun(1, 1)

from metadsl.

saulshanabrook avatar saulshanabrook commented on May 18, 2024

Generated code:

for i in range(2):
   for j in range(2)
       a[i, j] = idx_fun(i, j)

from metadsl.

saulshanabrook avatar saulshanabrook commented on May 18, 2024

http://docs.idris-lang.org/en/latest/tutorial/typesfuns.html#the-finite-sets

from metadsl.

saulshanabrook avatar saulshanabrook commented on May 18, 2024

Maybe we need set arithmetic:

Sympy has range and interval types

from metadsl.

saulshanabrook avatar saulshanabrook commented on May 18, 2024

sympy/sympy#14106

from metadsl.

saulshanabrook avatar saulshanabrook commented on May 18, 2024

Could be reimplemented in uarray without relying on sympy: https://en.wikipedia.org/wiki/Interval_arithmetic

from metadsl.

saulshanabrook avatar saulshanabrook commented on May 18, 2024

Notebook aaron created to try out interval types: http://nbviewer.jupyter.org/gist/saulshanabrook/57edd46cdc3b52ec4904dc9ab2d07307

from metadsl.

saulshanabrook avatar saulshanabrook commented on May 18, 2024

Could possibly be done with "analysis" of egg, if we want to go that way

from metadsl.

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.