MCPcopy Create free account
hub / github.com/HazyResearch/spacetime / TriangularToeplitzMultPadded

Class TriangularToeplitzMultPadded

model/functional/toeplitz.py:100–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98 return d_u, d_v
99
100class TriangularToeplitzMultPadded(torch.autograd.Function):
101 @staticmethod
102 def forward(ctx, u, v):
103 ctx.save_for_backward(u, v)
104 output = triangular_toeplitz_multiply_(u, v)
105 return output
106
107 @staticmethod
108 def backward(ctx, grad):
109 u, v = ctx.saved_tensors
110 d_u = triangular_toeplitz_multiply_padded_(grad.flip(-1), v).flip(-1)
111 d_v = triangular_toeplitz_multiply_padded_(grad.flip(-1), u).flip(-1)
112 return d_u, d_v
113
114class TriangularToeplitzMultPaddedFast(torch.autograd.Function):
115 """ Trade off speed (20-25% faster) for more memory (20-25%) """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected