Skip to content

🧹 Generalize _create_edges_from_inputs logic in tracers#5

Open
harshithluc073 wants to merge 1 commit intomainfrom
fix-duplicate-create-edges-inputs-17416755554038460557
Open

🧹 Generalize _create_edges_from_inputs logic in tracers#5
harshithluc073 wants to merge 1 commit intomainfrom
fix-duplicate-create-edges-inputs-17416755554038460557

Conversation

@harshithluc073
Copy link
Owner

🎯 What: The duplicated logic in _create_edges_from_inputs for PyTorchTracer and TensorFlowTracer was generalized and moved to the BaseTracer class.
💡 Why: This improves code maintainability by reducing repetition and allowing future framework-specific tracers to inherit this behavior with minimal code (only implementing _is_framework_tensor and _tensor_to_metadata).
Verification: Ran pytest tests for pytorch_tracer, profiling, and graph to ensure no functionality is broken and metadata generation remains correct. Ensure framework imports remain lazy to prevent NameError.
Result: Improved maintainability of execution graph generation without changing its logic or introducing framework dependency conflicts.


PR created automatically by Jules for task 17416755554038460557 started by @harshithluc073

Moved the duplicated `_create_edges_from_inputs` logic from `TensorFlowTracer` and `PyTorchTracer` to the `BaseTracer`.
Added `_is_framework_tensor` and `_tensor_to_metadata` abstract methods to ensure flexible integration of framework-specific checks. This removes duplication and simplifies maintainability across all tracer implementations.

Co-authored-by: harshithluc073 <101515387+harshithluc073@users.noreply.github.com>
@google-labs-jules
Copy link

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant