mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Trivial fixes, so let's do this instead of reverting the change. Pull Request resolved: https://github.com/pytorch/pytorch/pull/122253 Approved by: https://github.com/clee2000
This commit is contained in:
parent
de950039fc
commit
dc89d8b74a
|
|
@ -16,7 +16,7 @@ inline void* CPUCachingAllocator::allocate_and_cache(const size_t bytes) {
|
|||
void* ptr;
|
||||
try {
|
||||
ptr = c10::alloc_cpu(bytes);
|
||||
} catch (c10::Error& ) {
|
||||
} catch (c10::Error&) {
|
||||
// If allocation fails, try freeing cached available blocks.
|
||||
// For now free all available cached blocks.
|
||||
free_cached();
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ C10_EXPORT int stringToKind(const std::string& str) {
|
|||
}();
|
||||
try {
|
||||
return str_to_kind.at(str);
|
||||
} catch (std::out_of_range& ) {
|
||||
} catch (std::out_of_range&) {
|
||||
throw std::out_of_range("unknown token in stringToKind");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user