Skip to content

Adds support for the evaluation of conditionals #92

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

Merged
merged 5 commits into from
Jun 15, 2020

Conversation

narendasan
Copy link
Collaborator

Description

Adds the ability to evaluate conditionals at compile time. Also adds evaluators for

  • aten::eq
  • aten::ne
  • aten::lt
  • aten::gt
  • aten::le
  • aten::ge
  • aten::add
  • aten::sub
  • aten::mul
  • aten::Bool
  • aten::Float
  • aten::not
  • aten::is
  • aten::isnot
  • aten::numel
  • aten::dim
  • aten::div
  • aten::floordiv
  • aten::floor
  • aten::warn
  • prim::min
  • prim::max
  • prim::shape
  • prim::unchecked_cast
  • prim::Uninitalized
  • prim::RaiseException

Type of change

Please delete options that are not relevant and/or add your own.

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas and hacks
  • I have made corresponding changes to the documentation and have regenerated the documentation (make html in docsrc)
  • I have added tests to verify my fix or my feature
  • New and existing unit tests pass locally with my changes

overridden

Signed-off-by: Naren Dasan <[email protected]>
Signed-off-by: Naren Dasan <[email protected]>
Adds evaluators for:
- aten::eq
- aten::ne
- aten::lt
- aten::gt
- aten::le
- aten::ge
- aten::add
- aten::sub
- aten::mul
- aten::Bool
- aten::Float
- aten::__not__
- aten::__is__
- aten::__isnot__
- aten::numel
- aten::dim
- aten::div
- aten::floordiv
- aten::floor
- aten::warn
- prim::min
- prim::max
- prim::shape
- prim::unchecked_cast
- prim::Uninitalized
- prim::RaiseException

Signed-off-by: Naren Dasan <[email protected]>
Signed-off-by: Naren Dasan <[email protected]>
@narendasan narendasan marked this pull request as draft June 11, 2020 02:44
@github-actions github-actions bot added component: conversion Issues re: Conversion stage component: converters Issues re: Specific op converters component: evaluators Issues re: Specific op evaluators labels Jun 11, 2020
@narendasan narendasan mentioned this pull request Jun 13, 2020
6 tasks
- Fixes aten::append to correctly append values and not pointers
- Fixes prim::RaiseException and aten::warn to print out strings

Signed-off-by: Naren Dasan <[email protected]>
Signed-off-by: Naren Dasan <[email protected]>
out of programs that use conditionals if it can be gaurenteed that
there is a single code path followed through the course of the
program given input information and the graph

This means that right now conditionals within loops is not supported
but if a program has a bunch of evaluatable cases and those cases
produce tensors as long as the program does not need to run both
branches conditionally at runtime the program can still be compiled

Signed-off-by: Naren Dasan <[email protected]>
Signed-off-by: Naren Dasan <[email protected]>
@narendasan narendasan marked this pull request as ready for review June 15, 2020 23:37
@narendasan narendasan merged commit ac4ac5e into master Jun 15, 2020
@narendasan narendasan deleted the narendasan/conditionals branch June 15, 2020 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: conversion Issues re: Conversion stage component: converters Issues re: Specific op converters component: evaluators Issues re: Specific op evaluators
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant