Skip to content

Commit

Permalink
Black to Block for various files (#42913)
Browse files Browse the repository at this point in the history
Summary:
Fixes  #41735 #41736 #41737 #41738 all areas where black is mentioned is replaced to block

Pull Request resolved: #42913

Reviewed By: houseroad

Differential Revision: D23112873

Pulled By: malfet

fbshipit-source-id: a515b56dc2ed20aa75741c577988d95f750b364c
  • Loading branch information
DeepakVelmurugan authored and facebook-github-bot committed Aug 26, 2020
1 parent 348e78b commit c9f125b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion torch/onnx/symbolic_helper.py
Expand Up @@ -190,7 +190,7 @@ def _onnx_opset_unsupported_detailed(op_name, current_opset, supported_opset, re
'opset {}. {}. Please try opset version {}.'.format(op_name, current_opset, reason, supported_opset))


def _black_list_in_opset(name):
def _block_list_in_opset(name):
def symbolic_fn(*args, **kwargs):
raise RuntimeError("ONNX export failed on {}, which is not implemented for opset {}. "
"Try exporting with other opset versions."
Expand Down
8 changes: 4 additions & 4 deletions torch/onnx/symbolic_opset7.py
@@ -1,4 +1,4 @@
from torch.onnx.symbolic_helper import _black_list_in_opset
from torch.onnx.symbolic_helper import _block_list_in_opset

import torch.onnx.symbolic_opset9 as sym_opset9

Expand All @@ -15,7 +15,7 @@
# MaxPool: added optional indices output.
# Scan

black_listed_operators = [
block_listed_operators = [
"scan", "expand", "expand_as", "meshgrid",
"adaptive_max_pool1d", "adaptive_max_pool2d", "adaptive_max_pool3d",
"max_pool1d_with_indices", "max_pool2d_with_indices", "max_pool3d_with_indices"
Expand Down Expand Up @@ -43,5 +43,5 @@ def min(g, self, dim_or_y=None, keepdim=None):
return sym_opset9.min(g, self, dim_or_y, keepdim)


for black_listed_op in black_listed_operators:
vars()[black_listed_op] = _black_list_in_opset(black_listed_op)
for block_listed_op in block_listed_operators:
vars()[block_listed_op] = _block_list_in_opset(block_listed_op)
8 changes: 4 additions & 4 deletions torch/onnx/symbolic_opset8.py
Expand Up @@ -4,7 +4,7 @@
import torch.onnx.symbolic_helper as sym_help
import torch.onnx.symbolic_opset9 as sym_opset9

from torch.onnx.symbolic_helper import parse_args, _unimplemented, _black_list_in_opset, _try_get_scalar_type
from torch.onnx.symbolic_helper import parse_args, _unimplemented, _block_list_in_opset, _try_get_scalar_type
from torch.onnx.symbolic_opset9 import _cast_Float

import warnings
Expand Down Expand Up @@ -39,14 +39,14 @@
# Upsample: moved scales from attribute to input.
# Scan

black_listed_operators = [
block_listed_operators = [
"nonzero", "where", "scatter", "scatter_add", "erf", "sign", "isnan", "gather",
"arange", "masked_fill",
"index_fill", "index_copy"
]

for black_listed_op in black_listed_operators:
vars()[black_listed_op] = _black_list_in_opset(black_listed_op)
for block_listed_op in block_listed_operators:
vars()[block_listed_op] = _block_list_in_opset(block_listed_op)


def _interpolate(name, dim, interpolate_mode):
Expand Down

0 comments on commit c9f125b

Please sign in to comment.