pytorch.rb 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. module Docs
  2. class Pytorch < UrlScraper
  3. self.name = 'PyTorch'
  4. self.slug = 'pytorch'
  5. self.type = 'sphinx'
  6. self.links = {
  7. home: 'https://pytorch.org/',
  8. code: 'https://github.com/pytorch/pytorch'
  9. }
  10. html_filters.push 'pytorch/entries', 'pytorch/clean_html', 'sphinx/clean_html'
  11. options[:skip] = ['cpp_index.html', 'deploy.html', 'packages.html', 'py-modindex.html', 'genindex.html']
  12. options[:skip_patterns] = [/\Acommunity/, /\A_modules/, /\Anotes/, /\Aorg\/pytorch\//]
  13. options[:attribution] = <<-HTML
  14. &copy; 2024, PyTorch Contributors<br>
  15. PyTorch has a BSD-style license, as found in the <a href="https://github.com/pytorch/pytorch/blob/main/LICENSE">LICENSE</a> file.
  16. HTML
  17. version '2' do
  18. self.release = '2.1'
  19. self.base_url = "https://pytorch.org/docs/#{release}/"
  20. end
  21. version '1' do
  22. self.release = '1.13'
  23. self.base_url = "https://pytorch.org/docs/#{release}/"
  24. end
  25. def get_latest_version(opts)
  26. get_latest_github_release('pytorch', 'pytorch', opts)
  27. end
  28. end
  29. end