public override void SetInspector(GameObject inspector, GameObject singleInput, GameObject singleSelect)
    {
        Inspector inspector1 = inspector.GetComponent<Inspector>();
        inspector.transform.Find("Quad/NodeName").GetComponent<TextMesh>().text = "Max Pooling Layer";

        var poolShapeObj = Instantiate(singleInput);
        inspector1.Add(poolShapeObj.transform);
        poolShapeObj.GetComponent<ParamTypein>().SetValue("Pool Shape", poolShape.ToString());

        var strideObj = Instantiate(singleInput);
        inspector1.Add(strideObj.transform);
        strideObj.GetComponent<ParamTypein>().SetValue("Stride", stride.ToString());

        var padObj = Instantiate(singleSelect);
        inspector1.Add(padObj.transform);
        padObj.GetComponent<ParamSelect>().SetType(typeof(MyBoolean), "Pad", (int)pad);

        var lowerPadObj = Instantiate(singleInput);
        inspector1.Add(lowerPadObj.transform);
        lowerPadObj.GetComponent<ParamTypein>().SetValue("Lower Pad", lowerPad.ToString());

        var upperPadObj = Instantiate(singleInput);
        inspector1.Add(upperPadObj.transform);
        upperPadObj.GetComponent<ParamTypein>().SetValue("Upper Pad", upperPadObj.ToString());

        inspector1.OnSave = () =>
        {
            poolShape = Convert.ToUInt32(poolShapeObj.GetComponent<ParamTypein>().GetValue());
            stride = Convert.ToUInt32(strideObj.GetComponent<ParamTypein>().GetValue());
            pad = (MyBoolean)padObj.GetComponent<ParamSelect>().GetValue();
            lowerPad = Convert.ToUInt32(lowerPadObj.GetComponent<ParamTypein>().GetValue());
            upperPad = Convert.ToUInt32(upperPadObj.GetComponent<ParamTypein>().GetValue());
        };
    }
Beispiel #2
0
    public override void SetInspector(GameObject inspector, GameObject singleInput, GameObject singleSelect)
    {
        Inspector inspector1 = inspector.GetComponent <Inspector>();

        inspector.transform.Find("Quad/NodeName").GetComponent <TextMesh>().text = "Linear Layer";

        var initObj = Instantiate(singleSelect);

        inspector1.Add(initObj.transform);
        initObj.GetComponent <ParamSelect>().SetType(typeof(RandomInitialization), "init", (int)init);

        var outDimObj = Instantiate(singleInput);

        inspector1.Add(outDimObj.transform);
        outDimObj.GetComponent <ParamTypein>().SetValue("outDim", outDim.ToString());

        var initValueScaleObj = Instantiate(singleInput);

        inspector1.Add(initValueScaleObj.transform);
        initValueScaleObj.GetComponent <ParamTypein>().SetValue("initValueScale", initValueScale.ToString());

        var biasObj = Instantiate(singleSelect);

        inspector1.Add(biasObj.transform);
        biasObj.GetComponent <ParamSelect>().SetType(typeof(MyBoolean), "Bias", (int)bias);

        inspector1.OnSave = () =>
        {
            Debug.Log(GetHashCode());
            init           = (RandomInitialization)initObj.GetComponent <ParamSelect>().GetValue();
            outDim         = System.Convert.ToUInt32(outDimObj.GetComponent <ParamTypein>().GetValue());
            initValueScale = System.Convert.ToSingle(initValueScaleObj.GetComponent <ParamTypein>().GetValue());
            bias           = (MyBoolean)biasObj.GetComponent <ParamSelect>().GetValue();
        };
    }
