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

Method __mul__

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

Source from the content-addressed store, hash-verified

81 return result
82
83 def __mul__(self, other: Variable) -> Variable:
84 result = Variable(self.value * other.value)
85
86 with GradientTracker() as tracker:
87 # if tracker is enabled, computation graph will be updated
88 if tracker.enabled:
89 tracker.append(OpType.MUL, params=[self, other], output=result)
90 return result
91
92 def __truediv__(self, other: Variable) -> Variable:
93 result = Variable(self.value / other.value)

Callers

nothing calls this directly

Calls 3

VariableClass · 0.85
GradientTrackerClass · 0.85
appendMethod · 0.45

Tested by

no test coverage detected