资源简介

github.com上tensorflow-master 源码, 2018.11.11日版本 供学习使用

资源截图

代码片段和文件信息

# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License Version 2.0 (the “License“);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing software
# distributed under the License is distributed on an “AS IS“ BASIS
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
“““configure script to get build parameters from user.“““

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import argparse
import errno
import os
import platform
import re
import subprocess
import sys

# pylint: disable=g-import-not-at-top
try:
  from shutil import which
except ImportError:
  from distutils.spawn import find_executable as which
# pylint: enable=g-import-not-at-top

_DEFAULT_CUDA_VERSION = ‘9.0‘
_DEFAULT_CUDNN_VERSION = ‘7‘
_DEFAULT_CUDA_COMPUTE_CAPABILITIES = ‘3.57.0‘
_DEFAULT_CUDA_PATH = ‘/usr/local/cuda‘
_DEFAULT_CUDA_PATH_LINUX = ‘/opt/cuda‘
_DEFAULT_CUDA_PATH_WIN = (‘C:/Program Files/NVIDIA GPU Computing ‘
                          ‘Toolkit/CUDA/v%s‘ % _DEFAULT_CUDA_VERSION)
_TF_OPENCL_VERSION = ‘1.2‘
_DEFAULT_COMPUTECPP_TOOLKIT_PATH = ‘/usr/local/computecpp‘
_DEFAULT_TRISYCL_INCLUDE_DIR = ‘/usr/local/triSYCL/include‘
_SUPPORTED_ANDROID_NDK_VERSIONS = [10 11 12 13 14 15 16]

_DEFAULT_PROMPT_ASK_ATTEMPTS = 10

_TF_BAZELRC_FILENAME = ‘.tf_configure.bazelrc‘
_TF_WORKSPACE_ROOT = ‘‘
_TF_BAZELRC = ‘‘

NCCL_LIB_PATHS = [
    ‘lib64/‘ ‘lib/powerpc64le-linux-gnu/‘ ‘lib/x86_64-linux-gnu/‘ ‘‘
]

if platform.machine() == ‘ppc64le‘:
  _DEFAULT_TENSORRT_PATH_LINUX = ‘/usr/lib/powerpc64le-linux-gnu/‘
else:
  _DEFAULT_TENSORRT_PATH_LINUX = ‘/usr/lib/%s-linux-gnu‘ % platform.machine()


class UserInputError(Exception):
  pass


def is_windows():
  return platform.system() == ‘Windows‘


def is_linux():
  return platform.system() == ‘Linux‘


def is_macos():
  return platform.system() == ‘Darwin‘


def is_ppc64le():
  return platform.machine() == ‘ppc64le‘


def is_cygwin():
  return platform.system().startswith(‘CYGWIN_NT‘)


def get_input(question):
  try:
    try:
      answer = raw_input(question)
    except NameError:
      answer = input(question)  # pylint: disable=bad-builtin
  except EOFError:
    answer = ‘‘
  return answer


def symlink_force(target link_name):
  “““Force symlink equivalent of ‘ln -sf‘.

  Args:
    target: items to link to.
    link_name: name of the link.
  “““
  try:
    os.symlink(target link_name)
  except OSError as e:
    if e.errno == errno.EEXIST:
      os.remove(link_name)
      os.symlink(target link_name)
    else:
      raise e


def sed_in_place(filen

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-11-11 05:46  tensorflow-master\
     目录           0  2018-11-11 05:46  tensorflow-master\.github\
     目录           0  2018-11-11 05:46  tensorflow-master\.github\ISSUE_TEMPLATE\
     文件        1576  2018-11-11 05:46  tensorflow-master\.github\ISSUE_TEMPLATE\00-bug-performance-issue.md
     文件        1172  2018-11-11 05:46  tensorflow-master\.github\ISSUE_TEMPLATE\10-build-installation-issue.md
     文件         653  2018-11-11 05:46  tensorflow-master\.github\ISSUE_TEMPLATE\20-documentation-issue.md
     文件         641  2018-11-11 05:46  tensorflow-master\.github\ISSUE_TEMPLATE\30-feature-request.md
     文件         790  2018-11-11 05:46  tensorflow-master\.github\ISSUE_TEMPLATE\50-other-issues.md
     文件         705  2018-11-11 05:46  tensorflow-master\.gitignore
     文件        2219  2018-11-11 05:46  tensorflow-master\ACKNOWLEDGMENTS
     文件         542  2018-11-11 05:46  tensorflow-master\ADOPTERS.md
     文件         349  2018-11-11 05:46  tensorflow-master\AUTHORS
     文件         122  2018-11-11 05:46  tensorflow-master\BUILD
     文件        2923  2018-11-11 05:46  tensorflow-master\CODEOWNERS
     文件        5367  2018-11-11 05:46  tensorflow-master\CODE_OF_CONDUCT.md
     文件        8894  2018-11-11 05:46  tensorflow-master\CONTRIBUTING.md
     文件         597  2018-11-11 05:46  tensorflow-master\ISSUES.md
     文件        2168  2018-11-11 05:46  tensorflow-master\ISSUE_TEMPLATE.md
     文件       11416  2018-11-11 05:46  tensorflow-master\LICENSE
     文件       11274  2018-11-11 05:46  tensorflow-master\README.md
     文件      129808  2018-11-11 05:46  tensorflow-master\RELEASE.md
     文件       13161  2018-11-11 05:46  tensorflow-master\SECURITY.md
     文件        3024  2018-11-11 05:46  tensorflow-master\WORKSPACE
     文件        1186  2018-11-11 05:46  tensorflow-master\arm_compiler.BUILD
     文件         285  2018-11-11 05:46  tensorflow-master\configure
     文件       63546  2018-11-11 05:46  tensorflow-master\configure.py
     文件         328  2018-11-11 05:46  tensorflow-master\models.BUILD
     目录           0  2018-11-11 05:46  tensorflow-master\tensorflow\
     文件         124  2018-11-11 05:46  tensorflow-master\tensorflow\.clang-format
     文件       16939  2018-11-11 05:46  tensorflow-master\tensorflow\BUILD
     文件        1685  2018-11-11 05:46  tensorflow-master\tensorflow\__init__.py
............此处省略14707个文件信息

评论

共有 条评论