Showing 52 of 52 total issues
Avoid too many return
statements within this function. Open
return lam * min_values + (1.0 - lam) * max_values
Avoid too many return
statements within this function. Open
return GEGLU()
Avoid too many return
statements within this function. Open
return nn.Identity()
Avoid too many return
statements within this function. Open
return get_d4rl(
Function unfreeze
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def unfreeze(self) -> None:
for v in asdict_without_copy(self).values():
if isinstance(v, nn.Module):
for p in v.parameters():
p.requires_grad = True
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function create_activation
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create_activation(activation_type: str) -> nn.Module:
if activation_type == "relu":
return nn.ReLU()
elif activation_type == "gelu":
return nn.GELU()
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function fit_with_transition_picker
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def fit_with_transition_picker(
self,
episodes: Sequence[EpisodeBase],
transition_picker: TransitionPickerProtocol,
) -> None:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function evaluate_transformer_with_environment
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def evaluate_transformer_with_environment(
algo: StatefulTransformerAlgoProtocol,
env: GymEnv,
n_trials: int = 10,
) -> float:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function get_dataset
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_dataset(
env_name: str,
transition_picker: Optional[TransitionPickerProtocol] = None,
trajectory_slicer: Optional[TrajectorySlicerProtocol] = None,
render_mode: Optional[str] = None,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _get_parameters_from_named_modules
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _get_parameters_from_named_modules(
named_modules: Iterable[Tuple[str, nn.Module]]
) -> Sequence[nn.Parameter]:
# retrieve unique set of parameters
params_dict = {}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function freeze
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def freeze(self) -> None:
for v in asdict_without_copy(self).values():
if isinstance(v, nn.Module):
for p in v.parameters():
p.requires_grad = False
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _process_device
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _process_device(value: DeviceArg) -> str:
"""Checks value and returns PyTorch target device.
Returns:
str: target device.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"