Skip to content

Commit dca89aa

Browse files
author
Sidharth123-cpu
committed
[feat] cleanup
1 parent 05daaa8 commit dca89aa

File tree

4 files changed

+0
-125
lines changed

4 files changed

+0
-125
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,3 @@ yarn-error.log*
4040
*.tsbuildinfo
4141
next-env.d.ts
4242

43-
# Generated files
44-
search_data.json
45-

docs/_layouts/default.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<title>{{ page.title | default: site.title }}</title>
77
<link rel="stylesheet" href="{{ "/assets/css/style.css" | relative_url }}">
88
<link rel="icon" type="image/png" href="{{ "/assets/css/pytorch-logo.png" | relative_url }}">
9-
<script src="{{ "/assets/js/search.js" | relative_url }}"></script>
109
</head>
1110
<body>
1211
{{ content }}

docs/index.md

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ layout: default
33
---
44
Below are all known graph breaks detected by Dynamo.
55

6-
<input type="text" id="search-input" placeholder="Search graph breaks...">
7-
<div id="search-results"></div>
8-
96
- [GB0000](gb/gb0000.html) — All __torch_function__ overrides returned NotImplemented due to TypeError from user code
107
- [GB0001](gb/gb0001.html) — Argument of `as_subclass` must be a non-dispatcher-style tensor subclass
118
- [GB0002](gb/gb0002.html) — Assertion failed on symbolic shapes
@@ -258,48 +255,3 @@ Below are all known graph breaks detected by Dynamo.
258255
- [GB0249](gb/gb0249.html) — bad device argument to torch.get_device_module
259256
- [GB0250](gb/gb0250.html) — ndarray.astype(object)
260257
- [GB0251](gb/gb0251.html) — Unsupported output type for nonstrict_trace-ed function
261-
262-
(function() {
263-
var idx;
264-
var docs = {};
265-
266-
// Fetch the search data
267-
fetch('{{ site.baseurl }}/search_data.json')
268-
.then(response => response.json())
269-
.then(data => {
270-
idx = lunr(function () {
271-
this.ref('id');
272-
this.field('title', { boost: 10 });
273-
this.field('search_content');
274-
275-
data.forEach(function (doc) {
276-
this.add(doc);
277-
docs[doc.id] = doc;
278-
}, this);
279-
});
280-
281-
var searchInput = document.getElementById('search-input');
282-
var searchResults = document.getElementById('search-results');
283-
284-
searchInput.addEventListener('keyup', function () {
285-
var query = this.value;
286-
if (query.length < 2) {
287-
searchResults.innerHTML = '';
288-
return;
289-
}
290-
291-
var results = idx.search(query);
292-
var html = '<ul>';
293-
if (results.length === 0) {
294-
html += '<li>No results found.</li>';
295-
} else {
296-
results.forEach(function (result) {
297-
var doc = docs[result.ref];
298-
html += '<li><a href="' + doc.url + '">' + doc.title + '</a> — ' + doc.gb_type + '</li>';
299-
});
300-
}
301-
html += '</ul>';
302-
searchResults.innerHTML = html;
303-
});
304-
});
305-
})();

generate-site.py

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ def generate_site():
7474
<title>{{ page.title | default: site.title }}</title>
7575
<link rel="stylesheet" href="{{ \"/assets/css/style.css\" | relative_url }}">
7676
<link rel="icon" type="image/png" href="{{ \"/assets/css/pytorch-logo.png\" | relative_url }}">
77-
<script src="{{ \"/assets/js/search.js\" | relative_url }}"></script>
7877
</head>
7978
<body>
8079
{{ content }}
@@ -115,18 +114,13 @@ def generate_site():
115114
f.write(jekyll_config)
116115
print('Generated _config.yml')
117116

118-
search_index_data = []
119-
120117
# Generate index.md
121118
index_md = """\
122119
---
123120
layout: default
124121
---
125122
Below are all known graph breaks detected by Dynamo.
126123
127-
<input type="text" id="search-input" placeholder="Search graph breaks...">
128-
<div id="search-results"></div>
129-
130124
"""
131125

132126
# Add registry items to index.md
@@ -138,57 +132,6 @@ def generate_site():
138132
f.write(index_md)
139133
print('Generated index.md')
140134

141-
# Add JavaScript for search
142-
search_js = '''
143-
(function() {
144-
var idx;
145-
var docs = {};
146-
147-
// Fetch the search data
148-
fetch('{{ site.baseurl }}/search_data.json')
149-
.then(response => response.json())
150-
.then(data => {
151-
idx = lunr(function () {
152-
this.ref('id');
153-
this.field('title', { boost: 10 });
154-
this.field('search_content');
155-
156-
data.forEach(function (doc) {
157-
this.add(doc);
158-
docs[doc.id] = doc;
159-
}, this);
160-
});
161-
162-
var searchInput = document.getElementById('search-input');
163-
var searchResults = document.getElementById('search-results');
164-
165-
searchInput.addEventListener('keyup', function () {
166-
var query = this.value;
167-
if (query.length < 2) {
168-
searchResults.innerHTML = '';
169-
return;
170-
}
171-
172-
var results = idx.search(query);
173-
var html = '<ul>';
174-
if (results.length === 0) {
175-
html += '<li>No results found.</li>';
176-
} else {
177-
results.forEach(function (result) {
178-
var doc = docs[result.ref];
179-
html += '<li><a href="' + doc.url + '">' + doc.title + '</a> — ' + doc.gb_type + '</li>';
180-
});
181-
}
182-
html += '</ul>';
183-
searchResults.innerHTML = html;
184-
});
185-
});
186-
})();
187-
'''
188-
with open(os.path.join(output_dir, 'index.md'), 'a') as f:
189-
f.write(search_js)
190-
print('Appended search JavaScript to index.md')
191-
192135
# Generate individual GBID pages
193136
gb_dir = os.path.join(output_dir, 'gb')
194137
Path(gb_dir).mkdir(exist_ok=True)
@@ -248,22 +191,6 @@ def generate_site():
248191
f.write(detail_md)
249192
print(f'Generated {file_path}')
250193

251-
# Add data to search index
252-
search_content = f"{entry.get('Gb_type', '')} {entry.get('Context', '')} {entry.get('Explanation', '')} {hints_content} {manual_content}"
253-
search_index_data.append({
254-
'id': gbid.lower(),
255-
'title': gbid,
256-
'url': f'gb/{gbid.lower()}.html',
257-
'gb_type': entry.get('Gb_type', '*No Gb_type provided.*'),
258-
'search_content': search_content.replace('\n', ' ').replace('\r', ' ').strip()
259-
})
260-
261-
# Write search index to JSON file
262-
search_data_path = os.path.join(output_dir, 'search_data.json')
263-
with open(search_data_path, 'w') as f:
264-
json.dump(search_index_data, f, indent=2)
265-
print(f'Generated {search_data_path}')
266-
267194
print('Site generation complete!')
268195

269196

0 commit comments

Comments
 (0)