mirror of
https://github.com/huggingface/candle.git
synced 2025-06-20 04:00:28 +00:00
Move the constant to avoid some unused warning. (#837)
This commit is contained in:
@ -11,10 +11,6 @@ use cudarc::driver::{
|
|||||||
use half::{bf16, f16};
|
use half::{bf16, f16};
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
|
|
||||||
const USE_IM2COL_CONV1D: bool = true;
|
|
||||||
#[cfg(not(feature = "cudnn"))]
|
|
||||||
const USE_IM2COL_CONV2D: bool = true;
|
|
||||||
|
|
||||||
/// cudarc related errors
|
/// cudarc related errors
|
||||||
#[derive(thiserror::Error, Debug)]
|
#[derive(thiserror::Error, Debug)]
|
||||||
pub enum CudaError {
|
pub enum CudaError {
|
||||||
@ -1760,6 +1756,8 @@ impl BackendStorage for CudaStorage {
|
|||||||
kernel_l: &Layout,
|
kernel_l: &Layout,
|
||||||
params: &crate::conv::ParamsConv1D,
|
params: &crate::conv::ParamsConv1D,
|
||||||
) -> Result<Self> {
|
) -> Result<Self> {
|
||||||
|
const USE_IM2COL_CONV1D: bool = true;
|
||||||
|
|
||||||
let device = self.device().clone();
|
let device = self.device().clone();
|
||||||
if !USE_IM2COL_CONV1D {
|
if !USE_IM2COL_CONV1D {
|
||||||
let slice = Conv1D(params).map(&self.slice, l, &kernel.slice, kernel_l, &device)?;
|
let slice = Conv1D(params).map(&self.slice, l, &kernel.slice, kernel_l, &device)?;
|
||||||
@ -1808,6 +1806,8 @@ impl BackendStorage for CudaStorage {
|
|||||||
kernel_l: &Layout,
|
kernel_l: &Layout,
|
||||||
params: &crate::conv::ParamsConv2D,
|
params: &crate::conv::ParamsConv2D,
|
||||||
) -> Result<Self> {
|
) -> Result<Self> {
|
||||||
|
const USE_IM2COL_CONV2D: bool = true;
|
||||||
|
|
||||||
let device = self.device().clone();
|
let device = self.device().clone();
|
||||||
if !USE_IM2COL_CONV2D {
|
if !USE_IM2COL_CONV2D {
|
||||||
let slice = Conv2D(params).map(&self.slice, l, &kernel.slice, kernel_l, &device)?;
|
let slice = Conv2D(params).map(&self.slice, l, &kernel.slice, kernel_l, &device)?;
|
||||||
|
Reference in New Issue
Block a user