



'''simple docstring'''
def A__   (					UpperCAmelCase_  ,  UpperCAmelCase_							):

						# Check if the input is valid
						if not len(UpperCAmelCase_							) == len(UpperCAmelCase_							) == 3:
												raise ValueError('Please enter a valid equation.'							)
						if equationa[0] == equationa[1] == equationa[0] == equationa[1] == 0:
												raise ValueError('Both a & b of two equations can\'t be zero.'							)

						# Extract the coefficients
						_UpperCamelCase :		int			    =       equationa
						_UpperCamelCase :		int			    =       equationa

						# Calculate the determinants of the matrices
						_UpperCamelCase :		Union[str, Any]			    =       aa * ba - aa * ba
						_UpperCamelCase :		Optional[int]			    =       ca * ba - ca * ba
						_UpperCamelCase :		Union[str, Any]			    =       aa * ca - aa * ca

						# Check if the system of linear equations has a solution (using Cramer's rule)
						if determinant == 0:
												if determinant_x == determinant_y == 0:
																		raise ValueError('Infinite solutions. (Consistent system)'							)
												else:
																		raise ValueError('No solution. (Inconsistent system)'							)
						else:
												if determinant_x == determinant_y == 0:
																		# Trivial solution (Inconsistent system)
																		return (0.0, 0.0)
												else:
																		_UpperCamelCase :		List[Any]			    =       determinant_x / determinant
																		_UpperCamelCase :		List[str]			    =       determinant_y / determinant
																		# Non-Trivial Solution (Consistent system)
																		return (x, y)







'''simple docstring'''
from torch import nn






def A__   (					UpperCAmelCase_							):
						if act_fn in ["swish", "silu"]:
												return nn.SiLU()
						elif act_fn == "mish":
												return nn.Mish()
						elif act_fn == "gelu":
												return nn.GELU()
						else:
												raise ValueError(f'Unsupported activation function: {act_fn}'							)


