• Ted Themistokleous's avatar
    Imply type of literal returned based on input protobuff for zero elem… (#1326) · bb0e04ce
    Ted Themistokleous authored
    * Imply type of literal returned based on input protobuff for zero element constant values.
    
    This saves us the default behavior as the onnx parsing assumes that every zero value is float. This way we're still grabbing relevant type information from the protobuff instead and wont fail our data type checks for if them/else blocks from onnx
    
    * Revert "Imply type of literal returned based on input protobuff for zero element constant values."
    
    This reverts commit 390bb853
    
    .
    
    * Add  test case to parse in empty constant int64 proto buffer
    
    I think the previous test case was aliasing an issue where we default to float but need to actually read in int64 instead of int32
    
    * fixup! Add  test case to parse in empty constant int64 proto buffer
    
    * Add test for non empty int64 scalar
    
    Add one item in the np array to use for the constant we're parsing in.
    
    * Draft partial fix
    
    * Fix test failures from previous change to read in protobuf data types correctly for empty constants.
    
    Instead of assuming things are empty and thus we default to float, reading in the correct types broke some assumptions code was using for an empty literal.
    
    * Fix formatting and naming
    
    * Fix naming with var in constant_one_val_int64_test
    Co-authored-by: default avatarcharlie <charlie.lin@amd.com>
    Co-authored-by: default avatarkahmed10 <15948690+kahmed10@users.noreply.github.com>
    bb0e04ce
parse_constant.cpp 2.37 KB