本文整理汇总了C++中Dimensions::isOnes方法的典型用法代码示例。如果您正苦于以下问题:C++ Dimensions::isOnes方法的具体用法?C++ Dimensions::isOnes怎么用?C++ Dimensions::isOnes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dimensions
的用法示例。
在下文中一共展示了Dimensions::isOnes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
// Deserialize region
Region::Region(const std::string& name,
const std::string& nodeType,
const Dimensions& dimensions,
BundleIO& bundle,
Network * network) :
name_(name),
type_(nodeType),
initialized_(false),
enabledNodes_(NULL),
network_(network)
{
// Set region info before creating the RegionImpl so that the
// Impl has access to the region info in its constructor.
RegionImplFactory & factory = RegionImplFactory::getInstance();
spec_ = factory.getSpec(nodeType);
// Dimensions start off as unspecified, but if
// the RegionImpl only supports a single node, we
// can immediately set the dimensions.
if (spec_->singleNodeOnly)
if (!dimensions.isDontcare() && !dimensions.isUnspecified() &&
!dimensions.isOnes())
NTA_THROW << "Attempt to deserialize region of type " << nodeType
<< " with dimensions " << dimensions
<< " but region supports exactly one node.";
dims_ = dimensions;
impl_ = factory.deserializeRegionImpl(nodeType, bundle, this);
createInputsAndOutputs_();
}
示例2:
bool
Dimensions::operator==(const Dimensions& dims2) const
{
if ((std::vector<size_t>)(*this) == (std::vector<size_t>)dims2)
return true;
if (isOnes() && dims2.isOnes())
return true;
return false;
}