Closed dtch1997 closed 1 week ago
The recent updates have primarily revolved around refactoring and enhancing the existing graph-related classes and utilities. Key changes include the introduction of the TensorGraphIndexer
class for better handling of tensor-based graphs, updates to sae_eap/graph/viz.py
for consistent graph operations, and the creation of the DeviceManager
class for more versatile device management in sae_eap/utils.py
.
Files | Summary |
---|---|
sae_eap/graph/index.py |
Refactored to introduce TensorGraphIndexer , updated node indexing logic, and modified import statements and method signatures. |
sae_eap/graph/viz.py |
Updated to use TensorGraph instead of Graph for graphical visualization of tensor-based graphs. |
sae_eap/utils.py |
Introduced DeviceManager class, added get_default_device function, and refactored get_device function to be part of the new class. |
sequenceDiagram
participant User
participant TensorGraph
participant TensorGraphIndexer
User->>TensorGraph: Instantiate TensorGraph
User->>TensorGraphIndexer: Instantiate TensorGraphIndexer with TensorGraph
TensorGraphIndexer->>TensorGraph: build_index(graph)
TensorGraph->>TensorGraphIndexer: Return indexed graph
sequenceDiagram
participant User
participant DeviceManager
User->>DeviceManager: instantiate DeviceManager
User->>DeviceManager: set_device(device)
User->>DeviceManager: use_device() as context manager
DeviceManager-->>User: Ignoring changes
User->>DeviceManager: get_device()
DeviceManager-->>User: Return current device
In the garden where tensors grow,
Indexers dance, they ebb and flow,
Devices now with care we switch,
Graphs visualize without a hitch.
Change is here, the code's refined,
With each commit, success we'll find!
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
New Features
DeviceManager
class for managing devices, including methods to get, set, and temporarily switch devices.get_default_device()
function to retrieve the default device.Refactor
get_device()
function intoDeviceManager
class.TensorGraph
and specific node types likeSrcNode
andDestNode
.