Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[te] Fix bugs with shift operators (#49271) #49396

Closed
wants to merge 1 commit into from

Commits on Dec 15, 2020

  1. [te] Fix bugs with shift operators (pytorch#49271)

    Summary:
    Pull Request resolved: pytorch#49271
    
    Two things:
    
    1. These throw exceptions in their constructor, which causes a segfault (*), so
       move the exceptions to ::make.
    2. They technically support FP types but the rules are complicated so let's not
       bother.
    
    (*) The reason for the segfault: all Exprs including these inherit from
    KernelScopedObject, whose constructor adds the object to a list for destruction
    at the end of the containing KernelArena's lifetime.  But if the derived-class
    constructor throws, the object is deleted even though it's still in the
    KernelArena's list.  So when the KernelArena is itself deleted, it double-frees
    the pointer and dies.  I've also fixed And, Or, and Xor in this diff.
    ghstack-source-id: 118594998
    
    Test Plan: `buck test //caffe2/test:jit`
    
    Differential Revision: D25512052
    
    fbshipit-source-id: f3ca16f208c427cd3d740e8971302d8d504240fb
    bertmaher authored and facebook-github-bot committed Dec 15, 2020
    Configuration menu
    Copy the full SHA
    67da5af View commit details
    Browse the repository at this point in the history