mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[PyTorch][codemod] Replace immediately-dereferenced cast calls w/castRaw (#50229)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/50229 `fastmod -m 'cast(<((at|c10)::)?\w+Type>\(\)\s*)->' 'castRaw${1}->'` Presuming it builds, this is a safe change: the result of `cast()` wasn't being saved anywhere, so we didn't need it, so we can use a raw pointer instead of a new `shared_ptr`. ghstack-source-id: 120769170 Test Plan: CI Reviewed By: SplitInfinity Differential Revision: D25837494 fbshipit-source-id: 46319100dc0dfc78f6d2b45148207f83481f2ada
This commit is contained in:
committed by
Facebook GitHub Bot
parent
f0006315a9
commit
7328710cbc
@ -257,7 +257,7 @@ struct SchemaParser {
|
||||
break;
|
||||
}
|
||||
case TypeKind::ListType: {
|
||||
auto elem_kind = arg_type->cast<ListType>()->getElementType();
|
||||
auto elem_kind = arg_type->castRaw<ListType>()->getElementType();
|
||||
if (L.cur().kind == TK_IDENT) {
|
||||
return parseTensorDefault(range);
|
||||
} else if (arg_N && L.cur().kind != '[') {
|
||||
|
Reference in New Issue
Block a user