@@ -459,9 +459,7 @@ def __new__(self, *args, **kwargs):
459
459
)
460
460
461
461
@classmethod
462
- def _init (cls , module , code_type , * ,
463
- name : str = "" ,
464
- symbol_mapping : Optional [dict ] = None ):
462
+ def _init (cls , module , code_type , * , name : str = "" , symbol_mapping : Optional [dict ] = None ):
465
463
self = super ().__new__ (cls )
466
464
assert code_type in self ._supported_code_type , f"{ code_type = } is not supported"
467
465
_lazy_init ()
@@ -488,9 +486,7 @@ def __reduce__(self):
488
486
return ObjectCode ._reduce_helper , (self ._module , self ._code_type , self ._name , self ._sym_map )
489
487
490
488
@staticmethod
491
- def from_cubin (module : Union [bytes , str ], * ,
492
- name : str = "" ,
493
- symbol_mapping : Optional [dict ] = None ) -> "ObjectCode" :
489
+ def from_cubin (module : Union [bytes , str ], * , name : str = "" , symbol_mapping : Optional [dict ] = None ) -> "ObjectCode" :
494
490
"""Create an :class:`ObjectCode` instance from an existing cubin.
495
491
496
492
Parameters
@@ -508,9 +504,7 @@ def from_cubin(module: Union[bytes, str], *,
508
504
return ObjectCode ._init (module , "cubin" , name = name , symbol_mapping = symbol_mapping )
509
505
510
506
@staticmethod
511
- def from_ptx (module : Union [bytes , str ], * ,
512
- name : str = "" ,
513
- symbol_mapping : Optional [dict ] = None ) -> "ObjectCode" :
507
+ def from_ptx (module : Union [bytes , str ], * , name : str = "" , symbol_mapping : Optional [dict ] = None ) -> "ObjectCode" :
514
508
"""Create an :class:`ObjectCode` instance from an existing PTX.
515
509
516
510
Parameters
@@ -528,9 +522,7 @@ def from_ptx(module: Union[bytes, str], *,
528
522
return ObjectCode ._init (module , "ptx" , name = name , symbol_mapping = symbol_mapping )
529
523
530
524
@staticmethod
531
- def from_ltoir (module : Union [bytes , str ], * ,
532
- name : str = "" ,
533
- symbol_mapping : Optional [dict ] = None ) -> "ObjectCode" :
525
+ def from_ltoir (module : Union [bytes , str ], * , name : str = "" , symbol_mapping : Optional [dict ] = None ) -> "ObjectCode" :
534
526
"""Create an :class:`ObjectCode` instance from an existing LTOIR.
535
527
536
528
Parameters
@@ -548,9 +540,9 @@ def from_ltoir(module: Union[bytes, str], *,
548
540
return ObjectCode ._init (module , "ltoir" , name = name , symbol_mapping = symbol_mapping )
549
541
550
542
@staticmethod
551
- def from_fatbin (module : Union [ bytes , str ], * ,
552
- name : str = "" ,
553
- symbol_mapping : Optional [ dict ] = None ) -> "ObjectCode" :
543
+ def from_fatbin (
544
+ module : Union [ bytes , str ], * , name : str = "" , symbol_mapping : Optional [ dict ] = None
545
+ ) -> "ObjectCode" :
554
546
"""Create an :class:`ObjectCode` instance from an existing fatbin.
555
547
556
548
Parameters
@@ -568,9 +560,9 @@ def from_fatbin(module: Union[bytes, str], *,
568
560
return ObjectCode ._init (module , "fatbin" , name = name , symbol_mapping = symbol_mapping )
569
561
570
562
@staticmethod
571
- def from_object (module : Union [ bytes , str ], * ,
572
- name : str = "" ,
573
- symbol_mapping : Optional [ dict ] = None ) -> "ObjectCode" :
563
+ def from_object (
564
+ module : Union [ bytes , str ], * , name : str = "" , symbol_mapping : Optional [ dict ] = None
565
+ ) -> "ObjectCode" :
574
566
"""Create an :class:`ObjectCode` instance from an existing object code.
575
567
576
568
Parameters
@@ -588,9 +580,9 @@ def from_object(module: Union[bytes, str], *,
588
580
return ObjectCode ._init (module , "object" , name = name , symbol_mapping = symbol_mapping )
589
581
590
582
@staticmethod
591
- def from_library (module : Union [ bytes , str ], * ,
592
- name : str = "" ,
593
- symbol_mapping : Optional [ dict ] = None ) -> "ObjectCode" :
583
+ def from_library (
584
+ module : Union [ bytes , str ], * , name : str = "" , symbol_mapping : Optional [ dict ] = None
585
+ ) -> "ObjectCode" :
594
586
"""Create an :class:`ObjectCode` instance from an existing library.
595
587
596
588
Parameters
0 commit comments