Skip to content

TEOSC (Tensor Operations Static Counter) is a static analysis tool designed to count Pytorch Tensor operations inside python files.

License

Notifications You must be signed in to change notification settings

jcrucesdeveloper/TEOSC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TEOSC - Tensor Operations Static Counter

A tool to count PyTorch tensor operations in Python files, Jupyter notebooks, and entire repositories.

Installation

git clone https://github.com/jcrucesdeveloper/TEOSC
python teosc.py file.py

Usage

Basic Usage

# Analyze a single Python file
python teosc.py path/to/file.py

# Analyze a Jupyter notebook
python teosc.py path/to/notebook.ipynb

# Analyze an entire directory recursively
python teosc.py path/to/directory

Save Results to File

# Save results to a file
python teosc.py path/to/file.py -o results.txt

Output Format

The tool provides a summary of all PyTorch operations found in the analyzed files:

[RESULTS] Total Operation Summary:
--------------------------------------------------
Files scanned (3):
  - /path/to/file1.py
  - /path/to/file2.py
  - /path/to/notebook.ipynb
--------------------------------------------------
Operation Count Summary:
tensor: 5
add: 3
matmul: 2
...
--------------------------------------------------

Supported Operations

The tool counts various PyTorch operations check data/pytorch_operations.txt

License

Distributed under the MIT License. See LICENSE for more information.

Contact

email: jcrucesdeveloper@gmail.com

About

TEOSC (Tensor Operations Static Counter) is a static analysis tool designed to count Pytorch Tensor operations inside python files.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published