Example #1
0
        private void UpdateNestedNodeType(NestedNodeTypeEnum nestedNodeType)
        {
            ITestingNestedNode newNestedNode;

            if (nestedNodeType == NestedNodeTypeEnum.Cowboy)
            {
                newNestedNode = new MemBlockCowboy("Poly");
            }
            else if (nestedNodeType == NestedNodeTypeEnum.Fooer)
            {
                newNestedNode = new Fooer();
            }
            else
            {
                throw new ArgumentOutOfRangeException(nameof(nestedNodeType), "Invalid nested node type.");
            }

            if (PolymorphNestedNode != null)
            {
                DestroyNestedMemoryBlocks(PolymorphNestedNode);
            }

            CreateNestedMemoryBlocks(newNestedNode);

            PolymorphNestedNode = newNestedNode;
        }
Example #2
0
        public override void UpdateMemoryBlocks()
        {
            var count = Input?.Count ?? 0;

            MemBlockCowboy.UpdateMemoryBlocks(count);

            MemBlockCowboyLateInit.UpdateMemoryBlocks(count);

            PolymorphNestedNode.InputCount = count;
            PolymorphNestedNode.UpdateMemoryBlocks();

            m_bazer.Baz.Count = 3 * count;

            Persistor.UpdateMemoryBlocks();
            Progressor.UpdateMemoryBlocks();

            VolatileOutput.Dims = new TensorDimensions(100, 100);
        }
Example #3
0
        public NestedMemBlocksNode()
        {
            MemBlockCowboyLateInit = new MemBlockCowboy("LateInit");
            CreateNestedMemoryBlocks(MemBlockCowboyLateInit);

            m_bazer = new Bazer();
            CreateNestedMemoryBlocks(m_bazer);

            CreateNestedMemoryBlocks(new object());  // Should emit a warning and otherwise be ignored.

            UpdateNestedNodeType(m_nestedNodeType);

            Persistor = new Persistor();
            CreateNestedMemoryBlocks(Persistor, "Per_");

            Progressor = new Persistor(-2.0f);
            CreateNestedMemoryBlocks(Progressor, "Pro_");
        }