MCPcopy Create free account
hub / github.com/BICLab/SpikingBrain-7B / __init__

Method __init__

W8ASpike/Int2Spike/neuron.py:209–217  ·  view source on GitHub ↗
(self, is_bidirectional: bool = False, is_two_complement: bool = False)

Source from the content-addressed store, hash-verified

207 In this case, the most significant bit (MSB) indicates the sign (0 for positive, 1 for negative), and the value is adjusted to reflect the two's complement format.
208 """
209 def __init__(self, is_bidirectional: bool = False, is_two_complement: bool = False):
210 super().__init__()
211 self.T = None
212 self.x_remain = None
213 self.spike_seq = None
214 self._bit_idx = 0
215 self.is_bidirectional = is_bidirectional
216 self.is_bitwise_coding = True
217 self.is_two_complement = is_two_complement
218
219 def forward(self, x: torch.Tensor, T: int | None = None):
220 if not torch.allclose(x, x.round()):

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected