| /** |
| * Copyright (c) 2020 CEA LIST |
| * |
| * All rights reserved. This program and the accompanying materials are |
| * made available under the terms of the Eclipse Public License v2.0 which |
| * accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| */ |
| package org.eclipse.papyrus.aiml.profile.AIML.Linear_layers.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Linear_layers.Linear; |
| import org.eclipse.papyrus.aiml.profile.AIML.Linear_layers.Linear_layersPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Linear</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.aiml.profile.AIML.Linear_layers.impl.LinearImpl#getIn_features <em>In features</em>}</li> |
| * <li>{@link org.eclipse.papyrus.aiml.profile.AIML.Linear_layers.impl.LinearImpl#getActivation <em>Activation</em>}</li> |
| * <li>{@link org.eclipse.papyrus.aiml.profile.AIML.Linear_layers.impl.LinearImpl#getKernel_initializer <em>Kernel initializer</em>}</li> |
| * <li>{@link org.eclipse.papyrus.aiml.profile.AIML.Linear_layers.impl.LinearImpl#getBias_initializer <em>Bias initializer</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class LinearImpl extends Linear_layers_1Impl implements Linear { |
| /** |
| * The default value of the '{@link #getIn_features() <em>In features</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getIn_features() |
| * @generated |
| * @ordered |
| */ |
| protected static final int IN_FEATURES_EDEFAULT = 0; |
| |
| /** |
| * The cached value of the '{@link #getIn_features() <em>In features</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getIn_features() |
| * @generated |
| * @ordered |
| */ |
| protected int in_features = IN_FEATURES_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getActivation() <em>Activation</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getActivation() |
| * @generated |
| * @ordered |
| */ |
| protected static final String ACTIVATION_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getActivation() <em>Activation</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getActivation() |
| * @generated |
| * @ordered |
| */ |
| protected String activation = ACTIVATION_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getKernel_initializer() <em>Kernel initializer</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getKernel_initializer() |
| * @generated |
| * @ordered |
| */ |
| protected static final String KERNEL_INITIALIZER_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getKernel_initializer() <em>Kernel initializer</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getKernel_initializer() |
| * @generated |
| * @ordered |
| */ |
| protected String kernel_initializer = KERNEL_INITIALIZER_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getBias_initializer() <em>Bias initializer</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getBias_initializer() |
| * @generated |
| * @ordered |
| */ |
| protected static final String BIAS_INITIALIZER_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getBias_initializer() <em>Bias initializer</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getBias_initializer() |
| * @generated |
| * @ordered |
| */ |
| protected String bias_initializer = BIAS_INITIALIZER_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected LinearImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return Linear_layersPackage.Literals.LINEAR; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public int getIn_features() { |
| return in_features; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setIn_features(int newIn_features) { |
| int oldIn_features = in_features; |
| in_features = newIn_features; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, Linear_layersPackage.LINEAR__IN_FEATURES, oldIn_features, in_features)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String getActivation() { |
| return activation; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setActivation(String newActivation) { |
| String oldActivation = activation; |
| activation = newActivation; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, Linear_layersPackage.LINEAR__ACTIVATION, oldActivation, activation)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String getKernel_initializer() { |
| return kernel_initializer; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setKernel_initializer(String newKernel_initializer) { |
| String oldKernel_initializer = kernel_initializer; |
| kernel_initializer = newKernel_initializer; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, Linear_layersPackage.LINEAR__KERNEL_INITIALIZER, oldKernel_initializer, kernel_initializer)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String getBias_initializer() { |
| return bias_initializer; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setBias_initializer(String newBias_initializer) { |
| String oldBias_initializer = bias_initializer; |
| bias_initializer = newBias_initializer; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, Linear_layersPackage.LINEAR__BIAS_INITIALIZER, oldBias_initializer, bias_initializer)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case Linear_layersPackage.LINEAR__IN_FEATURES: |
| return getIn_features(); |
| case Linear_layersPackage.LINEAR__ACTIVATION: |
| return getActivation(); |
| case Linear_layersPackage.LINEAR__KERNEL_INITIALIZER: |
| return getKernel_initializer(); |
| case Linear_layersPackage.LINEAR__BIAS_INITIALIZER: |
| return getBias_initializer(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case Linear_layersPackage.LINEAR__IN_FEATURES: |
| setIn_features((Integer)newValue); |
| return; |
| case Linear_layersPackage.LINEAR__ACTIVATION: |
| setActivation((String)newValue); |
| return; |
| case Linear_layersPackage.LINEAR__KERNEL_INITIALIZER: |
| setKernel_initializer((String)newValue); |
| return; |
| case Linear_layersPackage.LINEAR__BIAS_INITIALIZER: |
| setBias_initializer((String)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case Linear_layersPackage.LINEAR__IN_FEATURES: |
| setIn_features(IN_FEATURES_EDEFAULT); |
| return; |
| case Linear_layersPackage.LINEAR__ACTIVATION: |
| setActivation(ACTIVATION_EDEFAULT); |
| return; |
| case Linear_layersPackage.LINEAR__KERNEL_INITIALIZER: |
| setKernel_initializer(KERNEL_INITIALIZER_EDEFAULT); |
| return; |
| case Linear_layersPackage.LINEAR__BIAS_INITIALIZER: |
| setBias_initializer(BIAS_INITIALIZER_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case Linear_layersPackage.LINEAR__IN_FEATURES: |
| return in_features != IN_FEATURES_EDEFAULT; |
| case Linear_layersPackage.LINEAR__ACTIVATION: |
| return ACTIVATION_EDEFAULT == null ? activation != null : !ACTIVATION_EDEFAULT.equals(activation); |
| case Linear_layersPackage.LINEAR__KERNEL_INITIALIZER: |
| return KERNEL_INITIALIZER_EDEFAULT == null ? kernel_initializer != null : !KERNEL_INITIALIZER_EDEFAULT.equals(kernel_initializer); |
| case Linear_layersPackage.LINEAR__BIAS_INITIALIZER: |
| return BIAS_INITIALIZER_EDEFAULT == null ? bias_initializer != null : !BIAS_INITIALIZER_EDEFAULT.equals(bias_initializer); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuilder result = new StringBuilder(super.toString()); |
| result.append(" (in_features: "); //$NON-NLS-1$ |
| result.append(in_features); |
| result.append(", activation: "); //$NON-NLS-1$ |
| result.append(activation); |
| result.append(", kernel_initializer: "); //$NON-NLS-1$ |
| result.append(kernel_initializer); |
| result.append(", bias_initializer: "); //$NON-NLS-1$ |
| result.append(bias_initializer); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //LinearImpl |