Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TF:TRT] Remove dead code from convert_nodes.cc #53603

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 0 additions & 32 deletions tensorflow/compiler/tf2tensorrt/convert/convert_nodes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1767,38 +1767,6 @@ void Converter::ProvideQuantizationRange(ITensorProxyPtr* tensor,
}
}

namespace {

bool IsConvolution(const nvinfer1::ILayer* layer) {
return layer->getType() == nvinfer1::LayerType::kCONVOLUTION;
}

bool IsScale(const nvinfer1::ILayer* layer) {
return layer->getType() == nvinfer1::LayerType::kSCALE;
}

bool IsClipOrRelu(const nvinfer1::ILayer* layer) {
if (layer->getType() != nvinfer1::LayerType::kACTIVATION) {
return false;
}
auto activation_type = static_cast<const nvinfer1::IActivationLayer*>(layer)
->getActivationType();

return activation_type == nvinfer1::ActivationType::kRELU ||
activation_type == nvinfer1::ActivationType::kCLIP;
}

bool IsAdd(const nvinfer1::ILayer* layer) {
if (layer->getType() != nvinfer1::LayerType::kELEMENTWISE) {
return false;
}
auto operation =
static_cast<const nvinfer1::IElementWiseLayer*>(layer)->getOperation();
return operation == nvinfer1::ElementWiseOperation::kSUM;
}

} // namespace

void Converter::MaybeApplyQuantizationRanges() {
if (precision_mode() != TrtPrecisionMode::INT8) return;

Expand Down