• Shucai Xiao's avatar
    Keep std shape (#1059) · 98dfdf15
    Shucai Xiao authored
    This PR is the resolve two problems in the issue#999, i.e., non_standard_shape input to reshape and reduce_mean.
    Three fixes:
    
    Any operator that has a standard shape requirement will add a contiguous input for its input.
    Eliminate_contiguous, when computing whether a contiguous can be removed, we should use all the updated args, not just the one that is being checked.
    In two optimization in the simplify_reshape, we remove the contiguous in the reshaper name list, since eliminate_contiguous will remove the contiguous if it can be removed.
    the solution is add an attribute to the operator that requires standard input shape, then in the auto_contiguous pass, add a contiguous to every input of such operators.
    98dfdf15
onnx_parser.cpp 15.6 KB