Giter Site home page Giter Site logo

Comments (6)

shekhovt avatar shekhovt commented on May 27, 2024

It seems that output size specification is not supported #377. I think this one can be solved with

def broadcast(float(N, M) I0, int K) -> (O) {
O(n, m, k) = I0(n, m) where k in 0:K
}

(I am looking at the reference https://facebookresearch.github.io/TensorComprehensions/semantics.html)
I haven't tried this yet.

from tensorcomprehensions.

ghostplant avatar ghostplant commented on May 27, 2024

@shekhovt That's great, thank you! What about one_hot which has if condition,
something like: O(x, k) = (k == A(x)) ? 1 : 0?

from tensorcomprehensions.

shekhovt avatar shekhovt commented on May 27, 2024

Note that you can use look-up on the right hand side, like
Loss += Logits(b,Target(b))
Just to say that expanding everything by broadcasting or one_hot might not be needed.

As I understand it, the language allows to do multi-dimensional reductions and lookups, but not going to be very useful for simple standalone operations you mentioned. There would be an implementation in pytorch or it would be straightforward to do it with CUDA extensions https://pytorch.org/tutorials/advanced/cpp_extension.html

from tensorcomprehensions.

ghostplant avatar ghostplant commented on May 27, 2024

@shekhovt For broadcast:

def broadcast(float(N, M) I0, int K) -> (O) {
    O(n, m, k) = I0(n, m) where k in 0:K
}

How should I fill the second parameter? It is not a tensor but a scaler. If I didn't fill this value:

terminate called after throwing an instance of 'lang::ErrorReport'
  what():
expected ) but found 'ident' here::
def broadcast(float(N, M) I0, int K) -> (O) {
                                  ~ <--- HERE
    O(n, m, k) = I0(n, m) where k in 0:K
}

from tensorcomprehensions.

shekhovt avatar shekhovt commented on May 27, 2024

Can you actually compile TC with new CUDA and pytorch? I got now conda install TC with pytorch 0.3.1.post3 :( Does not seem very useful even if it can implement and autotune the op.

from tensorcomprehensions.

ghostplant avatar ghostplant commented on May 27, 2024

@shekhovt No, I am just using CUDA9.0 + Pytorch < 1.0 + TC and make them in docker to avoid the environment pollution, because I only need the source code it generates, which can satisfy my requirement.

from tensorcomprehensions.

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.