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

Method test_math_autogradcpu

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

Source from the content-addressed store, hash-verified

818 )
819
820 def test_math_autogradcpu(self):
821 dispatcher = PythonDispatcher()
822 dispatcher.register(["CPU", "XLA", "Lazy", "CompositeImplicitAutograd", "AutogradCPU"])
823 self.assertExpectedInline(
824 dispatcher.dispatchTable(),
825 '''\
826
827Computed Dispatch Table
828key kernel
829---------------------------
830CPU fn_CPU [kernel]
831XLA fn_XLA [kernel]
832Lazy fn_Lazy [kernel]
833FPGA fn_CompositeImplicitAutograd [math kernel]
834AutogradOther fn_CompositeImplicitAutograd [math kernel]
835AutogradCPU fn_AutogradCPU [kernel]
836AutogradXLA [backend fallback]
837AutogradLazy [backend fallback]
838'''
839 )
840 self.assertExpectedInline(
841 dispatcher.registrations(),
842 '''\
843
844Registered Kernels
845key kernel
846---------------------------
847CPU fn_CPU
848XLA fn_XLA
849Lazy fn_Lazy
850AutogradCPU fn_AutogradCPU
851CompositeImplicitAutograd[alias] fn_CompositeImplicitAutograd
852'''
853 )
854
855 def test_defaultbackend_autogradcpu(self):
856 dispatcher = PythonDispatcher()

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected