|
| 1 | +# From https://github.com/pytorch/pytorch/blob/379bbef23c144aba4ae6e01d9e1247c4a44b3e74/.clang-format |
| 2 | +# License: |
| 3 | +# From PyTorch: |
| 4 | +# |
| 5 | +# Copyright (c) 2016- Facebook, Inc (Adam Paszke) |
| 6 | +# Copyright (c) 2014- Facebook, Inc (Soumith Chintala) |
| 7 | +# Copyright (c) 2011-2014 Idiap Research Institute (Ronan Collobert) |
| 8 | +# Copyright (c) 2012-2014 Deepmind Technologies (Koray Kavukcuoglu) |
| 9 | +# Copyright (c) 2011-2012 NEC Laboratories America (Koray Kavukcuoglu) |
| 10 | +# Copyright (c) 2011-2013 NYU (Clement Farabet) |
| 11 | +# Copyright (c) 2006-2010 NEC Laboratories America (Ronan Collobert, Leon Bottou, Iain Melvin, Jason Weston) |
| 12 | +# Copyright (c) 2006 Idiap Research Institute (Samy Bengio) |
| 13 | +# Copyright (c) 2001-2004 Idiap Research Institute (Ronan Collobert, Samy Bengio, Johnny Mariethoz) |
| 14 | +# |
| 15 | +# From Caffe2: |
| 16 | +# |
| 17 | +# Copyright (c) 2016-present, Facebook Inc. All rights reserved. |
| 18 | +# |
| 19 | +# All contributions by Facebook: |
| 20 | +# Copyright (c) 2016 Facebook Inc. |
| 21 | +# |
| 22 | +# All contributions by Google: |
| 23 | +# Copyright (c) 2015 Google Inc. |
| 24 | +# All rights reserved. |
| 25 | +# |
| 26 | +# All contributions by Yangqing Jia: |
| 27 | +# Copyright (c) 2015 Yangqing Jia |
| 28 | +# All rights reserved. |
| 29 | +# |
| 30 | +# All contributions by Kakao Brain: |
| 31 | +# Copyright 2019-2020 Kakao Brain |
| 32 | +# |
| 33 | +# All contributions by Cruise LLC: |
| 34 | +# Copyright (c) 2022 Cruise LLC. |
| 35 | +# All rights reserved. |
| 36 | +# |
| 37 | +# All contributions by Tri Dao: |
| 38 | +# Copyright (c) 2024 Tri Dao. |
| 39 | +# All rights reserved. |
| 40 | +# |
| 41 | +# All contributions by Arm: |
| 42 | +# Copyright (c) 2021, 2023-2024 Arm Limited and/or its affiliates |
| 43 | +# |
| 44 | +# All contributions from Caffe: |
| 45 | +# Copyright(c) 2013, 2014, 2015, the respective contributors |
| 46 | +# All rights reserved. |
| 47 | +# |
| 48 | +# All other contributions: |
| 49 | +# Copyright(c) 2015, 2016 the respective contributors |
| 50 | +# All rights reserved. |
| 51 | +# |
| 52 | +# Caffe2 uses a copyright model similar to Caffe: each contributor holds |
| 53 | +# copyright over their contributions to Caffe2. The project versioning records |
| 54 | +# all such contribution and copyright details. If a contributor wants to further |
| 55 | +# mark their specific copyright on a particular contribution, they should |
| 56 | +# indicate their copyright solely in the commit message of the change when it is |
| 57 | +# committed. |
| 58 | +# |
| 59 | +# All rights reserved. |
| 60 | +# |
| 61 | +# Redistribution and use in source and binary forms, with or without |
| 62 | +# modification, are permitted provided that the following conditions are met: |
| 63 | +# |
| 64 | +# 1. Redistributions of source code must retain the above copyright |
| 65 | +# notice, this list of conditions and the following disclaimer. |
| 66 | +# |
| 67 | +# 2. Redistributions in binary form must reproduce the above copyright |
| 68 | +# notice, this list of conditions and the following disclaimer in the |
| 69 | +# documentation and/or other materials provided with the distribution. |
| 70 | +# |
| 71 | +# 3. Neither the names of Facebook, Deepmind Technologies, NYU, NEC Laboratories America |
| 72 | +# and IDIAP Research Institute nor the names of its contributors may be |
| 73 | +# used to endorse or promote products derived from this software without |
| 74 | +# specific prior written permission. |
| 75 | +# |
| 76 | +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 77 | +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 78 | +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 79 | +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
| 80 | +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 81 | +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 82 | +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 83 | +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 84 | +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 85 | +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 86 | +# POSSIBILITY OF SUCH DAMAGE. |
| 87 | + |
| 88 | +--- |
| 89 | +AccessModifierOffset: -1 |
| 90 | +AlignAfterOpenBracket: AlwaysBreak |
| 91 | +AlignConsecutiveAssignments: false |
| 92 | +AlignConsecutiveDeclarations: false |
| 93 | +AlignEscapedNewlinesLeft: true |
| 94 | +AlignOperands: false |
| 95 | +AlignTrailingComments: false |
| 96 | +AllowAllParametersOfDeclarationOnNextLine: false |
| 97 | +AllowShortBlocksOnASingleLine: false |
| 98 | +AllowShortCaseLabelsOnASingleLine: false |
| 99 | +AllowShortFunctionsOnASingleLine: Empty |
| 100 | +AllowShortIfStatementsOnASingleLine: false |
| 101 | +AllowShortLoopsOnASingleLine: false |
| 102 | +AlwaysBreakAfterReturnType: None |
| 103 | +AlwaysBreakBeforeMultilineStrings: true |
| 104 | +AlwaysBreakTemplateDeclarations: true |
| 105 | +BinPackArguments: false |
| 106 | +BinPackParameters: false |
| 107 | +BraceWrapping: |
| 108 | + AfterClass: false |
| 109 | + AfterControlStatement: false |
| 110 | + AfterEnum: false |
| 111 | + AfterFunction: false |
| 112 | + AfterNamespace: false |
| 113 | + AfterObjCDeclaration: false |
| 114 | + AfterStruct: false |
| 115 | + AfterUnion: false |
| 116 | + BeforeCatch: false |
| 117 | + BeforeElse: false |
| 118 | + IndentBraces: false |
| 119 | +BreakBeforeBinaryOperators: None |
| 120 | +BreakBeforeBraces: Attach |
| 121 | +BreakBeforeTernaryOperators: true |
| 122 | +BreakConstructorInitializersBeforeComma: false |
| 123 | +BreakAfterJavaFieldAnnotations: false |
| 124 | +BreakStringLiterals: false |
| 125 | +ColumnLimit: 80 |
| 126 | +CompactNamespaces: false |
| 127 | +ConstructorInitializerAllOnOneLineOrOnePerLine: true |
| 128 | +ConstructorInitializerIndentWidth: 4 |
| 129 | +ContinuationIndentWidth: 4 |
| 130 | +Cpp11BracedListStyle: true |
| 131 | +DerivePointerAlignment: false |
| 132 | +DisableFormat: false |
| 133 | +IncludeCategories: |
| 134 | + - Regex: '^<.*\.h(pp)?>' |
| 135 | + Priority: 1 |
| 136 | + - Regex: '^<.*' |
| 137 | + Priority: 2 |
| 138 | + - Regex: '.*' |
| 139 | + Priority: 3 |
| 140 | +IndentCaseLabels: true |
| 141 | +IndentWidth: 2 |
| 142 | +IndentWrappedFunctionNames: false |
| 143 | +KeepEmptyLinesAtTheStartOfBlocks: false |
| 144 | +MaxEmptyLinesToKeep: 1 |
| 145 | +NamespaceIndentation: None |
| 146 | +PenaltyBreakBeforeFirstCallParameter: 1 |
| 147 | +PenaltyBreakComment: 300 |
| 148 | +PenaltyBreakFirstLessLess: 120 |
| 149 | +PenaltyBreakString: 1000 |
| 150 | +PenaltyExcessCharacter: 1000000 |
| 151 | +PenaltyReturnTypeOnItsOwnLine: 2000000 |
| 152 | +PointerAlignment: Left |
| 153 | +ReflowComments: true |
| 154 | +SortIncludes: true |
| 155 | +SpaceAfterCStyleCast: false |
| 156 | +SpaceBeforeAssignmentOperators: true |
| 157 | +SpaceBeforeParens: ControlStatements |
| 158 | +SpaceInEmptyParentheses: false |
| 159 | +SpacesBeforeTrailingComments: 1 |
| 160 | +SpacesInAngles: false |
| 161 | +SpacesInContainerLiterals: true |
| 162 | +SpacesInCStyleCastParentheses: false |
| 163 | +SpacesInParentheses: false |
| 164 | +SpacesInSquareBrackets: false |
| 165 | +Standard: c++17 |
| 166 | +TabWidth: 8 |
| 167 | +UseTab: Never |
| 168 | +--- |
0 commit comments