/
usr
/
local
/
lib64
/
python3.6
/
site-packages
/
torch
/
include
/
ATen
/
core
/
/usr/local/lib64/python3.6/site-packages/torch/include/ATen/core
mkdir
upload
Name
Size
Mode
Actions
boxing/
-
0755
rm
dispatch/
-
0755
rm
op_registration/
-
0755
rm
alias_info.h
2986
0644
edit
dl
rm
Array.h
768
0644
edit
dl
rm
ATenGeneral.h
45
0644
edit
dl
rm
ATenOpList.h
246
0644
edit
dl
rm
aten_interned_strings.h
25389
0644
edit
dl
rm
Backtrace.h
59
0644
edit
dl
rm
blob.h
5422
0644
edit
dl
rm
builtin_function.h
3649
0644
edit
dl
rm
DeprecatedTypeProperties.h
3773
0644
edit
dl
rm
DeprecatedTypePropertiesRegistry.h
795
0644
edit
dl
rm
Dict.h
13195
0644
edit
dl
rm
Dict_inl.h
7996
0644
edit
dl
rm
Dimname.h
1188
0644
edit
dl
rm
DimVector.h
247
0644
edit
dl
rm
DistributionsHelper.h
12594
0644
edit
dl
rm
Formatting.h
959
0644
edit
dl
rm
function.h
2145
0644
edit
dl
rm
functional.h
1460
0644
edit
dl
rm
function_schema.h
13577
0644
edit
dl
rm
function_schema_inl.h
9319
0644
edit
dl
rm
Generator.h
4935
0644
edit
dl
rm
grad_mode.h
210
0644
edit
dl
rm
interned_strings.h
25332
0644
edit
dl
rm
interned_strings_class.h
770
0644
edit
dl
rm
ivalue.h
38823
0644
edit
dl
rm
ivalue_inl.h
59963
0644
edit
dl
rm
ivalue_to.h
756
0644
edit
dl
rm
jit_type.h
75971
0644
edit
dl
rm
jit_type_base.h
6508
0644
edit
dl
rm
LegacyTypeDispatch.h
4626
0644
edit
dl
rm
List.h
15667
0644
edit
dl
rm
List_inl.h
11012
0644
edit
dl
rm
Macros.h
44
0644
edit
dl
rm
MT19937RNGEngine.h
6410
0644
edit
dl
rm
NamedTensor.h
5050
0644
edit
dl
rm
operator_name.h
3018
0644
edit
dl
rm
PhiloxRNGEngine.h
6496
0644
edit
dl
rm
PythonModeTLS.h
403
0644
edit
dl
rm
qualified_name.h
4358
0644
edit
dl
rm
QuantizerBase.h
2443
0644
edit
dl
rm
Range.h
418
0644
edit
dl
rm
Reduction.h
461
0644
edit
dl
rm
rref_interface.h
1144
0644
edit
dl
rm
Scalar.h
29
0644
edit
dl
rm
ScalarType.h
33
0644
edit
dl
rm
stack.h
6034
0644
edit
dl
rm
Tensor.h
1756
0644
edit
dl
rm
TensorAccessor.h
10296
0644
edit
dl
rm
TensorBase.h
32767
0644
edit
dl
rm
TensorBody.h
247555
0644
edit
dl
rm
TransformationHelper.h
6911
0644
edit
dl
rm
typeid.h
29
0644
edit
dl
rm
UndefinedTensorImpl.h
42
0644
edit
dl
rm
UnsafeFromTH.h
708
0644
edit
dl
rm
VariableHooksInterface.h
3312
0644
edit
dl
rm
Variadic.h
2257
0644
edit
dl
rm
Vitals.h
2305
0644
edit
dl
rm
Edit:
/usr/local/lib64/python3.6/site-packages/torch/include/ATen/core/qualified_name.h
(4358B)
#pragma once #include <c10/util/ArrayRef.h> #include <c10/util/Exception.h> #include <c10/util/StringUtil.h> #include <string> namespace c10 { // Represents a name of the form "foo.bar.baz" struct QualifiedName { QualifiedName() {} // `name` can be a dotted string, like "foo.bar.baz", or just a bare name. /* implicit */ QualifiedName(const std::string& name) { TORCH_CHECK(!name.empty()); // split the string into its atoms. size_t startSearchFrom = 0; size_t pos = name.find(delimiter_, startSearchFrom); while (pos != std::string::npos) { auto atom = name.substr(startSearchFrom, pos - startSearchFrom); TORCH_INTERNAL_ASSERT( atom.size() > 0, "Invalid name for qualified name: '", name, "'"); atoms_.push_back(std::move(atom)); startSearchFrom = pos + 1; pos = name.find(delimiter_, startSearchFrom); } auto finalAtom = name.substr(startSearchFrom, pos - startSearchFrom); TORCH_INTERNAL_ASSERT( finalAtom.size() > 0, "Invalid name for qualified name: '", name, "'"); atoms_.emplace_back(std::move(finalAtom)); cacheAccessors(); } explicit QualifiedName(std::vector<std::string> atoms) { for (const auto& atom : atoms) { TORCH_CHECK(!atom.empty(), "Atom cannot be empty"); TORCH_CHECK( atom.find(delimiter_) == std::string::npos, "Delimiter not allowed in atom"); } atoms_ = std::move(atoms); cacheAccessors(); } // Unnecessary copy. Ideally we'd use something like std::string_view. /* implicit */ QualifiedName(const char* name) : QualifiedName(std::string(name)) {} // `name` must be a bare name (no dots!) explicit QualifiedName(const QualifiedName& prefix, std::string name) { TORCH_INTERNAL_ASSERT(!name.empty()); TORCH_INTERNAL_ASSERT(name.find(delimiter_) == std::string::npos); atoms_.insert(atoms_.begin(), prefix.atoms_.begin(), prefix.atoms_.end()); atoms_.push_back(std::move(name)); cacheAccessors(); } // Is `this` a prefix of `other`? // For example, "foo.bar" is a prefix of "foo.bar.baz" bool isPrefixOf(const QualifiedName& other) const { const auto& thisAtoms = atoms_; const auto& otherAtoms = other.atoms_; if (thisAtoms.size() > otherAtoms.size()) { // Can't be a prefix if it's bigger return false; } for (size_t i = 0; i < thisAtoms.size(); i++) { if (thisAtoms[i] != otherAtoms[i]) { return false; } } return true; } // The fully qualified name, like "foo.bar.baz" const std::string& qualifiedName() const { return qualifiedName_; } // The leading qualifier, like "foo.bar" const std::string& prefix() const { return prefix_; } // The base name, like "baz" const std::string& name() const { return name_; } const std::vector<std::string>& atoms() const { return atoms_; } bool operator==(const QualifiedName& other) const { return this->qualifiedName_ == other.qualifiedName_; } bool operator!=(const QualifiedName& other) const { return !(*this == other); } private: static constexpr char delimiter_ = '.'; // Helper for cacheAccessors() below. template<typename T> std::string join(char delimiter, const T& v) { std::string out; size_t reserve = 0; for (const auto& e : v) { reserve += e.size() + 1; } out.reserve(reserve); for (size_t i = 0; i < v.size(); ++i) { if (i != 0) { out.push_back(delimiter); } out.append(v[i]); } return out; } void cacheAccessors() { qualifiedName_ = join(delimiter_, atoms_); if (atoms_.size() > 1) { ArrayRef<std::string> view(atoms_); const auto prefixView = view.slice(0, view.size() - 1); prefix_ = join(delimiter_, prefixView); } if (atoms_.size() >= 1) { name_ = atoms_.back(); } } // The actual list of names, like "{foo, bar, baz}" std::vector<std::string> atoms_; /* * Cached accessors, derived from `atoms_`. */ std::string qualifiedName_; std::string prefix_; std::string name_; }; } // namespace c10 namespace std { template <> struct hash<c10::QualifiedName> { size_t operator()(const c10::QualifiedName& n) const noexcept { return std::hash<std::string>()(n.qualifiedName()); } }; } // namespace std
Save
cmd:
run