blob: f1ee3dbc15a2f0bc8b528047d19c99054b2fed8b [file] [log] [blame]
/**
* 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.Loss_functions.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.papyrus.aiml.profile.AIML.Loss_functions.BCEWithLogitsLoss;
import org.eclipse.papyrus.aiml.profile.AIML.Loss_functions.Loss_functionsPackage;
import org.eclipse.papyrus.aiml.profile.AIML.Tensor.Tensor;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>BCE With Logits Loss</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.papyrus.aiml.profile.AIML.Loss_functions.impl.BCEWithLogitsLossImpl#getPos_weight <em>Pos weight</em>}</li>
* </ul>
*
* @generated
*/
public class BCEWithLogitsLossImpl extends Loss_functions_1_2Impl implements BCEWithLogitsLoss {
/**
* The cached value of the '{@link #getPos_weight() <em>Pos weight</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPos_weight()
* @generated
* @ordered
*/
protected Tensor pos_weight;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected BCEWithLogitsLossImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return Loss_functionsPackage.Literals.BCE_WITH_LOGITS_LOSS;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Tensor getPos_weight() {
if (pos_weight != null && pos_weight.eIsProxy()) {
InternalEObject oldPos_weight = (InternalEObject)pos_weight;
pos_weight = (Tensor)eResolveProxy(oldPos_weight);
if (pos_weight != oldPos_weight) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, Loss_functionsPackage.BCE_WITH_LOGITS_LOSS__POS_WEIGHT, oldPos_weight, pos_weight));
}
}
return pos_weight;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Tensor basicGetPos_weight() {
return pos_weight;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setPos_weight(Tensor newPos_weight) {
Tensor oldPos_weight = pos_weight;
pos_weight = newPos_weight;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Loss_functionsPackage.BCE_WITH_LOGITS_LOSS__POS_WEIGHT, oldPos_weight, pos_weight));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Loss_functionsPackage.BCE_WITH_LOGITS_LOSS__POS_WEIGHT:
if (resolve) return getPos_weight();
return basicGetPos_weight();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Loss_functionsPackage.BCE_WITH_LOGITS_LOSS__POS_WEIGHT:
setPos_weight((Tensor)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Loss_functionsPackage.BCE_WITH_LOGITS_LOSS__POS_WEIGHT:
setPos_weight((Tensor)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Loss_functionsPackage.BCE_WITH_LOGITS_LOSS__POS_WEIGHT:
return pos_weight != null;
}
return super.eIsSet(featureID);
}
} //BCEWithLogitsLossImpl