mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Fix return type of TypeFactoryBase<c10::DynamicType>::get (#151803)
getBaseType() actually returns a reference. This was causing shared_ptr copies. Differential Revision: [D73376717](https://our.internmc.facebook.com/intern/diff/D73376717/) Pull Request resolved: https://github.com/pytorch/pytorch/pull/151803 Approved by: https://github.com/malfet, https://github.com/Skylion007 ghstack dependencies: #151801, #151802
This commit is contained in:
parent
fabbcddab1
commit
0559741d7f
|
|
@ -44,7 +44,7 @@ struct TORCH_API TypeFactoryBase<c10::DynamicType> {
|
|||
c10::DynamicType::Arguments{});
|
||||
}
|
||||
template <typename T>
|
||||
C10_ERASE static c10::DynamicTypePtr get() {
|
||||
C10_ERASE static decltype(auto) get() {
|
||||
return DynamicTypeTrait<T>::getBaseType();
|
||||
}
|
||||
static const std::unordered_map<std::string, c10::TypePtr>& basePythonTypes();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user