Skip to content

Update tests to also count constants #2775

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions exir/backend/test/test_partitioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,9 @@ def partition(

# Check Owning Program still owns all constant data
owning_program = delegated.exported_program()
self.assertEqual(len(owning_program.state_dict), 3)
self.assertEqual(
len(owning_program.state_dict) + len(owning_program.constants), 3
)
self.assertEqual(len(owning_program.graph_signature.buffers), 2)
self.assertEqual(len(owning_program.graph_signature.parameters), 1)

Expand Down Expand Up @@ -321,7 +323,7 @@ def partition(
delegated.exported_program().graph_module, lowered_module_node.name
)
delegated_ep = lower_module.original_module
self.assertEqual(len(delegated_ep.state_dict), 3)
self.assertEqual(len(delegated_ep.state_dict) + len(delegated_ep.constants), 3)
self.assertEqual(len(delegated_ep.graph_signature.buffers), 2)
self.assertEqual(len(delegated_ep.graph_signature.parameters), 1)

Expand Down Expand Up @@ -375,7 +377,9 @@ def partition(

# Check Owning Program still owns only buffers
owning_program = delegated.exported_program()
self.assertEqual(len(owning_program.state_dict), 2)
self.assertEqual(
len(owning_program.state_dict) + len(owning_program.constants), 2
)
self.assertEqual(len(owning_program.graph_signature.buffers), 2)
self.assertEqual(len(owning_program.graph_signature.parameters), 0)

Expand Down