hls4ml.model package

Subpackages

Submodules

hls4ml.model.attributes module

class hls4ml.model.attributes.Attribute(name, value_type=<class 'int'>, default=None, configurable=False)

Bases: object

validate_value(value)
class hls4ml.model.attributes.AttributeDict(layer)

Bases: MutableMapping

class hls4ml.model.attributes.AttributeMapping(attributes, clazz)

Bases: MutableMapping

class hls4ml.model.attributes.ChoiceAttribute(name, choices, default=None, configurable=True)

Bases: Attribute

validate_value(value)
class hls4ml.model.attributes.CodeAttrubute(name)

Bases: Attribute

class hls4ml.model.attributes.CodeMapping(attributes)

Bases: AttributeMapping

class hls4ml.model.attributes.TypeAttribute(name, default=None, configurable=True)

Bases: Attribute

class hls4ml.model.attributes.TypeMapping(attributes)

Bases: AttributeMapping

class hls4ml.model.attributes.VariableAttribute(name)

Bases: Attribute

class hls4ml.model.attributes.VariableMapping(attributes)

Bases: AttributeMapping

class hls4ml.model.attributes.WeightAttribute(name)

Bases: Attribute

class hls4ml.model.attributes.WeightMapping(attributes)

Bases: AttributeMapping

hls4ml.model.graph module

hls4ml.model.layers module

class hls4ml.model.layers.Activation(model, name, attributes, inputs, outputs=None)

Bases: Layer

initialize()
class hls4ml.model.layers.BatchNormalization(model, name, attributes, inputs, outputs=None)

Bases: Layer

initialize()
class hls4ml.model.layers.BiasAdd(model, name, attributes, inputs, outputs=None)

Bases: Merge

initialize()
class hls4ml.model.layers.Concatenate(model, name, attributes, inputs, outputs=None)

Bases: Merge

initialize()
class hls4ml.model.layers.Conv1D(model, name, attributes, inputs, outputs=None)

Bases: Layer

initialize()
class hls4ml.model.layers.Conv2D(model, name, attributes, inputs, outputs=None)

Bases: Layer

initialize()
class hls4ml.model.layers.Conv2DBatchnorm(model, name, attributes, inputs, outputs=None)

Bases: Conv2D

initialize()
class hls4ml.model.layers.Dense(model, name, attributes, inputs, outputs=None)

Bases: Layer

initialize()
class hls4ml.model.layers.DepthwiseConv2D(model, name, attributes, inputs, outputs=None)

Bases: Conv2D

initialize()
class hls4ml.model.layers.Dot(model, name, attributes, inputs, outputs=None)

Bases: Merge

initialize()
class hls4ml.model.layers.Embedding(model, name, attributes, inputs, outputs=None)

Bases: Layer

initialize()
class hls4ml.model.layers.GRU(model, name, attributes, inputs, outputs=None)

Bases: Layer

initialize()
class hls4ml.model.layers.GarNet(model, name, attributes, inputs, outputs=None)

Bases: Layer

initialize()
ref_impl = False
class hls4ml.model.layers.GarNetStack(model, name, attributes, inputs, outputs=None)

Bases: GarNet

class hls4ml.model.layers.GlobalPooling1D(model, name, attributes, inputs, outputs=None)

Bases: Layer

initialize()
class hls4ml.model.layers.GlobalPooling2D(model, name, attributes, inputs, outputs=None)

Bases: Layer

initialize()
class hls4ml.model.layers.Input(model, name, attributes, inputs, outputs=None)

Bases: Layer

initialize()
class hls4ml.model.layers.LSTM(model, name, attributes, inputs, outputs=None)

Bases: Layer

initialize()
class hls4ml.model.layers.Layer(model, name, attributes, inputs, outputs=None)

Bases: object

add_bias(quantizer=None)
add_output_variable(shape, dim_names, out_name=None, var_name='layer{index}_out', type_name='layer{index}_t', precision=None)
add_weights(quantizer=None, compression=False)
add_weights_variable(name, var_name=None, type_name=None, precision=None, data=None, quantizer=None, compression=False)
property class_name
expected_attributes = [<hls4ml.model.attributes.Attribute object>, <hls4ml.model.attributes.TypeAttribute object>, <hls4ml.model.attributes.TypeAttribute object>]
get_attr(key, default=None)
get_input_node(input_name=None)
get_input_variable(input_name=None)
get_layer_precision()
get_numbers_cpp()
get_output_nodes(output_name=None)
get_output_use_map()
get_output_variable(output_name=None)
get_variables()
get_weights(var_name=None)
initialize()
precision_cpp()
set_attr(key, value)
class hls4ml.model.layers.Merge(model, name, attributes, inputs, outputs=None)

Bases: Layer

initialize()
class hls4ml.model.layers.PReLU(model, name, attributes, inputs, outputs=None)

Bases: Activation

initialize()
class hls4ml.model.layers.ParametrizedActivation(model, name, attributes, inputs, outputs=None)

Bases: Activation

class hls4ml.model.layers.Pooling1D(model, name, attributes, inputs, outputs=None)

Bases: Layer

initialize()
class hls4ml.model.layers.Pooling2D(model, name, attributes, inputs, outputs=None)

Bases: Layer

initialize()
class hls4ml.model.layers.Reshape(model, name, attributes, inputs, outputs=None)

Bases: Layer

initialize()
class hls4ml.model.layers.Resize(model, name, attributes, inputs, outputs=None)

Bases: Layer

initialize()
class hls4ml.model.layers.SeparableConv1D(model, name, attributes, inputs, outputs=None)

Bases: Layer

initialize()
class hls4ml.model.layers.SeparableConv2D(model, name, attributes, inputs, outputs=None)

Bases: Layer

initialize()
class hls4ml.model.layers.SimpleRNN(model, name, attributes, inputs, outputs=None)

Bases: Layer

initialize()
class hls4ml.model.layers.Softmax(model, name, attributes, inputs, outputs=None)

Bases: Activation

initialize()
class hls4ml.model.layers.TernaryTanh(model, name, attributes, inputs, outputs=None)

Bases: Activation

initialize()
class hls4ml.model.layers.Transpose(model, name, attributes, inputs, outputs=None)

Bases: Layer

initialize()
class hls4ml.model.layers.ZeroPadding1D(model, name, attributes, inputs, outputs=None)

Bases: Layer

initialize()
class hls4ml.model.layers.ZeroPadding2D(model, name, attributes, inputs, outputs=None)

Bases: Layer

initialize()
class hls4ml.model.layers.classproperty(func)

Bases: object

hls4ml.model.layers.register_layer(name, clazz)

hls4ml.model.profiling module

hls4ml.model.types module

class hls4ml.model.types.CompressedType(name, precision, index_precision, **kwargs)

Bases: NamedType

class hls4ml.model.types.CompressedWeightVariable(var_name, type_name, precision, data, reuse_factor, quantizer=None, **kwargs)

Bases: WeightVariable

next()
class hls4ml.model.types.ExponentPrecisionType(width=16, signed=True)

Bases: IntegerPrecisionType

Convenience class to differentiate ‘regular’ integers from those which represent exponents, for QKeras po2 quantizers, for example.

class hls4ml.model.types.ExponentType(name, precision, **kwargs)

Bases: NamedType

class hls4ml.model.types.ExponentWeightVariable(var_name, type_name, precision, data, quantizer=None, **kwargs)

Bases: WeightVariable

next()
class hls4ml.model.types.FixedPrecisionType(width=16, integer=6, signed=True, rounding_mode=None, saturation_mode=None, saturation_bits=None)

Bases: PrecisionType

property rounding_mode
property saturation_mode
class hls4ml.model.types.InplaceVariable(shape, dim_names, proxy)

Bases: Variable

definition_cpp(name_suffix='', as_reference=False)
get_shape()
size_cpp()
class hls4ml.model.types.IntegerPrecisionType(width=16, signed=True)

Bases: PrecisionType

class hls4ml.model.types.NamedType(name, precision, **kwargs)

Bases: object

class hls4ml.model.types.PackedType(name, precision, n_elem, n_pack, **kwargs)

Bases: NamedType

class hls4ml.model.types.PrecisionType(width, signed)

Bases: object

class hls4ml.model.types.Quantizer(bits, hls_type)

Bases: object

class hls4ml.model.types.RoundingMode(value)

Bases: Enum

An enumeration.

RND = 3
RND_CONV = 7
RND_INF = 5
RND_MIN_INF = 6
RND_ZERO = 4
TRN = 1
TRN_ZERO = 2
classmethod from_string(mode)
class hls4ml.model.types.SaturationMode(value)

Bases: Enum

An enumeration.

SAT = 2
SAT_SYM = 4
SAT_ZERO = 3
WRAP = 1
classmethod from_string(mode)
class hls4ml.model.types.Source(code)

Bases: object

class hls4ml.model.types.TensorVariable(shape, dim_names, var_name='layer{index}', type_name='layer{index}_t', precision=None, **kwargs)

Bases: Variable

get_shape()
size()
size_cpp()
class hls4ml.model.types.Variable(var_name, atype, **kwargs)

Bases: object

class hls4ml.model.types.WeightVariable(var_name, type_name, precision, data, quantizer=None, **kwargs)

Bases: Variable

next()
update_precision(new_precision)
class hls4ml.model.types.XnorPrecisionType

Bases: IntegerPrecisionType

Convenience class to differentiate ‘regular’ integers from BNN Xnor ones

hls4ml.model.types.find_minimum_width(data, signed=True)

Helper function to find the minimum integer width to express all entries in the data array without saturation / overflow

Module contents