Uh oh!
There was an error while loading. Please reload this page.
[Relay] Add Defunctionalization Pass - #6400
Conversation
| raise Exception('unknown mode') | ||
| def Defunctionalization(expr, mod): | ||
| """ |
cc: @wweic@MarisaKirisame@zhiics @icemelon9 @ZihengJiang@jroesch@tqchen |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| Function Specialize(const Function& f, const Array<Type> type_args) { | ||
| auto map = tvm::Map<TypeVar, Type>(); | ||
| for (size_t i = 0; i < type_args.size(); i++) { | ||
| map.Set(f->type_params[i], type_args[i]); |
Uh oh!
There was an error while loading. Please reload this page.
| continue; | ||
| } | ||
| // we assume arg is either an identifier (var or globalvar) or a function |
There was a problem hiding this comment.
refactor the stuff after continue into a function
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
MarisaKirisame
left a comment
There was a problem hiding this comment.
pretty good. one more small nit, and please fix the CI.
| continue; | ||
| } | ||
| args.push_back(EncodeArg(arg, type)); |
There was a problem hiding this comment.
if else is a better style then continue.
There was a problem hiding this comment.
yep, looks like CI issue was caused by this: #6434
MarisaKirisame
commented
Sep 10, 2020
Thx @hypercubestart@yzhliu . |
* type args not automatically inferred... * working on type arg infer * fix type arg infer * WIP * wip * wip * revert type_infer * working * fix up test * fix * remove DeGlobal * lint * fix std move * comments * fix comments * review * style
* type args not automatically inferred... * working on type arg infer * fix type arg infer * WIP * wip * wip * revert type_infer * working * fix up test * fix * remove DeGlobal * lint * fix std move * comments * fix comments * review * style
* type args not automatically inferred... * working on type arg infer * fix type arg infer * WIP * wip * wip * revert type_infer * working * fix up test * fix * remove DeGlobal * lint * fix std move * comments * fix comments * review * style
introduces a defunctionalization pass based upon Type-Driven Defunctionalization, transforming a higher-order functional program into a first-order program.
currently it assumes a number of characteristics about the program, and will be extended upon in future work