MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / __matmul__

Method __matmul__

machine_learning/automatic_differentiation.py:101–108  ·  view source on GitHub ↗
(self, other: Variable)

Source from the content-addressed store, hash-verified

99 return result
100
101 def __matmul__(self, other: Variable) -> Variable:
102 result = Variable(self.value @ other.value)
103
104 with GradientTracker() as tracker:
105 # if tracker is enabled, computation graph will be updated
106 if tracker.enabled:
107 tracker.append(OpType.MATMUL, params=[self, other], output=result)
108 return result
109
110 def __pow__(self, power: int) -> Variable:
111 result = Variable(self.value**power)

Callers

nothing calls this directly

Calls 3

VariableClass · 0.85
GradientTrackerClass · 0.85
appendMethod · 0.45

Tested by

no test coverage detected