MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / _create_penalty_tensor

Function _create_penalty_tensor

tests/layers/test_sampler.py:42–43  ·  view source on GitHub ↗
(batch_size: int, penalty_value: float)

Source from the content-addressed store, hash-verified

40
41
42def _create_penalty_tensor(batch_size: int, penalty_value: float) -> paddle.Tensor:
43 return paddle.full(shape=[batch_size, 1], fill_value=penalty_value, dtype="float32")
44
45
46def _create_tokens_tensor(

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected