Update TensorFlow docs

pull/1165/head
Lukas Geiger 4 years ago
parent ccd20c0472
commit 7fdcee2f3c

@ -2,7 +2,7 @@ module Docs
class Tensorflow class Tensorflow
class CleanHtmlFilter < Filter class CleanHtmlFilter < Filter
def call def call
@doc = at_css('.devsite-article-inner') @doc = at_css('.devsite-article')
css('hr', '.devsite-nav', '.devsite-content-footer', '.devsite-article-body > br', '.devsite-article-meta', 'devsite-nav-buttons', '.devsite-banner', '.tfo-api img', '.tfo-notebook-buttons img', '.tfo-notebook-buttons>:first-child').remove css('hr', '.devsite-nav', '.devsite-content-footer', '.devsite-article-body > br', '.devsite-article-meta', 'devsite-nav-buttons', '.devsite-banner', '.tfo-api img', '.tfo-notebook-buttons img', '.tfo-notebook-buttons>:first-child').remove

@ -15,93 +15,101 @@ module Docs
end end
def get_type def get_type
if slug.start_with?('tf/audio') if slug.start_with?('audio')
'tf.audio' 'tf.audio'
elsif slug.start_with?('tf/autograph') elsif slug.start_with?('autodiff')
'tf.autodiff'
elsif slug.start_with?('autograph')
'tf.autograph' 'tf.autograph'
elsif slug.start_with?('tf/bitwise') elsif slug.start_with?('bitwise')
'tf.bitwise' 'tf.bitwise'
elsif slug.start_with?('tf/compat') elsif slug.start_with?('compat')
'tf.compat' 'tf.compat'
elsif slug.start_with?('tf/config') elsif slug.start_with?('config')
'tf.config' 'tf.config'
elsif slug.start_with?('tf/data') elsif slug.start_with?('data')
'tf.data' 'tf.data'
elsif slug.start_with?('tf/debugging') elsif slug.start_with?('debugging')
'tf.debugging' 'tf.debugging'
elsif slug.start_with?('tf/distribute') elsif slug.start_with?('distribute')
'tf.distribute' 'tf.distribute'
elsif slug.start_with?('tf/dtypes') elsif slug.start_with?('dtypes')
'tf.dtypes' 'tf.dtypes'
elsif slug.start_with?('tf/errors') elsif slug.start_with?('errors')
'tf.errors' 'tf.errors'
elsif slug.start_with?('tf/estimator') elsif slug.start_with?('estimator')
'tf.estimator' 'tf.estimator'
elsif slug.start_with?('tf/experimental') elsif slug.start_with?('experimental')
'tf.experimental' 'tf.experimental'
elsif slug.start_with?('tf/feature_column') elsif slug.start_with?('feature_column')
'tf.feature_column' 'tf.feature_column'
elsif slug.start_with?('tf/graph_util') elsif slug.start_with?('graph_util')
'tf.graph_util' 'tf.graph_util'
elsif slug.start_with?('tf/image') elsif slug.start_with?('image')
'tf.image' 'tf.image'
elsif slug.start_with?('tf/initializers') elsif slug.start_with?('initializers')
'tf.initializers' 'tf.initializers'
elsif slug.start_with?('tf/io') elsif slug.start_with?('io')
'tf.io' 'tf.io'
elsif slug.start_with?('tf/keras') elsif slug.start_with?('keras')
'tf.keras' 'tf.keras'
elsif slug.start_with?('tf/linalg') elsif slug.start_with?('linalg')
'tf.linalg' 'tf.linalg'
elsif slug.start_with?('tf/lite') elsif slug.start_with?('lite')
'tf.lite' 'tf.lite'
elsif slug.start_with?('tf/lookup') elsif slug.start_with?('lookup')
'tf.lookup' 'tf.lookup'
elsif slug.start_with?('tf/losses') elsif slug.start_with?('losses')
'tf.losses' 'tf.losses'
elsif slug.start_with?('tf/math') elsif slug.start_with?('math')
'tf.math' 'tf.math'
elsif slug.start_with?('tf/metrics') elsif slug.start_with?('metrics')
'tf.metrics' 'tf.metrics'
elsif slug.start_with?('tf/nest') elsif slug.start_with?('mixed_precision')
'tf.mixed_precision'
elsif slug.start_with?('mlir')
'tf.mlir'
elsif slug.start_with?('nest')
'tf.nest' 'tf.nest'
elsif slug.start_with?('tf/nn') elsif slug.start_with?('nn')
'tf.nn' 'tf.nn'
elsif slug.start_with?('tf/optimizers') elsif slug.start_with?('optimizers')
'tf.optimizers' 'tf.optimizers'
elsif slug.start_with?('tf/quantization') elsif slug.start_with?('profiler')
'tf.profiler'
elsif slug.start_with?('quantization')
'tf.quantization' 'tf.quantization'
elsif slug.start_with?('tf/queue') elsif slug.start_with?('queue')
'tf.queue' 'tf.queue'
elsif slug.start_with?('tf/ragged') elsif slug.start_with?('ragged')
'tf.ragged' 'tf.ragged'
elsif slug.start_with?('tf/random') elsif slug.start_with?('random')
'tf.random' 'tf.random'
elsif slug.start_with?('tf/raw_ops') elsif slug.start_with?('raw_ops')
'tf.raw_ops' 'tf.raw_ops'
elsif slug.start_with?('tf/saved_model') elsif slug.start_with?('saved_model')
'tf.saved_model' 'tf.saved_model'
elsif slug.start_with?('tf/sets') elsif slug.start_with?('sets')
'tf.sets' 'tf.sets'
elsif slug.start_with?('tf/signal') elsif slug.start_with?('signal')
'tf.signal' 'tf.signal'
elsif slug.start_with?('tf/sparse') elsif slug.start_with?('sparse')
'tf.sparse' 'tf.sparse'
elsif slug.start_with?('tf/strings') elsif slug.start_with?('strings')
'tf.strings' 'tf.strings'
elsif slug.start_with?('tf/summary') elsif slug.start_with?('summary')
'tf.summary' 'tf.summary'
elsif slug.start_with?('tf/sysconfig') elsif slug.start_with?('sysconfig')
'tf.sysconfig' 'tf.sysconfig'
elsif slug.start_with?('tf/test') elsif slug.start_with?('test')
'tf.test' 'tf.test'
elsif slug.start_with?('tf/tpu') elsif slug.start_with?('tpu')
'tf.tpu' 'tf.tpu'
elsif slug.start_with?('tf/train') elsif slug.start_with?('train')
'tf.train' 'tf.train'
elsif slug.start_with?('tf/version') elsif slug.start_with?('version')
'tf.version' 'tf.version'
elsif slug.start_with?('tf/xla') elsif slug.start_with?('xla')
'tf.xla' 'tf.xla'
else else
'tf' 'tf'

@ -2,7 +2,7 @@ module Docs
class Tensorflow < UrlScraper class Tensorflow < UrlScraper
self.name = 'TensorFlow' self.name = 'TensorFlow'
self.type = 'tensorflow' self.type = 'tensorflow'
self.root_path = 'index.html' self.root_path = 'all_symbols'
self.links = { self.links = {
home: 'https://www.tensorflow.org/', home: 'https://www.tensorflow.org/',
code: 'https://github.com/tensorflow/tensorflow' code: 'https://github.com/tensorflow/tensorflow'
@ -14,24 +14,14 @@ module Docs
options[:container] = '.devsite-main-content' options[:container] = '.devsite-main-content'
options[:attribution] = <<-HTML options[:attribution] = <<-HTML
&copy; 2019 The TensorFlow Authors. All rights reserved.<br> &copy; 2020 The TensorFlow Authors. All rights reserved.<br>
Licensed under the Creative Commons Attribution License 3.0.<br> Licensed under the Creative Commons Attribution License 3.0.<br>
Code samples licensed under the Apache 2.0 License. Code samples licensed under the Apache 2.0 License.
HTML HTML
version '2.1' do for version in ['2.3', '2.2', '2.1', '2.0', '1.15'] do
self.release = '2.1.0' self.release = version + '.0'
self.base_url = "https://www.tensorflow.org/versions/r#{version}/api_docs/python" self.base_url = "https://www.tensorflow.org/versions/r#{version}/api_docs/python/tf"
end
version '2.0' do
self.release = '2.0.0'
self.base_url = "https://www.tensorflow.org/versions/r#{version}/api_docs/python"
end
version '1.15' do
self.release = '1.15.0'
self.base_url = "https://www.tensorflow.org/versions/r#{version}/api_docs/python"
end end
def get_latest_version(opts) def get_latest_version(opts)

@ -3,19 +3,10 @@ module Docs
self.name = 'TensorFlow C++' self.name = 'TensorFlow C++'
self.slug = 'tensorflow_cpp' self.slug = 'tensorflow_cpp'
version '2.1' do for version in ['2.3', '2.2', '2.1', '2.0', '1.15'] do
self.release = '2.1.0' self.release = version + '.0'
self.base_url = "https://www.tensorflow.org/versions/r#{version}/api_docs/cc" self.base_url = "https://www.tensorflow.org/versions/r#{version}/api_docs/cc"
end end
version '2.0' do
self.release = '2.0.0'
self.base_url = "https://www.tensorflow.org/versions/r#{version}/api_docs/cc"
end
version '1.15' do
self.release = '1.15.0'
self.base_url = "https://www.tensorflow.org/versions/r#{version}/api_docs/cc"
end
end end
end end

Loading…
Cancel
Save