(graph_signature: Optional[ExportGraphSignature])
| 509 | |
| 510 | |
| 511 | def _do_user_inputs_exist(graph_signature: Optional[ExportGraphSignature]) -> bool: |
| 512 | if graph_signature is None: |
| 513 | return False |
| 514 | |
| 515 | user_inputs = list( |
| 516 | filter( |
| 517 | lambda input: input.kind == InputKind.USER_INPUT, |
| 518 | graph_signature.input_specs, |
| 519 | ) |
| 520 | ) |
| 521 | |
| 522 | # Return false if: |
| 523 | # - there are no inputs. |
| 524 | # - if user inputs are all prims (as this currently |
| 525 | # causes the memory planning verifier to blow up). |
| 526 | # Otherwise, return true. |
| 527 | return any( |
| 528 | not isinstance(input.arg, ConstantArgument) |
| 529 | or not isinstance(input.arg.value, (int, float, bool, str)) |
| 530 | for input in user_inputs |
| 531 | ) |
| 532 | |
| 533 | |
| 534 | def get_graph_input_tensors( |
no outgoing calls