All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.cmu.dynet.internal.UnidirectionalTreeLSTMBuilder Maven / Gradle / Ivy

/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 3.0.12
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package edu.cmu.dynet.internal;

public class UnidirectionalTreeLSTMBuilder extends TreeLSTMBuilder {
  private transient long swigCPtr;

  protected UnidirectionalTreeLSTMBuilder(long cPtr, boolean cMemoryOwn) {
    super(dynet_swigJNI.UnidirectionalTreeLSTMBuilder_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  protected static long getCPtr(UnidirectionalTreeLSTMBuilder obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        dynet_swigJNI.delete_UnidirectionalTreeLSTMBuilder(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public UnidirectionalTreeLSTMBuilder() {
    this(dynet_swigJNI.new_UnidirectionalTreeLSTMBuilder__SWIG_0(), true);
  }

  public UnidirectionalTreeLSTMBuilder(long layers, long input_dim, long hidden_dim, ParameterCollection model) {
    this(dynet_swigJNI.new_UnidirectionalTreeLSTMBuilder__SWIG_1(layers, input_dim, hidden_dim, ParameterCollection.getCPtr(model), model), true);
  }

  public void set_num_elements(int num) {
    dynet_swigJNI.UnidirectionalTreeLSTMBuilder_set_num_elements(swigCPtr, this, num);
  }

  public Expression add_input(int id, IntVector children, Expression x) {
    return new Expression(dynet_swigJNI.UnidirectionalTreeLSTMBuilder_add_input(swigCPtr, this, id, IntVector.getCPtr(children), children, Expression.getCPtr(x), x), true);
  }

  public ParameterCollection get_parameter_collection() {
    return new ParameterCollection(dynet_swigJNI.UnidirectionalTreeLSTMBuilder_get_parameter_collection(swigCPtr, this), false);
  }

  public void setLocal_model(ParameterCollection value) {
    dynet_swigJNI.UnidirectionalTreeLSTMBuilder_local_model_set(swigCPtr, this, ParameterCollection.getCPtr(value), value);
  }

  public ParameterCollection getLocal_model() {
    long cPtr = dynet_swigJNI.UnidirectionalTreeLSTMBuilder_local_model_get(swigCPtr, this);
    return (cPtr == 0) ? null : new ParameterCollection(cPtr, false);
  }

  public void setNode_builder(VanillaLSTMBuilder value) {
    dynet_swigJNI.UnidirectionalTreeLSTMBuilder_node_builder_set(swigCPtr, this, VanillaLSTMBuilder.getCPtr(value), value);
  }

  public VanillaLSTMBuilder getNode_builder() {
    long cPtr = dynet_swigJNI.UnidirectionalTreeLSTMBuilder_node_builder_get(swigCPtr, this);
    return (cPtr == 0) ? null : new VanillaLSTMBuilder(cPtr, false);
  }

  public void setH(ExpressionVector value) {
    dynet_swigJNI.UnidirectionalTreeLSTMBuilder_h_set(swigCPtr, this, ExpressionVector.getCPtr(value), value);
  }

  public ExpressionVector getH() {
    long cPtr = dynet_swigJNI.UnidirectionalTreeLSTMBuilder_h_get(swigCPtr, this);
    return (cPtr == 0) ? null : new ExpressionVector(cPtr, false);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy