neoml.MathEngine

The purpose of the MathEngine class is to isolate the algorithms library from the implementation of the low-level platform-dependent operations. It is used in blob, layers, and neural network.

class neoml.MathEngine.MathEngine(internal)

The base class for a math engine that does calculations.

clean_up()

Releases all temporary resources allocated for the current thread.

property peak_memory_usage

The peak memory usage achieved during processing.

class neoml.MathEngine.CpuMathEngine(thread_count=None)

A math engine working on CPU.

Parameters

thread_count (int, default=None) – the maximum number of threads in use.

class neoml.MathEngine.GpuMathEngine(gpu_index=None)

A math engine working on GPU.

Parameters

gpu_index (int, >= 0 or None) – the index of the GPU on which you wish to work. Use the enum_gpu method to get the list. Use None for auto-selection.

property info

Gets the device information.

MathEngine.enum_gpu()

Lists the available GPUs.

MathEngine.default_math_engine()

Creates a default CPU math engine that uses only one processing thread and has no memory limitations.