# -*- coding: utf-8 -*-
# (C) Copyright 2024 IBM. All Rights Reserved.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.
# pylint: disable=too-many-instance-attributes
"""Mapping parameters for resistive processing units."""
from dataclasses import dataclass, field
from .helpers import _PrintableMixin
[docs]@dataclass
class MappingParameter(_PrintableMixin):
"""Parameter related to hardware design and the mapping of logical
weight matrices to physical tiles.
Caution:
Some of these parameters have only an effect for modules that
support tile mappings.
"""
max_input_size: int = -1
"""Maximal input size of the weight matrix
that is handled on a single analog tile.
If the logical weight matrix size exceeds this size it will be
split and mapped onto multiple analog tiles. -1 means no maximum input size.
"""
[docs]@dataclass
class MappableRPU(_PrintableMixin):
"""Defines the mapping parameters and utility factories"""
mapping: MappingParameter = field(default_factory=MappingParameter)
"""Parameter related to mapping weights to tiles for supporting modules."""