浏览代码

Fixing warning being raised for no reason

/bullet-hell-barracuda-test-1.3.1
vincentpierre 4 年前
当前提交
c5708f06
共有 1 个文件被更改,包括 7 次插入3 次删除
  1. 10
      com.unity.ml-agents/Runtime/Inference/BarracudaModelParamLoader.cs

10
com.unity.ml-agents/Runtime/Inference/BarracudaModelParamLoader.cs


// If there are not enough Visual Observation Input compared to what the
// sensors expect.
var visObsIndex = 0;
var varLenIndex = 0;
for (var sensorIndex = 0; sensorIndex < sensorComponents.Length; sensorIndex++)
{
var sensor = sensorComponents[sensorIndex];

if (sensor.GetObservationShape().Length == 2)
{
if (!tensorsNames.Contains(
TensorNames.ObservationPlaceholderPrefix + sensorIndex))
TensorNames.ObservationPlaceholderPrefix + varLenIndex))
$"for sensor component {sensorIndex} ({sensor.GetType().Name}).");
$"for sensor component {varLenIndex} ({sensor.GetType().Name}).");
varLenIndex++;
}
}

}
var visObsIndex = 0;
var varLenIndex = 0;
for (var sensorIndex = 0; sensorIndex < sensorComponents.Length; sensorIndex++)
{
var sensorComponent = sensorComponents[sensorIndex];

}
if (sensorComponent.GetObservationShape().Length == 2)
{
tensorTester[TensorNames.ObservationPlaceholderPrefix + sensorIndex] =
tensorTester[TensorNames.ObservationPlaceholderPrefix + varLenIndex] =
varLenIndex++;
}
}

正在加载...
取消
保存