MCPcopy Create free account
hub / github.com/pytorch/pytorch / test_basic

Method test_basic

test/test_dispatch.py:799–818  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

797
798class TestPythonDispatcher(TestCase):
799 def test_basic(self):
800 dispatcher = PythonDispatcher()
801 dispatcher.register(["CPU", "XLA", "Lazy", "CompositeImplicitAutograd"])
802 self.assertExpectedInline(
803 dispatcher.dispatchTable(),
804 '''\
805
806Computed Dispatch Table
807key kernel
808---------------------------
809CPU fn_CPU [kernel]
810XLA fn_XLA [kernel]
811Lazy fn_Lazy [kernel]
812FPGA fn_CompositeImplicitAutograd [math kernel]
813AutogradOther fn_CompositeImplicitAutograd [math kernel]
814AutogradCPU [backend fallback]
815AutogradXLA [backend fallback]
816AutogradLazy [backend fallback]
817'''
818 )
819
820 def test_math_autogradcpu(self):
821 dispatcher = PythonDispatcher()

Callers

nothing calls this directly

Calls 4

registerMethod · 0.95
dispatchTableMethod · 0.95
PythonDispatcherClass · 0.90
assertExpectedInlineMethod · 0.80

Tested by

no test coverage detected