Skip to content

Libcst code generation #900

Open
Open
@justinchuby

Description

@justinchuby
  • Remove assignment and return the last expression

     @script()
     def aten_split(self, split_size):
         val_return_val = op.SplitToSequence(val_self, val_split_size, axis=0)
         return return_val

    should become

     @script()
     def aten_split(self, split_size):
         return op.SplitToSequence(val_self, val_split_size, axis=0)
  • Transform if graphs into branches

  • Normalize invalid node names

  • Handle function domain names: Currently the domain name is appended onto the function name, but that is not a valid name

  • Use value_ints etc. to replace make_tensor calls

     val_414 = op.Constant(
         value=onnx.helper.make_tensor(
             name="value", data_type=onnx.TensorProto.INT64, dims=[2], vals=[-1, 8]
         )
     )

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions