public void Contruction ( )
{
var bp = new BrainParameters ( ) ;
var tensorGenerator = new TensorGenerator ( bp , 0 , new TensorCachingAllocator ( ) ) ;
var alloc = new TensorCachingAllocator ( ) ;
var tensorGenerator = new TensorGenerator ( bp , 0 , alloc ) ;
alloc . Dispose ( ) ;
}
[Test]
var alloc = new TensorCachingAllocator ( ) ;
var generator = new BatchSizeGenerator ( new TensorCachingAllocator ( ) ) ;
var generator = new BatchSizeGenerator ( alloc ) ;
alloc . Dispose ( ) ;
}
[Test]
var alloc = new TensorCachingAllocator ( ) ;
var generator = new SequenceLengthGenerator ( new TensorCachingAllocator ( ) ) ;
var generator = new SequenceLengthGenerator ( alloc ) ;
alloc . Dispose ( ) ;
}
[Test]
} ;
var batchSize = 4 ;
var agentInfos = GetFakeAgentInfos ( ) ;
var generator = new VectorObservationGenerator ( new TensorC achingA llocator ( ) ) ;
var alloc = new TensorCachingAllocator ( ) ;
var generator = new VectorObservationGenerator ( alloc ) ;
generator . Generate ( inputTensor , batchSize , agentInfos ) ;
Assert . IsNotNull ( inputTensor . Data ) ;
Assert . AreEqual ( inputTensor . Data [ 0 , 0 ] , 1 ) ;
alloc . Dispose ( ) ;
}
[Test]
} ;
var batchSize = 4 ;
var agentInfos = GetFakeAgentInfos ( ) ;
var generator = new RecurrentInputGenerator ( new TensorC achingA llocator ( ) ) ;
var alloc = new TensorCachingAllocator ( ) ;
var generator = new RecurrentInputGenerator ( alloc ) ;
generator . Generate ( inputTensor , batchSize , agentInfos ) ;
Assert . IsNotNull ( inputTensor . Data ) ;
Assert . AreEqual ( inputTensor . Data [ 0 , 0 ] , 0 ) ;
alloc . Dispose ( ) ;
}
[Test]
} ;
var batchSize = 4 ;
var agentInfos = GetFakeAgentInfos ( ) ;
var generator = new PreviousActionInputGenerator ( new TensorC achingA llocator ( ) ) ;
var alloc = new TensorCachingAllocator ( ) ;
var generator = new PreviousActionInputGenerator ( alloc ) ;
generator . Generate ( inputTensor , batchSize , agentInfos ) ;
Assert . IsNotNull ( inputTensor . Data ) ;
Assert . AreEqual ( inputTensor . Data [ 1 , 1 ] , 4 ) ;
alloc . Dispose ( ) ;
}
[Test]
} ;
var batchSize = 4 ;
var agentInfos = GetFakeAgentInfos ( ) ;
var generator = new ActionMaskInputGenerator ( new TensorC achingA llocator ( ) ) ;
var alloc = new TensorCachingAllocator ( ) ;
var generator = new ActionMaskInputGenerator ( alloc ) ;
generator . Generate ( inputTensor , batchSize , agentInfos ) ;
Assert . IsNotNull ( inputTensor . Data ) ;
Assert . AreEqual ( inputTensor . Data [ 0 , 0 ] , 1 ) ;
alloc . Dispose ( ) ;
}
}
}