Beispiel #3
0
        public static int Main()
        {
            MyBoolean b = true;

            if (true && b)
            {
                return(0);
            }
            else
            {
                return(100);
            }
        }
 /// <summary>
 /// Returns the hashcode of this Object
 /// </summary>
 /// <returns>Hash code (int)</returns>
 public override int GetHashCode()
 {
     // Credit: http://stackoverflow.com/a/263416/677735
     unchecked             // Overflow is fine, just wrap
     {
         int hash = 41;
         // Suitable nullity checks etc, of course :)
         if (Id != null)
         {
             hash = hash * 59 + Id.GetHashCode();
         }
         if (Name != null)
         {
             hash = hash * 59 + Name.GetHashCode();
         }
         if (Description != null)
         {
             hash = hash * 59 + Description.GetHashCode();
         }
         if (MyBoolean != null)
         {
             hash = hash * 59 + MyBoolean.GetHashCode();
         }
         if (MyCreditCard != null)
         {
             hash = hash * 59 + MyCreditCard.GetHashCode();
         }
         if (MyCurrency != null)
         {
             hash = hash * 59 + MyCurrency.GetHashCode();
         }
         if (MyDateTime != null)
         {
             hash = hash * 59 + MyDateTime.GetHashCode();
         }
         if (MyDouble != null)
         {
             hash = hash * 59 + MyDouble.GetHashCode();
         }
         if (MyEmail != null)
         {
             hash = hash * 59 + MyEmail.GetHashCode();
         }
         if (MyFloat != null)
         {
             hash = hash * 59 + MyFloat.GetHashCode();
         }
         if (MyImageUrl != null)
         {
             hash = hash * 59 + MyImageUrl.GetHashCode();
         }
         if (MyInteger != null)
         {
             hash = hash * 59 + MyInteger.GetHashCode();
         }
         if (MyLong != null)
         {
             hash = hash * 59 + MyLong.GetHashCode();
         }
         if (MyPhone != null)
         {
             hash = hash * 59 + MyPhone.GetHashCode();
         }
         if (MyPostalCode != null)
         {
             hash = hash * 59 + MyPostalCode.GetHashCode();
         }
         if (MyString != null)
         {
             hash = hash * 59 + MyString.GetHashCode();
         }
         if (MyTextArea != null)
         {
             hash = hash * 59 + MyTextArea.GetHashCode();
         }
         if (MyTicks != null)
         {
             hash = hash * 59 + MyTicks.GetHashCode();
         }
         if (MyUrl != null)
         {
             hash = hash * 59 + MyUrl.GetHashCode();
         }
         if (Comments != null)
         {
             hash = hash * 59 + Comments.GetHashCode();
         }
         if (AuditEntered != null)
         {
             hash = hash * 59 + AuditEntered.GetHashCode();
         }
         if (AuditEnteredBy != null)
         {
             hash = hash * 59 + AuditEnteredBy.GetHashCode();
         }
         if (AuditUpdated != null)
         {
             hash = hash * 59 + AuditUpdated.GetHashCode();
         }
         if (AuditUpdatedBy != null)
         {
             hash = hash * 59 + AuditUpdatedBy.GetHashCode();
         }
         return(hash);
     }
 }
Beispiel #5
0
		public static int Main ()
		{
			Blah k, l;

			k = new Blah (2) + new Blah (3);
			if (k.i != 5)
				return 1;
			
			k = ~ new Blah (5);
			if (k.i != -6)
				return 1;
			
			
			k = + new Blah (4);
			if (k.i != 4)
				return 1;
			
			k = - new Blah (21);
			if (k.i != -21)
				return 1;

			k = new Blah (22) - new Blah (21);
			if (k.i != 1)
				return 1;

			if (!k)
				Console.WriteLine ("! returned true");

			int number = k;
			if (number != 1)
				return 1;
			
			k++;	
			++k;

			if (k)
				Console.WriteLine ("k is definitely true");

			k = new Blah (30);

			double f = (double) k;

			if (f != 30.0)
				return 1;

			int i = new Blah (5) * new Blah (10);

			if (i != 50)
				return 1;

			k = new Blah (50);
			l = new Blah (10);
			
			i = k / l;

			if (i != 5)
				return 1;

			i = k % l;

			if (i != 0)
				return 1;

			MyBoolean myb = new MyBoolean ();

			if (!myb)
				return 10;

			//
			// Tests the conditional operator invoking operator true
			MyTrueFalse mf = new MyTrueFalse ();
			int x = mf ? 1 : 2;
			if (x != 1)
				return 11;
			
			Console.WriteLine ("Test passed");
			return 0;
		}
Beispiel #6
0
        public static int Main()
        {
            Blah k, l;

            k = new Blah(2) + new Blah(3);
            if (k.i != 5)
            {
                return(1);
            }

            k = ~new Blah(5);
            if (k.i != -6)
            {
                return(1);
            }


            k = +new Blah(4);
            if (k.i != 4)
            {
                return(1);
            }

            k = -new Blah(21);
            if (k.i != -21)
            {
                return(1);
            }

            k = new Blah(22) - new Blah(21);
            if (k.i != 1)
            {
                return(1);
            }

            if (!k)
            {
                Console.WriteLine("! returned true");
            }

            int number = k;

            if (number != 1)
            {
                return(1);
            }

            k++;
            ++k;

            if (k)
            {
                Console.WriteLine("k is definitely true");
            }

            k = new Blah(30);

            double f = (double)k;

            if (f != 30.0)
            {
                return(1);
            }

            int i = new Blah(5) * new Blah(10);

            if (i != 50)
            {
                return(1);
            }

            k = new Blah(50);
            l = new Blah(10);

            i = k / l;

            if (i != 5)
            {
                return(1);
            }

            i = k % l;

            if (i != 0)
            {
                return(1);
            }

            MyBoolean myb = new MyBoolean();

            if (!myb)
            {
                return(10);
            }

            //
            // Tests the conditional operator invoking operator true
            MyTrueFalse mf = new MyTrueFalse();
            int         x  = mf ? 1 : 2;

            if (x != 1)
            {
                return(11);
            }

            Console.WriteLine("Test passed");
            return(0);
        }