Configuration
Sionna PHY’s configuration API. It can be used to set global variables which can be usedby all of its modules and functions.
- classsionna.phy.config.Config[source]
Sionna PHY Configuration Class
This singleton class is used to define global configuration variablesand random number generators that can be accessed from all modulesand functions. It is instantiated immediately and its properties can beaccessed as
sionna.phy.config.desired_property.- propertynp_cdtype
Default NumPy dtype for complex floating point numbers
- Type:
np.dtype
- propertynp_rdtype
Default NumPy dtype for real floating point numbers
- Type:
np.dtype
- propertynp_rng
NumPy random number generator
fromsionna.phyimportconfigconfig.seed=42# Set seed for deterministic results# Use generator instead of np.randomnoise=config.np_rng.normal(size=[4])
- Type:
np.random.Generator
- propertyprecision
Default precision used for all computations
The “single” option represents real-valued floating-point numbersusing 32 bits, whereas the “double” option uses 64 bits.For complex-valued data types, each component of the complex number(real and imaginary parts) uses either 32 bits (for “single”)or 64 bits (for “double”).
- Type:
“single” (default) | “double”
- propertypy_rng
Python random number generator
fromsionna.phyimportconfigconfig.seed=42# Set seed for deterministic results# Use generator instead of randomint=config.py_rng.randint(0,10)
- Type:
random.Random
- propertyseed
Get/set seed for all random number generators
All random number generators used internally by Sionnacan be configured with a common seed to ensure reproducabilityof results. It defaults toNone which implies that a randomseed will be used and results are non-deterministic.
# This code will lead to deterministic resultsfromsionna.phyimportconfigfromsionna.phy.mappingimportBinarySourceconfig.seed=42print(BinarySource()([10]))
tf.Tensor([0. 1. 1. 1. 1. 0. 1. 0. 1. 0.], shape=(10,), dtype=float32)- Type:
None (default) |int
- propertytf_cdtype
Default TensorFlow dtype for complex floating point numbers
- Type:
tf.dtype
- propertytf_rdtype
Default TensorFlow dtype for real floating point numbers
- Type:
tf.dtype
- propertytf_rng
TensorFlow random number generator
fromsionna.phyimportconfigconfig.seed=42# Set seed for deterministic results# Use generator instead of tf.randomnoise=config.tf_rng.normal([4])
- Type:
tf.random.Generator