| /** |
| * 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.Tensor.impl; |
| |
| import org.eclipse.emf.ecore.EAttribute; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.EEnum; |
| import org.eclipse.emf.ecore.EPackage; |
| import org.eclipse.emf.ecore.EReference; |
| import org.eclipse.emf.ecore.EcorePackage; |
| |
| import org.eclipse.emf.ecore.impl.EPackageImpl; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.AIMLPackage; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Convolution_layers.Convolution_layersPackage; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Convolution_layers.impl.Convolution_layersPackageImpl; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.DataParallel_layers.DataParallel_layersPackage; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.DataParallel_layers.impl.DataParallel_layersPackageImpl; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Distance_functions.Distance_functionsPackage; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Distance_functions.impl.Distance_functionsPackageImpl; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Dropout_layers.Dropout_layersPackage; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Dropout_layers.impl.Dropout_layersPackageImpl; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Layer_weight_constraints.Layer_weight_constraintsPackage; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Layer_weight_constraints.impl.Layer_weight_constraintsPackageImpl; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Layer_weight_initializers.Layer_weight_initializersPackage; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Layer_weight_initializers.impl.Layer_weight_initializersPackageImpl; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Layer_weight_regularizers.Layer_weight_regularizersPackage; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Layer_weight_regularizers.impl.Layer_weight_regularizersPackageImpl; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Linear_layers.Linear_layersPackage; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Linear_layers.impl.Linear_layersPackageImpl; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Loss_functions.Loss_functionsPackage; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Loss_functions.impl.Loss_functionsPackageImpl; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Module.ModulePackage; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Module.impl.ModulePackageImpl; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.NonLinearActivations.NonLinearActivationsPackage; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.NonLinearActivations.impl.NonLinearActivationsPackageImpl; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Normalization_layers.Normalization_layersPackage; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Normalization_layers.impl.Normalization_layersPackageImpl; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Padding_layers.Padding_layersPackage; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Padding_layers.impl.Padding_layersPackageImpl; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Pooling_layers.Pooling_layersPackage; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Pooling_layers.impl.Pooling_layersPackageImpl; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Recurrent_layers.Recurrent_layersPackage; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Recurrent_layers.impl.Recurrent_layersPackageImpl; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.SoftMinMaxActivations.SoftMinMaxActivationsPackage; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.SoftMinMaxActivations.impl.SoftMinMaxActivationsPackageImpl; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Sparse_layers.Sparse_layersPackage; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Sparse_layers.impl.Sparse_layersPackageImpl; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Tensor.EDType; |
| import org.eclipse.papyrus.aiml.profile.AIML.Tensor.ETensorTypes; |
| import org.eclipse.papyrus.aiml.profile.AIML.Tensor.Tensor; |
| import org.eclipse.papyrus.aiml.profile.AIML.Tensor.TensorFactory; |
| import org.eclipse.papyrus.aiml.profile.AIML.Tensor.TensorPackage; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Transformer_layers.Transformer_layersPackage; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Transformer_layers.impl.Transformer_layersPackageImpl; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Vision_layers.Vision_layersPackage; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Vision_layers.impl.Vision_layersPackageImpl; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.datatypes.DatatypesPackage; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.datatypes.impl.DatatypesPackageImpl; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.impl.AIMLPackageImpl; |
| |
| import org.eclipse.uml2.types.TypesPackage; |
| |
| import org.eclipse.uml2.uml.UMLPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model <b>Package</b>. |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public class TensorPackageImpl extends EPackageImpl implements TensorPackage { |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EClass tensorEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EEnum edTypeEEnum = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EEnum eTensorTypesEEnum = null; |
| |
| /** |
| * Creates an instance of the model <b>Package</b>, registered with |
| * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package |
| * package URI value. |
| * <p>Note: the correct way to create the package is via the static |
| * factory method {@link #init init()}, which also performs |
| * initialization of the package, or returns the registered package, |
| * if one already exists. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see org.eclipse.emf.ecore.EPackage.Registry |
| * @see org.eclipse.papyrus.aiml.profile.AIML.Tensor.TensorPackage#eNS_URI |
| * @see #init() |
| * @generated |
| */ |
| private TensorPackageImpl() { |
| super(eNS_URI, TensorFactory.eINSTANCE); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private static boolean isInited = false; |
| |
| /** |
| * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. |
| * |
| * <p>This method is used to initialize {@link TensorPackage#eINSTANCE} when that field is accessed. |
| * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #eNS_URI |
| * @see #createPackageContents() |
| * @see #initializePackageContents() |
| * @generated |
| */ |
| public static TensorPackage init() { |
| if (isInited) return (TensorPackage)EPackage.Registry.INSTANCE.getEPackage(TensorPackage.eNS_URI); |
| |
| // Obtain or create and register package |
| Object registeredTensorPackage = EPackage.Registry.INSTANCE.get(eNS_URI); |
| TensorPackageImpl theTensorPackage = registeredTensorPackage instanceof TensorPackageImpl ? (TensorPackageImpl)registeredTensorPackage : new TensorPackageImpl(); |
| |
| isInited = true; |
| |
| // Initialize simple dependencies |
| EcorePackage.eINSTANCE.eClass(); |
| TypesPackage.eINSTANCE.eClass(); |
| UMLPackage.eINSTANCE.eClass(); |
| |
| // Obtain or create and register interdependencies |
| Object registeredPackage = EPackage.Registry.INSTANCE.getEPackage(AIMLPackage.eNS_URI); |
| AIMLPackageImpl theAIMLPackage = (AIMLPackageImpl)(registeredPackage instanceof AIMLPackageImpl ? registeredPackage : AIMLPackage.eINSTANCE); |
| registeredPackage = EPackage.Registry.INSTANCE.getEPackage(ModulePackage.eNS_URI); |
| ModulePackageImpl theModulePackage = (ModulePackageImpl)(registeredPackage instanceof ModulePackageImpl ? registeredPackage : ModulePackage.eINSTANCE); |
| registeredPackage = EPackage.Registry.INSTANCE.getEPackage(DatatypesPackage.eNS_URI); |
| DatatypesPackageImpl theDatatypesPackage = (DatatypesPackageImpl)(registeredPackage instanceof DatatypesPackageImpl ? registeredPackage : DatatypesPackage.eINSTANCE); |
| registeredPackage = EPackage.Registry.INSTANCE.getEPackage(Pooling_layersPackage.eNS_URI); |
| Pooling_layersPackageImpl thePooling_layersPackage = (Pooling_layersPackageImpl)(registeredPackage instanceof Pooling_layersPackageImpl ? registeredPackage : Pooling_layersPackage.eINSTANCE); |
| registeredPackage = EPackage.Registry.INSTANCE.getEPackage(Convolution_layersPackage.eNS_URI); |
| Convolution_layersPackageImpl theConvolution_layersPackage = (Convolution_layersPackageImpl)(registeredPackage instanceof Convolution_layersPackageImpl ? registeredPackage : Convolution_layersPackage.eINSTANCE); |
| registeredPackage = EPackage.Registry.INSTANCE.getEPackage(Layer_weight_constraintsPackage.eNS_URI); |
| Layer_weight_constraintsPackageImpl theLayer_weight_constraintsPackage = (Layer_weight_constraintsPackageImpl)(registeredPackage instanceof Layer_weight_constraintsPackageImpl ? registeredPackage : Layer_weight_constraintsPackage.eINSTANCE); |
| registeredPackage = EPackage.Registry.INSTANCE.getEPackage(Padding_layersPackage.eNS_URI); |
| Padding_layersPackageImpl thePadding_layersPackage = (Padding_layersPackageImpl)(registeredPackage instanceof Padding_layersPackageImpl ? registeredPackage : Padding_layersPackage.eINSTANCE); |
| registeredPackage = EPackage.Registry.INSTANCE.getEPackage(NonLinearActivationsPackage.eNS_URI); |
| NonLinearActivationsPackageImpl theNonLinearActivationsPackage = (NonLinearActivationsPackageImpl)(registeredPackage instanceof NonLinearActivationsPackageImpl ? registeredPackage : NonLinearActivationsPackage.eINSTANCE); |
| registeredPackage = EPackage.Registry.INSTANCE.getEPackage(SoftMinMaxActivationsPackage.eNS_URI); |
| SoftMinMaxActivationsPackageImpl theSoftMinMaxActivationsPackage = (SoftMinMaxActivationsPackageImpl)(registeredPackage instanceof SoftMinMaxActivationsPackageImpl ? registeredPackage : SoftMinMaxActivationsPackage.eINSTANCE); |
| registeredPackage = EPackage.Registry.INSTANCE.getEPackage(Normalization_layersPackage.eNS_URI); |
| Normalization_layersPackageImpl theNormalization_layersPackage = (Normalization_layersPackageImpl)(registeredPackage instanceof Normalization_layersPackageImpl ? registeredPackage : Normalization_layersPackage.eINSTANCE); |
| registeredPackage = EPackage.Registry.INSTANCE.getEPackage(Recurrent_layersPackage.eNS_URI); |
| Recurrent_layersPackageImpl theRecurrent_layersPackage = (Recurrent_layersPackageImpl)(registeredPackage instanceof Recurrent_layersPackageImpl ? registeredPackage : Recurrent_layersPackage.eINSTANCE); |
| registeredPackage = EPackage.Registry.INSTANCE.getEPackage(Transformer_layersPackage.eNS_URI); |
| Transformer_layersPackageImpl theTransformer_layersPackage = (Transformer_layersPackageImpl)(registeredPackage instanceof Transformer_layersPackageImpl ? registeredPackage : Transformer_layersPackage.eINSTANCE); |
| registeredPackage = EPackage.Registry.INSTANCE.getEPackage(Linear_layersPackage.eNS_URI); |
| Linear_layersPackageImpl theLinear_layersPackage = (Linear_layersPackageImpl)(registeredPackage instanceof Linear_layersPackageImpl ? registeredPackage : Linear_layersPackage.eINSTANCE); |
| registeredPackage = EPackage.Registry.INSTANCE.getEPackage(Dropout_layersPackage.eNS_URI); |
| Dropout_layersPackageImpl theDropout_layersPackage = (Dropout_layersPackageImpl)(registeredPackage instanceof Dropout_layersPackageImpl ? registeredPackage : Dropout_layersPackage.eINSTANCE); |
| registeredPackage = EPackage.Registry.INSTANCE.getEPackage(Sparse_layersPackage.eNS_URI); |
| Sparse_layersPackageImpl theSparse_layersPackage = (Sparse_layersPackageImpl)(registeredPackage instanceof Sparse_layersPackageImpl ? registeredPackage : Sparse_layersPackage.eINSTANCE); |
| registeredPackage = EPackage.Registry.INSTANCE.getEPackage(Distance_functionsPackage.eNS_URI); |
| Distance_functionsPackageImpl theDistance_functionsPackage = (Distance_functionsPackageImpl)(registeredPackage instanceof Distance_functionsPackageImpl ? registeredPackage : Distance_functionsPackage.eINSTANCE); |
| registeredPackage = EPackage.Registry.INSTANCE.getEPackage(Loss_functionsPackage.eNS_URI); |
| Loss_functionsPackageImpl theLoss_functionsPackage = (Loss_functionsPackageImpl)(registeredPackage instanceof Loss_functionsPackageImpl ? registeredPackage : Loss_functionsPackage.eINSTANCE); |
| registeredPackage = EPackage.Registry.INSTANCE.getEPackage(Vision_layersPackage.eNS_URI); |
| Vision_layersPackageImpl theVision_layersPackage = (Vision_layersPackageImpl)(registeredPackage instanceof Vision_layersPackageImpl ? registeredPackage : Vision_layersPackage.eINSTANCE); |
| registeredPackage = EPackage.Registry.INSTANCE.getEPackage(DataParallel_layersPackage.eNS_URI); |
| DataParallel_layersPackageImpl theDataParallel_layersPackage = (DataParallel_layersPackageImpl)(registeredPackage instanceof DataParallel_layersPackageImpl ? registeredPackage : DataParallel_layersPackage.eINSTANCE); |
| registeredPackage = EPackage.Registry.INSTANCE.getEPackage(Layer_weight_regularizersPackage.eNS_URI); |
| Layer_weight_regularizersPackageImpl theLayer_weight_regularizersPackage = (Layer_weight_regularizersPackageImpl)(registeredPackage instanceof Layer_weight_regularizersPackageImpl ? registeredPackage : Layer_weight_regularizersPackage.eINSTANCE); |
| registeredPackage = EPackage.Registry.INSTANCE.getEPackage(Layer_weight_initializersPackage.eNS_URI); |
| Layer_weight_initializersPackageImpl theLayer_weight_initializersPackage = (Layer_weight_initializersPackageImpl)(registeredPackage instanceof Layer_weight_initializersPackageImpl ? registeredPackage : Layer_weight_initializersPackage.eINSTANCE); |
| |
| // Create package meta-data objects |
| theTensorPackage.createPackageContents(); |
| theAIMLPackage.createPackageContents(); |
| theModulePackage.createPackageContents(); |
| theDatatypesPackage.createPackageContents(); |
| thePooling_layersPackage.createPackageContents(); |
| theConvolution_layersPackage.createPackageContents(); |
| theLayer_weight_constraintsPackage.createPackageContents(); |
| thePadding_layersPackage.createPackageContents(); |
| theNonLinearActivationsPackage.createPackageContents(); |
| theSoftMinMaxActivationsPackage.createPackageContents(); |
| theNormalization_layersPackage.createPackageContents(); |
| theRecurrent_layersPackage.createPackageContents(); |
| theTransformer_layersPackage.createPackageContents(); |
| theLinear_layersPackage.createPackageContents(); |
| theDropout_layersPackage.createPackageContents(); |
| theSparse_layersPackage.createPackageContents(); |
| theDistance_functionsPackage.createPackageContents(); |
| theLoss_functionsPackage.createPackageContents(); |
| theVision_layersPackage.createPackageContents(); |
| theDataParallel_layersPackage.createPackageContents(); |
| theLayer_weight_regularizersPackage.createPackageContents(); |
| theLayer_weight_initializersPackage.createPackageContents(); |
| |
| // Initialize created meta-data |
| theTensorPackage.initializePackageContents(); |
| theAIMLPackage.initializePackageContents(); |
| theModulePackage.initializePackageContents(); |
| theDatatypesPackage.initializePackageContents(); |
| thePooling_layersPackage.initializePackageContents(); |
| theConvolution_layersPackage.initializePackageContents(); |
| theLayer_weight_constraintsPackage.initializePackageContents(); |
| thePadding_layersPackage.initializePackageContents(); |
| theNonLinearActivationsPackage.initializePackageContents(); |
| theSoftMinMaxActivationsPackage.initializePackageContents(); |
| theNormalization_layersPackage.initializePackageContents(); |
| theRecurrent_layersPackage.initializePackageContents(); |
| theTransformer_layersPackage.initializePackageContents(); |
| theLinear_layersPackage.initializePackageContents(); |
| theDropout_layersPackage.initializePackageContents(); |
| theSparse_layersPackage.initializePackageContents(); |
| theDistance_functionsPackage.initializePackageContents(); |
| theLoss_functionsPackage.initializePackageContents(); |
| theVision_layersPackage.initializePackageContents(); |
| theDataParallel_layersPackage.initializePackageContents(); |
| theLayer_weight_regularizersPackage.initializePackageContents(); |
| theLayer_weight_initializersPackage.initializePackageContents(); |
| |
| // Mark meta-data to indicate it can't be changed |
| theTensorPackage.freeze(); |
| |
| // Update the registry and return the package |
| EPackage.Registry.INSTANCE.put(TensorPackage.eNS_URI, theTensorPackage); |
| return theTensorPackage; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EClass getTensor() { |
| return tensorEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EAttribute getTensor_Data() { |
| return (EAttribute)tensorEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EAttribute getTensor_Dtype() { |
| return (EAttribute)tensorEClass.getEStructuralFeatures().get(1); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EReference getTensor_Device() { |
| return (EReference)tensorEClass.getEStructuralFeatures().get(2); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EAttribute getTensor_Requires_grad() { |
| return (EAttribute)tensorEClass.getEStructuralFeatures().get(3); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EAttribute getTensor_Pin_memory() { |
| return (EAttribute)tensorEClass.getEStructuralFeatures().get(4); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EAttribute getTensor_Shape() { |
| return (EAttribute)tensorEClass.getEStructuralFeatures().get(5); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EAttribute getTensor_Name() { |
| return (EAttribute)tensorEClass.getEStructuralFeatures().get(6); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EReference getTensor_Base_Class() { |
| return (EReference)tensorEClass.getEStructuralFeatures().get(7); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EEnum getEDType() { |
| return edTypeEEnum; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EEnum getETensorTypes() { |
| return eTensorTypesEEnum; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public TensorFactory getTensorFactory() { |
| return (TensorFactory)getEFactoryInstance(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private boolean isCreated = false; |
| |
| /** |
| * Creates the meta-model objects for the package. This method is |
| * guarded to have no affect on any invocation but its first. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void createPackageContents() { |
| if (isCreated) return; |
| isCreated = true; |
| |
| // Create classes and their features |
| tensorEClass = createEClass(TENSOR); |
| createEAttribute(tensorEClass, TENSOR__DATA); |
| createEAttribute(tensorEClass, TENSOR__DTYPE); |
| createEReference(tensorEClass, TENSOR__DEVICE); |
| createEAttribute(tensorEClass, TENSOR__REQUIRES_GRAD); |
| createEAttribute(tensorEClass, TENSOR__PIN_MEMORY); |
| createEAttribute(tensorEClass, TENSOR__SHAPE); |
| createEAttribute(tensorEClass, TENSOR__NAME); |
| createEReference(tensorEClass, TENSOR__BASE_CLASS); |
| |
| // Create enums |
| edTypeEEnum = createEEnum(ED_TYPE); |
| eTensorTypesEEnum = createEEnum(ETENSOR_TYPES); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private boolean isInitialized = false; |
| |
| /** |
| * Complete the initialization of the package and its meta-model. This |
| * method is guarded to have no affect on any invocation but its first. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void initializePackageContents() { |
| if (isInitialized) return; |
| isInitialized = true; |
| |
| // Initialize package |
| setName(eNAME); |
| setNsPrefix(eNS_PREFIX); |
| setNsURI(eNS_URI); |
| |
| // Obtain other dependent packages |
| TypesPackage theTypesPackage = (TypesPackage)EPackage.Registry.INSTANCE.getEPackage(TypesPackage.eNS_URI); |
| DatatypesPackage theDatatypesPackage = (DatatypesPackage)EPackage.Registry.INSTANCE.getEPackage(DatatypesPackage.eNS_URI); |
| UMLPackage theUMLPackage = (UMLPackage)EPackage.Registry.INSTANCE.getEPackage(UMLPackage.eNS_URI); |
| |
| // Create type parameters |
| |
| // Set bounds for type parameters |
| |
| // Add supertypes to classes |
| |
| // Initialize classes, features, and operations; add parameters |
| initEClass(tensorEClass, Tensor.class, "Tensor", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ |
| initEAttribute(getTensor_Data(), theTypesPackage.getReal(), "data", null, 0, -1, Tensor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ |
| initEAttribute(getTensor_Dtype(), this.getEDType(), "dtype", null, 0, 1, Tensor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ |
| initEReference(getTensor_Device(), theDatatypesPackage.getDevice(), null, "device", null, 0, 1, Tensor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ |
| initEAttribute(getTensor_Requires_grad(), theTypesPackage.getBoolean(), "requires_grad", null, 0, 1, Tensor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ |
| initEAttribute(getTensor_Pin_memory(), theTypesPackage.getBoolean(), "pin_memory", null, 0, 1, Tensor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ |
| initEAttribute(getTensor_Shape(), theTypesPackage.getInteger(), "shape", null, 0, -1, Tensor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ |
| initEAttribute(getTensor_Name(), theTypesPackage.getString(), "name", null, 0, 1, Tensor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ |
| initEReference(getTensor_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 0, 1, Tensor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ |
| |
| // Initialize enums and add enum literals |
| initEEnum(edTypeEEnum, EDType.class, "EDType"); //$NON-NLS-1$ |
| addEEnumLiteral(edTypeEEnum, EDType.FLOAT32); |
| addEEnumLiteral(edTypeEEnum, EDType.FLOAT64); |
| addEEnumLiteral(edTypeEEnum, EDType.FLOAT16); |
| addEEnumLiteral(edTypeEEnum, EDType.UINT8); |
| addEEnumLiteral(edTypeEEnum, EDType.INT8); |
| addEEnumLiteral(edTypeEEnum, EDType.INT16); |
| addEEnumLiteral(edTypeEEnum, EDType.INT32); |
| addEEnumLiteral(edTypeEEnum, EDType.INT64); |
| addEEnumLiteral(edTypeEEnum, EDType.BOOL); |
| |
| initEEnum(eTensorTypesEEnum, ETensorTypes.class, "ETensorTypes"); //$NON-NLS-1$ |
| addEEnumLiteral(eTensorTypesEEnum, ETensorTypes.FLOAT_TENSOR); |
| addEEnumLiteral(eTensorTypesEEnum, ETensorTypes.DOUBLE_TENSOR); |
| addEEnumLiteral(eTensorTypesEEnum, ETensorTypes.HALF_TENSOR); |
| addEEnumLiteral(eTensorTypesEEnum, ETensorTypes.BYTE_TENSOR); |
| addEEnumLiteral(eTensorTypesEEnum, ETensorTypes.CHAR_TENSOR); |
| addEEnumLiteral(eTensorTypesEEnum, ETensorTypes.SHORT_TENSOR); |
| addEEnumLiteral(eTensorTypesEEnum, ETensorTypes.INT_TENSOR); |
| addEEnumLiteral(eTensorTypesEEnum, ETensorTypes.LONG_TENSOR); |
| addEEnumLiteral(eTensorTypesEEnum, ETensorTypes.BOOL_TENSOR); |
| } |
| |
| } //TensorPackageImpl |