mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Apply ufmt linter to all py files under torchgen (#81570)
Previous batches: * https://github.com/pytorch/pytorch/pull/81285 * https://github.com/pytorch/pytorch/pull/81335 We have multiple batches here to minimize merge conflicts and reviewing process. Once everything has been formatted by ufmt (black+usort), the current black linter will be removed. Pull Request resolved: https://github.com/pytorch/pytorch/pull/81570 Approved by: https://github.com/ezyang
This commit is contained in:
@ -1,14 +1,18 @@
|
||||
import pathlib
|
||||
import argparse
|
||||
import os
|
||||
import yaml
|
||||
import pathlib
|
||||
import re
|
||||
from collections import namedtuple, Counter, defaultdict
|
||||
from typing import List, Dict, Union, Sequence, Optional
|
||||
from torchgen.gen import (
|
||||
get_grouped_native_functions,
|
||||
parse_native_yaml,
|
||||
)
|
||||
from collections import Counter, defaultdict, namedtuple
|
||||
from typing import Dict, List, Optional, Sequence, Union
|
||||
|
||||
import yaml
|
||||
|
||||
import torchgen.api.dispatcher as dispatcher
|
||||
import torchgen.dest as dest
|
||||
from torchgen.api.types import DispatcherSignature
|
||||
from torchgen.code_template import CodeTemplate
|
||||
from torchgen.context import native_function_manager
|
||||
from torchgen.gen import get_grouped_native_functions, parse_native_yaml
|
||||
from torchgen.model import (
|
||||
BackendIndex,
|
||||
BackendMetadata,
|
||||
@ -19,18 +23,13 @@ from torchgen.model import (
|
||||
)
|
||||
from torchgen.selective_build.selector import SelectiveBuilder
|
||||
from torchgen.utils import (
|
||||
Target,
|
||||
concatMap,
|
||||
context,
|
||||
YamlLoader,
|
||||
FileManager,
|
||||
NamespaceHelper,
|
||||
Target,
|
||||
YamlLoader,
|
||||
)
|
||||
from torchgen.context import native_function_manager
|
||||
from torchgen.code_template import CodeTemplate
|
||||
import torchgen.dest as dest
|
||||
import torchgen.api.dispatcher as dispatcher
|
||||
from torchgen.api.types import DispatcherSignature
|
||||
|
||||
|
||||
# Parses the external backend's yaml, and adds a new BackendIndex for the backend's dispatch key.
|
||||
|
Reference in New Issue
Block a user