升级pytorch v1.11.0
This commit is contained in:
@@ -981,16 +981,16 @@ def dispatch_lambda_return_str(f: NativeFunction) -> str:
|
||||
raise RuntimeError(f'{f.func.name} returns unsupported type {return_str}')
|
||||
return return_str
|
||||
|
||||
def cpp_record_func(f: NativeFunction, custom=False) -> str:
|
||||
name = cpp.name(f.func)
|
||||
# def cpp_record_func(f: NativeFunction, custom=False) -> str:
|
||||
# name = cpp.name(f.func)
|
||||
|
||||
if Variant.function in f.variants:
|
||||
if custom:
|
||||
record_func = f'RECORD_FUNCTION("{name}", std::vector<c10::IValue>({{}}));'
|
||||
else:
|
||||
record_func = f'// RECORD_FUNCTION("{name}")'
|
||||
return record_func
|
||||
raise RuntimeError(f'could not dispatch, neither function nor method: {f.func}')
|
||||
# if Variant.function in f.variants:
|
||||
# if custom:
|
||||
# record_func = f'RECORD_FUNCTION("{name}", std::vector<c10::IValue>({{}}));'
|
||||
# else:
|
||||
# record_func = f'// RECORD_FUNCTION("{name}")'
|
||||
# return record_func
|
||||
# raise RuntimeError(f'could not dispatch, neither function nor method: {f.func}')
|
||||
|
||||
def cpp_dispatch_target(f: NativeFunction, custom=False) -> str:
|
||||
name = cpp.name(f.func)
|
||||
@@ -998,7 +998,7 @@ def cpp_dispatch_target(f: NativeFunction, custom=False) -> str:
|
||||
return f'self.{name}'
|
||||
if Variant.function in f.variants:
|
||||
if custom:
|
||||
namespace = 'at_npu::native::NPUNativeFunctions'
|
||||
namespace = 'at_npu::native::XLANativeFunctions'
|
||||
elif has_tensor_options(f) or f.func.name.name.base.endswith('_like'):
|
||||
namespace = 'torch'
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user