MCPcopy Create free account
hub / github.com/AIS-SNU/Smart-Infinity / switch

Function switch

DeepSpeedExample/megatron/text_generation_utils.py:319–322  ·  view source on GitHub ↗
(val1, val2, boolean)

Source from the content-addressed store, hash-verified

317
318
319def switch(val1, val2, boolean):
320
321 boolean = boolean.type_as(val1)
322 return (1 - boolean) * val1 + boolean * val2
323
324
325def sample_sequence_batch(model, context_tokens, context_lengths,

Callers 1

sample_sequence_batchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected