pyspark.TaskContext.cpuAmount# TaskContext.cpuAmount()[source]# The exact amount of CPUs allocated to the task. This can be fractional when spark.task.cpus or the task resource profile requests a fractional amount (e.g. 0.5). Added in version 4.3.0. Returns: decimal.Decimalthe exact, possibly fractional amount of CPUs. See also TaskContext.cpus