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

Method __truediv__

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

Source from the content-addressed store, hash-verified

90 return result
91
92 def __truediv__(self, other: Variable) -> Variable:
93 result = Variable(self.value / other.value)
94
95 with GradientTracker() as tracker:
96 # if tracker is enabled, computation graph will be updated
97 if tracker.enabled:
98 tracker.append(OpType.DIV, params=[self, other], output=result)
99 return result
100
101 def __matmul__(self, other: Variable) -> Variable:
102 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