declaration['arguments'] = func.get('arguments', arguments)
declaration['type_method_definition_dispatch'] = func.get('dispatch', declaration['name'])
declaration['python_module'] = func.get('python_module', '')
- declaration['aten_sparse'] = has_sparse_dispatches(
- declaration['type_method_definition_dispatch'])
declarations.append(declaration)
except Exception as e:
msg = '''Exception raised in processing function:
all_backends = ['CPU', 'CUDA', 'SparseCPU', 'SparseCUDA']
default_backends = ['CPU', 'CUDA']
-sparse_map = {
- 'CPU': 'SparseCPU',
- 'CUDA': 'SparseCUDA',
-}
-
def process_types_and_backends(option):
# if specific pairs were not listed, then enumerate them
# if backend or type is not defined, it is assumed to be all of them
if 'backend_type_pairs' not in option:
backends = option.get('backends', default_backends)
- if option.get('aten_sparse', False):
- backends.extend([sparse_map[p] for p in backends if p in sparse_map])
+ if isinstance(option.get('type_method_definition_dispatch'), dict):
+ backends = option.get('type_method_definition_dispatch').keys()
backends = set(backends)
types = option.get('types', all_types)